Gaurav Kukade
Gaurav Kukade

Reputation: 313

Not able to create 'rmi_keystore.jks' for jmeter distributed testing

I am trying to load test my application using jmeter with remote hosts.

But I am not able to create a 'rmi_keystore.jks' using 'sh create-rmi-keystore.sh' under /bin directory of the Jmeter folder.

When I entered the following command it gives the create-rmi-keystore.sh: 19: keytool: not found

xyz@xyz-HP-EliteBook-840-G2:~$ cd /opt/apache-jmeter-5.4.1/bin/
xyz@xyz-HP-EliteBook-840-G2:/opt/apache-jmeter-5.4.1/bin$ sh create-rmi-keystore.sh 
create-rmi-keystore.sh: 19: keytool: not found
Copy the generated rmi_keystore.jks to jmeter/bin folder or reference it in property 'server.rmi.ssl.keystore.file'
xyz@xyz-HP-EliteBook-840-G2:/opt/apache-jmeter-5.4.1/bin$

After reading on the internet i found i have to add the jdk /bin path to the PATH var

xyz@xyz-HP-EliteBook-840-G2:/opt/apache-jmeter-5.4.1/bin$ export JAVA_HOME=/opt/jdk/jdk1.8.0_202
xyz@xyz-HP-EliteBook-840-G2:/opt/apache-jmeter-5.4.1/bin$ export PATH=$PATH:$JAVA_HOME/bin
xyz@xyz-HP-EliteBook-840-G2:/opt/apache-jmeter-5.4.1/bin$ echo $PATH
/home/xyz/.nvm/versions/node/v10.16.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/xyz/gaurav/soft/jdk1.8.0_202/bin/bin:/opt/jdk/jdk1.8.0_202/bin
xyz@xyz-HP-EliteBook-840-G2:/opt/apache-jmeter-5.4.1/bin$

still I am getting keytool error: java.io.FileNotFoundException: rmi_keystore.jks (Permission denied) error

xyz@xyz-HP-EliteBook-840-G2:/opt/apache-jmeter-5.4.1/bin$ sh create-rmi-keystore.sh 
What is your first and last name?
  [Unknown]:  rmi
What is the name of your organizational unit?
  [Unknown]:  A
What is the name of your organization?
  [Unknown]:  B
What is the name of your City or Locality?
  [Unknown]:  C
What is the name of your State or Province?
  [Unknown]:  D
What is the two-letter country code for this unit?
  [Unknown]:  IN
Is CN=rmi, OU=A, O=B, L=C, ST=D, C=IN correct?
  [no]:  yes

Enter key password for <rmi>
    (RETURN if same as keystore password):  
Re-enter new password: 
keytool error: java.io.FileNotFoundException: rmi_keystore.jks (Permission denied)
Copy the generated rmi_keystore.jks to jmeter/bin folder or reference it in property 'server.rmi.ssl.keystore.file'
xyz@xyz-HP-EliteBook-840-G2:/opt/apache-jmeter-5.4.1/bin$

finally tried with sudo sh create-rmi-keystore.sh but it gives create-rmi-keystore.sh: 19: keytool: not found

xyz@xyz-HP-EliteBook-840-G2:/opt/apache-jmeter-5.4.1/bin$ sudo sh create-rmi-keystore.sh 
[sudo] password for xyz: 
create-rmi-keystore.sh: 19: keytool: not found
Copy the generated rmi_keystore.jks to jmeter/bin folder or reference it in property 'server.rmi.ssl.keystore.file'
xyz@xyz-HP-EliteBook-840-G2:/opt/apache-jmeter-5.4.1/bin$ 

I am using Ubuntu 20.04 and JMeter 5.4.1

Please help how can i generate rmi_keystore.jks?

Upvotes: 0

Views: 3018

Answers (1)

Dmitri T
Dmitri T

Reputation: 168197

You cannot create the keystore because your user doesn't have write permissions for the current folder, you can grant your current user ownership for the JMeter folder using chmod like:

sudo chown -R $USER:$USER /opt/apache-jmeter-5.4.1/

once done you should be able to generate the keystore.

Just in case if you don't want/need secure communication between master and slaves you can add the next line to user.properties file

server.rmi.ssl.disable=true

this way JMeter won't look for the rmi_keystore.jks file.

More information:

Upvotes: 2

Related Questions