kubernauts / jmeter-kubernetes

Load testing as a service (LTaaS) with Apache Jmeter on kubernetes
Apache License 2.0
362 stars 249 forks source link

Failure when running sample load test #4

Closed fppt closed 4 years ago

fppt commented 6 years ago

Hi,

I have been stepping through the great article you guys provided at medium but when I get to the stage when I run the sample load test:

./start_test.sh 

I get the following back:

Error: Missing argument to option -R
Usage
    --?
        print command line options and exit
    -h, --help
        print usage information and exit
    -v, --version
        print the version information and exit
    -p, --propfile <argument>
        the jmeter property file to use
    -q, --addprop <argument>
        additional JMeter property file(s)
    -t, --testfile <argument>
        the jmeter test(.jmx) file to run. "-t LAST" will load last
        used file
    -l, --logfile <argument>
        the file to log samples to
    -i, --jmeterlogconf <argument>
        jmeter logging configuration file (log4j2.xml)
    -j, --jmeterlogfile <argument>
        jmeter run log file (jmeter.log)
    -n, --nongui
        run JMeter in nongui mode
    -s, --server
        run the JMeter server
    -H, --proxyHost <argument>
        Set a proxy server for JMeter to use
    -P, --proxyPort <argument>
        Set proxy server port for JMeter to use
    -N, --nonProxyHosts <argument>
        Set nonproxy host list (e.g. *.apache.org|localhost)
    -u, --username <argument>
        Set username for proxy server that JMeter is to use
    -a, --password <argument>
        Set password for proxy server that JMeter is to use
    -J, --jmeterproperty <argument>=<value>
        Define additional JMeter properties
    -G, --globalproperty <argument>=<value>
        Define Global properties (sent to servers)
        e.g. -Gport=123
         or -Gglobal.properties
    -D, --systemproperty <argument>=<value>
        Define additional system properties
    -S, --systemPropertyFile <argument>
        additional system property file(s)
    -f, --forceDeleteResultFile
        force delete existing results files before start the test
    -L, --loglevel <argument>=<value>
        [category=]level e.g. jorphan=INFO, jmeter.util=DEBUG or com
        .example.foo=WARN
    -r, --runremote
        Start remote servers (as defined in remote_hosts)
    -R, --remotestart <argument>
        Start these remote servers (overrides remote_hosts)
    -d, --homedir <argument>
        the jmeter home directory to use
    -X, --remoteexit
        Exit the remote servers at end of test (non-GUI)
    -g, --reportonly <argument>
        generate report dashboard only, from a test results file
    -e, --reportatendofloadtests
        generate report dashboard after load test
    -o, --reportoutputfolder <argument>
        output folder for report dashboard

This happens even when running the command directly and from within the pod:

kubectl exec -n $tenant $master_pod /jmeter/load_test cloudssky.jmx

The only change I had to make was the version in the deployment yamls from apiVersion: apps/v1beta2 to apiVersion: apps/v1beta1 because I am running on an older version of k8.

(This is all on a minikube environment)

Can anyone help me out?

infinitydon commented 6 years ago

Hi fppt,

What is the output of the following command from your Jmeter master pod:

getent ahostsv4 jmeter-slaves-svc | cut -d' ' -f1 | sort -u | awk -v ORS=, '{print $1}' | sed 's/,$//'

fppt commented 6 years ago

No response:

Filipe-Teixeira:jmeter-kubernetes filipeteixeira$ kubectl exec -ti -n $tenant $master_pod -- getent ahostsv4 jmeter-slaves-svc | cut -d' ' -f1 | sort -u | awk -v ORS=, '{print $1}' | sed 's/,$//'
Filipe-Teixeira:jmeter-kubernetes filipeteixeira$

Same when doing it from within the pod.

fppt commented 6 years ago

Progress! I simply restarted my minikube now I am getting this issue:

Filipe-Teixeira:jmeter-kubernetes filipeteixeira$ ./start_test.sh
Enter path to the jmx file cloudssky.jmx
rpc error: code = 13 desc = invalid header field value "oci runtime error: exec failed: container_linux.go:247: starting container process caused \"exec: \\\"/jmeter/load_test\\\": stat /jmeter/load_test: no such file or directory\"\n"
DasyDong commented 6 years ago

