win*_*nna 12 testing jmeter amazon-ec2
我正在尝试以分布式模式设置JMeter.我有一个运行ec2 intance的服务器,我希望主服务器在我的本地计算机上运行.我不得不跳过一些希望让RMI在服务器上正常工作但是通过将"java.rmi.server.hostname"设置为ec2实例的IP来解决.
下一个(希望是最后一个)问题是服务器与主服务器进行通信.
问题是,因为我是从内部网络执行此操作,所以当它应该发回我的外部连接的IP时,主机正在发送其本地/内部IP地址(192.168.1.XXX)(92.XXX.XXX. XXX).
我可以在jmeter-server.log中看到这个:
错误 - jmeter.samplers.RemoteListenerWrapper:testStarted(host)java.rmi.ConnectException:连接拒绝主机:192.168.1.50; 嵌套异常是:
那个主机IP是错误的.它应该是92.XXX.XXX.XX地址.我假设这是因为在主日志中我看到以下内容:
2012/07/29 20:45:25 INFO - jmeter.JMeter:IP:192.168.1.50名称:XXXXXX.local全名:192.168.1.50
并且在RMI设置期间将此IP发送到服务器.
所以我认为我有两个选择:
但我看不出在哪里设置这些命令.
任何帮助都会有用.
Dav*_*mas 23
为了未来的读者的利益,不要拒绝回答.有可能的!另外,您可以保持防火墙的位置.
在这种情况下,我通过端口4000做了一切.
我按如下方式配置了分布式客户端/服务器JMeter连接:
更新:如果您已经具有SSH连接,则可以使用SSH隧道进行连接,这将避免需要添加防火墙规则.
$ ssh -i ~/.ssh/54-179-XXX-XXX.pem ServerAliveInterval=60 -R 4000:localhost:4000 jmeter@54.179.XXX.XXX
Run Code Online (Sandbox Code Playgroud)
请注意,此处仅包含我更改的非默认值:
#---------------------------------------------------------------------------
# Remote hosts and RMI configuration
#---------------------------------------------------------------------------
# Remote Hosts - comma delimited
# Add EC2 JMeter server public IP address:Port combo
remote_hosts=127.0.0.1,54.179.XXX.XXX:4000
# RMI port to be used by the server (must start rmiregistry with same port)
server_port=4000
# Parameter that controls the RMI port used by the RemoteSampleListenerImpl (The Controler)
# Default value is 0 which means port is randomly assigned
# You may need to open Firewall port on the Controller machine
client.rmi.localport=4000
# To change the default port (1099) used to access the server:
server.rmi.port=4000
# To use a specific port for the JMeter server engine, define
# the following property before starting the server:
server.rmi.localport=4000
Run Code Online (Sandbox Code Playgroud)
#---------------------------------------------------------------------------
# Remote hosts and RMI configuration
#---------------------------------------------------------------------------
# RMI port to be used by the server (must start rmiregistry with same port)
server_port=4000
# Parameter that controls the RMI port used by the RemoteSampleListenerImpl (The Controler)
# Default value is 0 which means port is randomly assigned
# You may need to open Firewall port on the Controller machine
client.rmi.localport=4000
# To use a specific port for the JMeter server engine, define
# the following property before starting the server:
server.rmi.localport=4000
Run Code Online (Sandbox Code Playgroud)
jmeter-server -Djava.rmi.server.hostname=54.179.XXX.XXX
Run Code Online (Sandbox Code Playgroud)
其中54.179.XXX.XXX是EC2服务器的公共IP地址
jmeter -Djava.rmi.server.hostname=121.73.XXX.XXX
Run Code Online (Sandbox Code Playgroud)
其中121.73.XXX.XXX是我的客户端计算机的公共IP地址.
JMeter GUI日志输出
成功!
我遇到了类似的问题:JMeter服务器试图连接到错误的地址以发送测试结果(它试图连接到localhost).
我在启动JMeter主站时通过设置以下参数解决了这个问题:
-Djava.rmi.server.hostname = XX.XX.XX.XX
看起来好像这行不通分布式 JMeter 测试解释了分布式环境中负载测试的要求。我相信,数字 2 和 3 特定于您的用例。
归档时间: |
|
查看次数: |
25229 次 |
最近记录: |