JMeter 4.0:启动远程服务器时出错

时间:2018-05-01 07:50:14

标签: jmeter

我正在尝试从Windows主服务器上启动Linux从服务器测试,并获取rmi_keystore.jks文件的FileNotFoundException。

Windows主日志文件:

2018-05-01 09:13:56,336 INFO o.a.j.e.DistributedRunner: Configuring remote engine: XXX.XXX.XXX.37
2018-05-01 09:13:57,487 INFO o.a.j.e.DistributedRunner: Starting remote engines
2018-05-01 09:13:57,492 INFO o.a.j.e.DistributedRunner: Starting the test @ Tue May 01 09:13:57 CEST 2018 (1525158837487)
2018-05-01 09:13:57,492 INFO o.a.j.e.ClientJMeterEngine: running clientengine run method
2018-05-01 09:13:57,495 INFO o.a.j.r.RmiUtils: System property 'java.rmi.server.hostname' is not defined, using localHost address
2018-05-01 09:13:57,495 INFO o.a.j.r.RmiUtils: Local IP address=XXX.XXX.XXX.38
2018-05-01 09:13:57,498 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2018-05-01 09:13:57,505 INFO o.a.j.r.SSLRMIServerSocketFactory: Created SSLSocket: [SSL: ServerSocket[addr=masterhostname/XXX.XXX.XXX.38,localport=49957]]
2018-05-01 09:13:57,508 INFO o.a.j.r.RmiUtils: System property 'java.rmi.server.hostname' is not defined, using localHost address
2018-05-01 09:13:57,508 INFO o.a.j.r.RmiUtils: Local IP address=XXX.XXX.XXX.38
2018-05-01 09:13:57,511 INFO o.a.j.r.SSLRMIServerSocketFactory: Created SSLSocket: [SSL: ServerSocket[addr=masterhostname/XXX.XXX.XXX.38,localport=49958]]
2018-05-01 09:13:57,542 ERROR o.a.j.e.ClientJMeterEngine: Error in rconfigure() method java.rmi.ConnectIOException: Exception creating connection to: XXX.XXX.XXX.37; nested exception is: 
    java.io.FileNotFoundException: \home\myuser\apache-jmeter-4.0\bin\rmi_keystore.jks (The system cannot find the path specified)
2018-05-01 09:13:57,544 INFO o.a.j.e.ClientJMeterEngine: Interrupting RMI Reaper
2018-05-01 09:14:20,343 INFO o.a.j.e.DistributedRunner: Remote engines have been started

我使用create-rmi-keystore.bat脚本在master上创建了rmi_keystore.jks文件,并将其复制到slave上的apache-jmeter-4.0 / bin。

完成此操作后,当尝试在从属服务器上启动jmeter-server时,我也会在此处获得FileNotFoundException(请参阅下面的" Linux slave jmeter-server.log 1"中的log和stacktrace)。

设置属性" server.rmi.ssl.keystore.file" to" /home/myuser/apache-jmeter-4.0/bin/rmi_keystore.jks"但是修复了这个问题,以便奴隶现在启动以下提示输出:

[myuser@slave1 ~]$ apache-jmeter-4.0/bin/jmeter-server
Created remote object: UnicastServerRef2 [liveRef: [endpoint:[XXX.XXX.XXX.37:48508,SSLRMIServerSocketFactory(host=slave1.mycompany.corp/XXX.XXX.XXX.37, keyStoreLocation=/home/myuser/apache-jmeter-4.0/bin/rmi_keystore.jks, type=JKS, trustStoreLocation=/home/myuser/apache-jmeter-4.0/bin/rmi_keystore.jks, type=JKS, alias=rmi),SSLRMIClientSocketFactory(keyStoreLocation=/home/myuser/apache-jmeter-4.0/bin/rmi_keystore.jks, type=JKS, trustStoreLocation=/home/myuser/apache-jmeter-4.0/bin/rmi_keystore.jks, type=JKS, alias=rmi)](local),objID:[-5f3a9dbc:1631a887fa1:-7fff, 3570375527221520605]]]

...并记录信息:

