open JMeter in distributed mode - jmeter

I'm unable to open JMeter in 'Server Mode'. I have followed the following steps.
Steps to reproduce:
Open cmd
To open JMeter in server mode, run the bat file bin\jmeter-server.bat.
Expected Result: JMeter should start in server mode.
Actual Result:
Problem URL:
... Trying JMETER_HOME=..
Found ApacheJMeter_core.jar
Sep 12, 2018 1:33:34 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Server failed to start: java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (The system cannot find the file specified)
An error occurred: Listen failed on port: 0; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (The system cannot find the file specified)
errorlevel=1
Press any key to continue . . .
C:\Users\rozeena.ibrahim>d:
D:\>cd apache-jmeter-4.0
D:\apache-jmeter-4.0>cd bin
D:\apache-jmeter-4.0\bin>jmeter-server.bat
Could not find ApacheJmeter_core.jar ...
... Trying JMETER_HOME=..
Found ApacheJMeter_core.jar
Sep 12, 2018 1:34:12 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Server failed to start: java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (The system cannot find the file specified)
An error occurred: Listen failed on port: 0; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (The system cannot find the file specified)
errorlevel=1
Press any key to continue . . .

This is not a bug, since JMeter 4.0 communication between master and slaves is secure (maybe to prevent possible intruders from intercepting JMeter .jtl result file and dying of laughter seeing your system performance metrics) so you need to generate the keystore using create-rmi-keystore.bat first on master and all the slaves.
Alternatively you can disable this piece of functionality and revert back to previous JMeter behaviour by adding the next line to user.properties file:
server.rmi.ssl.disable=true
it needs to be done on all machines
JMeter restart will be required to pick the property up
the change will be permanent, if you want to do it only once - it is better to pass the property via -J command-line argument like:
jmeter-server.bat -Jserver.rmi.ssl.disable=true
More information:
Remote hosts and RMI configuration
Configuring JMeter
Overriding Properties Via The Command Line
JMeter Distributed Testing with Docker

If you just want to run jmeter in NON GUI mode then do this:
jmeter -n -t jmxplan -l results.csv
But if you really want to use distributed testing, then since JMeter 4.0 the default transport mechanism for RMI will use SSL.
SSL needs keys and certificates to work. You will have to create those keys yourself.
You must create the rmi_keystore.jks as per error message.
JMeter comes with a script to generate a keystore that contains one key (and its corresponding certificate) named rmi.
The script is located in the bin directory and is available for Windows systems (called bin/create-rmi-keystore.bat) and Unix like systems (called bin/create-rmi-keystore.sh).
It will generate a key-pair, that is valid for seven days, with a default passphrase of value 'changeit'. It is advised to call it from inside the bin directory.
See:
https://jmeter.apache.org/usermanual/remote-test.html#setup_ssl
Note that disabling SSL mode would be a security issue, so although possible it is not advised

Related

java.net.SocketException: Unrecognized Windows Sockets error: 0: recv failed Jmeter

I run the load test in JMeter and i got this error.
Non HTTP response code: javax.net.ssl.SSLException/Non HTTP response message: java.net.SocketException: Unrecognized Windows Sockets error: 0: recv failed
why this kind of error i got??
Can it be the case your system has both IPv4 and IPv6 enabled? If so you may run into situation when the request is being written in one thread and response comes in another hence it's "unrecognized"
So either choose one of network protocols in the operating system level and disable the other or limit JMeter to use only IPv4 by adding the next line to it's startup script:
jmeter -Djava.net.preferIPv4Stack=true -n -t test.jmx .....
if it helps you can make the change permanent by adding the next line to system.properties file (lives in "bin" folder of your JMeter installation):
java.net.preferIPv4Stack=true
More information:
Configuring JMeter
Overriding Properties Via The Command Line
Apache JMeter Properties Customization Guide

Jmeter _ Input file path setup in batch file