I had met the same issue, in the master pod , run below command, nothing return. getent ahostsv4 jmeter-slaves-svc

I didn't change any code , Can anyone has some ideas? @infinitydon seems that in master pod , we couldn't get jmeter-slaves-svc info

infinitydon commented 6 years ago

I will check this.. Please can you specify the kubernetes version you are using? Also the type of deployment

DasyDong commented 6 years ago

it run kubernetes in minikube version: v0.25.0 and kubectl is Client Version: v1.9.0 Server Version: v1.9.0. I followed step in https://blog.kubernauts.io/load-testing-as-a-service-with-jmeter-on-kubernetes-fc5288bb0c8b

sirfengyu commented 6 years ago

I had met the same issue, in the master pod , run below command, nothing return. getent ahostsv4 jmeter-slaves-svc and run /jmeter/apache-jmeter-4.0/bin/jmeter -n -t /root/checkNginx.jmx -R 172.20.0.16,172.20.1.14 return

root@jmeter-master-5477768dd8-f6ncd:/jmeter# 
r -n -t /root/checkNginx.jmx -R 172.20.0.16,172.20.1.14ache-jmeter-4.0/bin/jmeter
Jul 23, 2018 10:14:12 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Creating summariser <summary>
Created the tree successfully using /root/checkNginx.jmx
Configuring remote engine: 172.20.0.16
Exception creating connection to: 172.20.0.16; nested exception is: 
    java.io.FileNotFoundException: rmi_keystore.jks (No such file or directory)
Failed to configure 172.20.0.16
Configuring remote engine: 172.20.1.14
Exception creating connection to: 172.20.1.14; nested exception is: 
    java.io.FileNotFoundException: rmi_keystore.jks (No such file or directory)
Failed to configure 172.20.1.14
Stopping remote engines
Remote engines have been stopped
Error in NonGUIDriver java.lang.RuntimeException: Following remote engines could not be configured:[172.20.0.16, 172.20.1.14]

172.20.0.16,172.20.1.14 is slave jmeter pod ip

sirfengyu commented 6 years ago

i foud that jmeter-server should start with parameter -Djava.rmi.server.hostname=$(MY_POD_IP). modify Dockerfile-slave,remove

ENTRYPOINT $JMETER_HOME/bin/jmeter-server \
-Dserver.rmi.localport=50000 \
-Dserver_port=1099

and modify jmeter_slave_develop.yaml,add

apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: jmeter-slaves
  labels:
    jmeter_mode: slave
spec:
  replicas: 2 
  selector:
    matchLabels:
      jmeter_mode: slave
  template:
    metadata:
      labels:
        jmeter_mode: slave
    spec:
      containers:
      - name: jmslave
        image: sirfengyu/jmeter-slave
        command: ["/jmeter/apache-jmeter-3.3/bin/jmeter-server"]
        args: ["-Djava.rmi.server.hostname=$(MY_POD_IP)", "-Dserver.rmi.localport=50000", "-Dserver_port=1099"]
        ports:
        - containerPort: 1099
        - containerPort: 50000
        env:
          - name: MY_POD_IP
            valueFrom:
              fieldRef:
                fieldPath: status.podIP

whether it works or not needs to be testsd.

orenzp commented 5 years ago

Just my 2 cent, I was able to solve this issue by troubleshooting my Minikube CoreDNS deployment. It seem that CoreDNS was down so that why the test didn't work.

minikube version: v1.1.1

infinitydon commented 5 years ago

@orenzp is right... We don't use the POD IP directly rather we use the service name.. If you have issues with your kubernetes DNS then you will experience some difficulty.. You should always ensure that your DNS is working optimally..

arashkaffamanesh commented 4 years ago

no issue :-)

rthamrin commented 2 years ago

I am using K3S and has the same error about

# ./start_test.sh

Enter path to the jmx file cloudssky.jmx

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/jmeter/apache-jmeter-5.0/lib/log4j-slf4j-impl-2.11.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/jmeter/apache-jmeter-5.0/lib/ext/pepper-box-1.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]

Error: Missing argument to option -R

Usage