2018-05-01 09:30:50,609 INFO o.a.j.u.JMeterUtils: Setting Locale to en_EN
2018-05-01 09:30:50,639 INFO o.a.j.JMeter: Loading user properties from: /home/myuser/apache-jmeter-4.0/bin/user.properties
2018-05-01 09:30:50,639 INFO o.a.j.JMeter: Loading system properties from: /home/myuser/apache-jmeter-4.0/bin/system.properties
2018-05-01 09:30:50,640 INFO o.a.j.JMeter: Setting System property: server_port=1099
2018-05-01 09:30:50,645 INFO o.a.j.JMeter: Copyright (c) 1998-2018 The Apache Software Foundation
2018-05-01 09:30:50,645 INFO o.a.j.JMeter: Version 4.0 r1823414
2018-05-01 09:30:50,645 INFO o.a.j.JMeter: java.version=1.8.0_172
2018-05-01 09:30:50,646 INFO o.a.j.JMeter: java.vm.name=Java HotSpot(TM) 64-Bit Server VM
2018-05-01 09:30:50,646 INFO o.a.j.JMeter: os.name=Linux
2018-05-01 09:30:50,646 INFO o.a.j.JMeter: os.arch=amd64
2018-05-01 09:30:50,646 INFO o.a.j.JMeter: os.version=2.6.32-573.12.1.el6.x86_64
2018-05-01 09:30:50,646 INFO o.a.j.JMeter: file.encoding=UTF-8
2018-05-01 09:30:50,646 INFO o.a.j.JMeter: Max memory     =1073741824
2018-05-01 09:30:50,646 INFO o.a.j.JMeter: Available Processors =8
2018-05-01 09:30:50,651 INFO o.a.j.JMeter: Default Locale=English (EN)
2018-05-01 09:30:50,651 INFO o.a.j.JMeter: JMeter  Locale=English (EN)
2018-05-01 09:30:50,651 INFO o.a.j.JMeter: JMeterHome=/home/myuser/apache-jmeter-4.0
2018-05-01 09:30:50,652 INFO o.a.j.JMeter: user.dir  =/home/myuser
2018-05-01 09:30:50,652 INFO o.a.j.JMeter: PWD       =/home/myuser
2018-05-01 09:30:50,653 INFO o.a.j.JMeter: IP: XXX.XXX.XXX.37 Name: slave1.mycompany.corp FullName: XXX.XXX.XXX.37
2018-05-01 09:30:50,667 INFO o.a.j.r.RmiUtils: System property 'java.rmi.server.hostname' is not defined, using localHost address
2018-05-01 09:30:50,667 INFO o.a.j.r.RmiUtils: Local IP address=XXX.XXX.XXX.37
2018-05-01 09:30:50,878 INFO o.a.j.r.SSLRMIServerSocketFactory: Created SSLSocket: [SSL: ServerSocket[addr=slave1.mycompany.corp/XXX.XXX.XXX.37,localport=52906]]
2018-05-01 09:30:50,885 INFO o.a.j.e.RemoteJMeterEngineImpl: Starting backing engine on 1099
2018-05-01 09:30:50,885 INFO o.a.j.r.RmiUtils: System property 'java.rmi.server.hostname' is not defined, using localHost address
2018-05-01 09:30:50,886 INFO o.a.j.r.RmiUtils: Local IP address=XXX.XXX.XXX.37
2018-05-01 09:30:50,886 INFO o.a.j.e.RemoteJMeterEngineImpl: IP address is a site-local address; this may cause problems with remote access.
        Can be overridden by defining the system property 'java.rmi.server.hostname' - see jmeter-server script file
2018-05-01 09:30:50,886 INFO o.a.j.e.RemoteJMeterEngineImpl: Creating RMI registry (server.rmi.create=true)
2018-05-01 09:30:50,886 INFO o.a.j.r.RmiUtils: System property 'java.rmi.server.hostname' is not defined, using localHost address
2018-05-01 09:30:50,886 INFO o.a.j.r.RmiUtils: Local IP address=XXX.XXX.XXX.37
2018-05-01 09:30:50,889 INFO o.a.j.r.SSLRMIServerSocketFactory: Created SSLSocket: [SSL: ServerSocket[addr=slave1.mycompany.corp/XXX.XXX.XXX.37,localport=1099]]
2018-05-01 09:30:50,890 INFO o.a.j.e.RemoteJMeterEngineImpl: Bound to RMI registry on port 1099

有人能说出设置有什么问题吗?从Windows主服务器控制Linux从服务器是否有问题(注意主日志中FileNotFoundException中的反斜杠)?