I tried to set input file path as below. But getting error as
"WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.".
Can some one help me.
This is how I've configured:
cd D:\Automation\Jmeter_Param\apache-jmeter-4.0\apache-jmeter-4.0\bin\
set my_dataset=D:\Automation\Jmeter_Param\apache-jmeter-4.0\apache-jmeter-4.0\bin\Deactivate.csv
set my_txnset=D:\Automation\Jmeter_Param\apache-jmeter-4.0\apache-jmeter-4.0\bin\Deactivate\credentials_prod.csv
jmeter -n -t D:\Automation\Jmeter_Param\apache-jmeter-4.0\apache-jmeter-4.0\bin\Deactivate\Deactivate.jmx
Here my_dataset and my_txnset has been called out under Global and used.
As per JMeter release notes:
Note that under some windows systems you may have this WARNING:
java.util.prefs.WindowsPreferences
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0
x80000002. Windows RegCreateKeyEx(…) returned error code 5.
The fix is to run JMeter as Administrator, it will create the registry key for you, then you can restart JMeter as a normal user and you won't have the warning anymore.
So just run the command prompt as Administrator once and issue will go away.
Also be aware that according to 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article you should always be using the latest version of JMeter so consider upgrading to JMeter 5.2.1 (or whatever is the latest stable version available at JMeter Downloads page) on next available opportunity

Jmeter Distributed Setup works in GUI but not the command line

I am running Windows 7 Pro with JMeter 4.0 r1823414 on all 5 machines with Java JDK 1.8.0_144 on all of them as well. All paths and ENV Vars are identical across all machines. I set my remote hosts in the master and I am able to see them on the GUI inside the master. I built the rmi_keystore.jks on a slave machine and copied it into the bin folder in every machine. I successfully started all the servers on the slave machines and see the successful attachment of the rmi (running the jmeter-server.bat):
Found ApacheJMeter_core.jar
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xbootclasspath/a:"C:\Program Files
(x86)\HP\Unified Functional Testing\bin\java_shared\classes\jasmine.jar"
Created remote object: UnicastServerRef2 [liveRef: [endpoint:
[<ip:port>,SSLRMIServerSocketFactory(host=<host_name/IP>,
keyStoreLocation=rmi_keystore.jks, type=JKS,
trustStoreLocation=rmi_keystore.jks, type=JKS, alias=rmi),
SSLRMIClientSocketFactory(keyStoreLocation=rmi_keystore.jks, type=JKS,
trustStoreLocation=rmi_keystore.jks, type=JKS, alias=rmi)](local),objID:
[<stuff>:-7fff, <more_stuff>]]]
Running a basic HTTP call I am able to run from the master to all 4 slave machines (individually and all at once) and get results without issue from the GUI. My problem is from the command line. I cannot get the test to run. I have tried:
jmeter -n -t distributed_test_4_slaves.jmx -r -l distributedLog_Test.jtl -Jserver.rmi.ssl.keystore.file=rmi_keystore.jks
jmeter -n -t distributed_test_4_slaves.jmx -r -l distributedLog_Test.jtl
jmeter -n -t distributed_test_4_slaves.jmx -R <all_my machine_names> -l distributedLog_Test.jtl (with and without -Jserver.rmi.ssl.keystore.file=rmi_keystore.jks)
jmeter -n -t distributed_test_4_slaves.jmx -R <all_my machine_names:ports> -l distributedLog_Test.jtl (with and without -Jserver.rmi.ssl.keystore.file=rmi_keystore.jks)
jmeter -n -t distributed_test_4_slaves.jmx -R <all_my machine_ips(with and without ports)> -l distributedLog_Test.jtl (with and without -Jserver.rmi.ssl.keystore.file=rmi_keystore.jks)
Every time I get the same errors in the command line:
Creating summariser <summary>
Created the tree successfully using distributed_test_4_slaves.jmx
#The next 5 lines repeat for each slave
Configuring remote engine: <slave_1..4>
Exception creating connection to: <slave_1..4>; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (The system cannot
find the file specified)
Failed to configure <slave_1..4>
Stopping remote engines
Remote engines have been stopped
Error in NonGUIDriver java.lang.RuntimeException: Following remote
engines could not be configured:[
<slave_1>, <slave_2>, <slave_3>, <slave_4>]
What am I missing? Why would it run and work in the GUI but not on the command line? Something cannot be right.
Make sure that
You either run JMeter from its "bin" folder
Or have rmi_keystore.jks in the folder where you're running JMeter from
as the error clearly states that JMeter tries to load rmi_keystore.jks file and fails
One more thing to try is providing full path to the rmi_keystore.jks file via server.rmi.ssl.keystore.file property.
You can also completely disable secure RMI communication by setting server.rmi.ssl.disable property to true
Normally jmeter.log file should contain the root cause of the issue, if it doesn't or not very informative - you can increase JMeter log verbosity for selected clas(ses) or package(s).