我或许应该提一下,我在master jmeter.properties文件中设置了remote_hosts = XXX.XXX.XXX.36,XXX.XXX.XXX.37并且成功尝试创建从主服务器到主服务器的telnet连接1099港口的奴隶。

Linux slave jmeter-server.log 1:

2018-05-01 09:24:14,970 INFO o.a.j.u.JMeterUtils: Setting Locale to en_EN
2018-05-01 09:24:15,000 INFO o.a.j.JMeter: Loading user properties from: /home/myuser/apache-jmeter-4.0/bin/user.properties
2018-05-01 09:24:15,000 INFO o.a.j.JMeter: Loading system properties from: /home/myuser/apache-jmeter-4.0/bin/system.properties
2018-05-01 09:24:15,001 INFO o.a.j.JMeter: Setting System property: server_port=1099
2018-05-01 09:24:15,006 INFO o.a.j.JMeter: Copyright (c) 1998-2018 The Apache Software Foundation
2018-05-01 09:24:15,006 INFO o.a.j.JMeter: Version 4.0 r1823414
2018-05-01 09:24:15,006 INFO o.a.j.JMeter: java.version=1.8.0_172
2018-05-01 09:24:15,006 INFO o.a.j.JMeter: java.vm.name=Java HotSpot(TM) 64-Bit Server VM
2018-05-01 09:24:15,007 INFO o.a.j.JMeter: os.name=Linux
2018-05-01 09:24:15,007 INFO o.a.j.JMeter: os.arch=amd64
2018-05-01 09:24:15,007 INFO o.a.j.JMeter: os.version=2.6.32-573.12.1.el6.x86_64
2018-05-01 09:24:15,007 INFO o.a.j.JMeter: file.encoding=UTF-8
2018-05-01 09:24:15,007 INFO o.a.j.JMeter: Max memory     =1073741824
2018-05-01 09:24:15,007 INFO o.a.j.JMeter: Available Processors =8
2018-05-01 09:24:15,012 INFO o.a.j.JMeter: Default Locale=English (EN)
2018-05-01 09:24:15,012 INFO o.a.j.JMeter: JMeter  Locale=English (EN)
2018-05-01 09:24:15,012 INFO o.a.j.JMeter: JMeterHome=/home/myuser/apache-jmeter-4.0
2018-05-01 09:24:15,012 INFO o.a.j.JMeter: user.dir  =/home/myuser
2018-05-01 09:24:15,013 INFO o.a.j.JMeter: PWD       =/home/myuser
2018-05-01 09:24:15,014 INFO o.a.j.JMeter: IP: XXX.XXX.XXX.37 Name: slave1.mycompany.corp FullName: XXX.XXX.XXX.37
2018-05-01 09:24:15,027 INFO o.a.j.r.RmiUtils: System property 'java.rmi.server.hostname' is not defined, using localHost address
2018-05-01 09:24:15,027 INFO o.a.j.r.RmiUtils: Local IP address=XXX.XXX.XXX.37
2018-05-01 09:24:15,041 ERROR o.a.j.JMeter: Giving up, as server failed with:
java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:
        java.io.FileNotFoundException: rmi_keystore.jks (No such file or directory)
        at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:348) ~[?:1.8.0_172]
        at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:254) ~[?:1.8.0_172]
        at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411) ~[?:1.8.0_172]
        at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147) ~[?:1.8.0_172]
        at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:236) ~[?:1.8.0_172]
        at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:383) ~[?:1.8.0_172]
        at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:346) ~[?:1.8.0_172]
        at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:225) ~[?:1.8.0_172]
        at org.apache.jmeter.engine.RemoteJMeterEngineImpl.<init>(RemoteJMeterEngineImpl.java:65) ~[ApacheJMeter_core.jar:4.0 r1823414]
        at org.apache.jmeter.engine.RemoteJMeterEngineImpl.startServer(RemoteJMeterEngineImpl.java:71) ~[ApacheJMeter_core.jar:4.0 r1823414]
        at org.apache.jmeter.JMeter.start(JMeter.java:501) [ApacheJMeter_core.jar:4.0 r1823414]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_172]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_172]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_172]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_172]
        at org.apache.jmeter.NewDriver.main(NewDriver.java:245) [ApacheJMeter.jar:4.0 r1823414]
Caused by: java.io.FileNotFoundException: rmi_keystore.jks (No such file or directory)
        at java.io.FileInputStream.open0(Native Method) ~[?:1.8.0_172]
        at java.io.FileInputStream.open(FileInputStream.java:195) ~[?:1.8.0_172]
        at java.io.FileInputStream.<init>(FileInputStream.java:138) ~[?:1.8.0_172]
        at java.io.FileInputStream.<init>(FileInputStream.java:93) ~[?:1.8.0_172]
        at org.apache.jmeter.rmi.SSLRMIServerSocketFactory.loadStore(SSLRMIServerSocketFactory.java:148) ~[ApacheJMeter_core.jar:4.0 r1823414]
        at org.apache.jmeter.rmi.SSLRMIServerSocketFactory.createServerSocket(SSLRMIServerSocketFactory.java:100) ~[ApacheJMeter_core.jar:4.0 r1823414]
        at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:666) ~[?:1.8.0_172]
        at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:335) ~[?:1.8.0_172]
        ... 15 more
2018-05-01 09:24:15,046 ERROR o.a.j.JMeter: An error occurred:
java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:
        java.io.FileNotFoundException: rmi_keystore.jks (No such file or directory)
        at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:348) ~[?:1.8.0_172]
        at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:254) ~[?:1.8.0_172]
        at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411) ~[?:1.8.0_172]
        at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147) ~[?:1.8.0_172]
        at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:236) ~[?:1.8.0_172]
        at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:383) ~[?:1.8.0_172]
        at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:346) ~[?:1.8.0_172]
        at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:225) ~[?:1.8.0_172]
        at org.apache.jmeter.engine.RemoteJMeterEngineImpl.<init>(RemoteJMeterEngineImpl.java:65) ~[ApacheJMeter_core.jar:4.0 r1823414]
        at org.apache.jmeter.engine.RemoteJMeterEngineImpl.startServer(RemoteJMeterEngineImpl.java:71) ~[ApacheJMeter_core.jar:4.0 r1823414]
        at org.apache.jmeter.JMeter.start(JMeter.java:501) [ApacheJMeter_core.jar:4.0 r1823414]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_172]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_172]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_172]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_172]
        at org.apache.jmeter.NewDriver.main(NewDriver.java:245) [ApacheJMeter.jar:4.0 r1823414]
Caused by: java.io.FileNotFoundException: rmi_keystore.jks (No such file or directory)
        at java.io.FileInputStream.open0(Native Method) ~[?:1.8.0_172]
        at java.io.FileInputStream.open(FileInputStream.java:195) ~[?:1.8.0_172]
        at java.io.FileInputStream.<init>(FileInputStream.java:138) ~[?:1.8.0_172]
        at java.io.FileInputStream.<init>(FileInputStream.java:93) ~[?:1.8.0_172]
        at org.apache.jmeter.rmi.SSLRMIServerSocketFactory.loadStore(SSLRMIServerSocketFactory.java:148) ~[ApacheJMeter_core.jar:4.0 r1823414]
        at org.apache.jmeter.rmi.SSLRMIServerSocketFactory.createServerSocket(SSLRMIServerSocketFactory.java:100) ~[ApacheJMeter_core.jar:4.0 r1823414]
        at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:666) ~[?:1.8.0_172]
        at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:335) ~[?:1.8.0_172]
        ... 15 more

2 个答案:

答案 0 :(得分:5)

您需要在使用create-rmi-keystore.sh脚本启动JMeter从属服务器之前创建密钥库,该脚本位于&#34; bin&#34; JMeter安装的文件夹。有关详细信息,请参阅Setting up SSLJMeter User Manual on Distributed Testing章节。

如果你想将JMeter恢复到以前的行为(因为它曾经在JMeter 4.0之前),你可以启动JMeter master和slave,如:

jmeter -Jserver.rmi.ssl.disable=true

要使更改永久化,请将下一行添加到 user.properties 文件中:

server.rmi.ssl.disable=true

并重新启动JMeter以选择更改。有关使用各种属性调整JMeter的更多信息,请参阅Configuring JMeter用户手册章节。

答案 1 :(得分:0)

如果您要通过性能插件来改变詹金斯的身材,则必须更改

/opt/jenkins/.bzt/jmeter-taurus/5.1.1/bin/user.properties