Unable to connect to remote machine in jmeter

I am trying to launch my jmeter tests in a remote machine as i will be running bulk users on a .jmx file (Approx 200 000 threads). I have a remote machine where i have downloaded jmeter and saved the folder in desktop. and in command prompt i have a command
Desktop\apache-jmeter-4.0\bin>jmeter-server -n
Could not find ApacheJmeter_core.jar ...
... Trying JMETER_HOME=..
Found ApacheJMeter_core.jar
Created remote object: <Have a message saying the server is up and running>
Now in jenkins i have a command
export JAVA_HOME=/java/1.8.0.65
bin//jmeter -n -R <Remote HOst IP> -t file.jmx -l result.jtl -e -o/resultfolder
When i trigger the job in jenkins i am getting
Configuring remote engine: <Remote machine IP>
Exception creating connection to: <Remote machine IP>; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (No such file or directory)
Failed to configure <Remote machine IP>
Stopping remote engines
Remote engines have been stopped
Error in NonGUIDriver java.lang.RuntimeException: Following remote engines could not be configured:<Remote machine IP>
I have a rmi keystore file created in remote machine.
You need to launch create-rmi-keystore.sh script on all machines and make sure that the configuration is the same, this way communication between JMeter master and slaves will be secure.
More information: Remote Testing: Setting Up SSL
If you don't want the communication between the master and slaves to be secure - you can amend the command line to:
jmeter -Jserver.rmi.ssl.disable=true -n -R <Remote HOst IP> -t file.jmx -l result.jtl -e -o/resultfolder
or add the next line to user.properties file on all hosts to make the change permanent:
server.rmi.ssl.disable=true
JMeter restart will be required to pick the property up. See Configuring JMeter user manual chapter for more information.
Depending on your test nature 1 slave might be not enough to simulate 200k threads so make sure you're following recommendations from the 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article and keeping an eye on JMeter engines health using built-in OS tools or JMeter PerfMon Plugin as if JMeter will not be able to send requests fast enough - you will get lower throughput/higher response times even if your application is not overloaded.

The Node Agent is stopped

I'm trying to start my Node on a command prompt like this:
C:\IBM\WebSphere\AppServer\profiles\AppSrv01\bin>startnode
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: nodeagent
ADMU3200I: Server launched. Waiting for initialization status.
ADMU3011E: Server launched but failed initialization. Server logs, startServer.log, and other log files under C:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\nodeagent should contain failure information
What should I do? I try to search on how to start the node agent but it's all the same and I execute those command but it fall under the same error (noted at the top).
Here are the content of startServer.log
[8/15/13 13:42:21:240 CST] 00000040 NodeSync E ADMS0005E: The system is unable to generate synchronization request: javax.management.JMRuntimeException: ADMN0022E: Access is denied for the getFolderSyncUpdates operation on CellSync MBean because of insufficient or empty credentials.
find your soap.client.props file in your profile
add in your deployment's id / pass
see if that works.
also, try stopping your node, and restarting

Resources