title: JMeter: Distributed (Remote) Testing in Linux Environment
body: <p>I setup a distributed load testing environment using JMeter. I am using <strong>Three Linux Machines</strong> (RedHat)(IPs:<code>xxx.xxx.xxx.121</code>,<code>xxx.xxx.xxx.122</code>,<code>xxx.xxx.xxx.123</code>) using Secured Shell from my Windows 8.1.</p>
  
  <p>I have fulfilled the prerequisite to perform Distributed test:</p>
  
  <ol>
  <li>All machines(Client &amp; Slaves) are in the same subnet.</li>
  <li>Firewall is disabled for all machines.</li>
  <li>JMeter(2.13) and JDk version(1.6.0_25) are same for all.</li>
  </ol>
  
  <p><code>Client(Master) Machine :xxx.xxx.xxx.123
   Server(Slave) Machines: xxx.xxx.xxx.122,xxx.xxx.xxx.121</code></p>
  
  <p>I did the following:</p>
  
  <p><strong>1)</strong> Added the following to client (master) <strong>jmeter.properties</strong> file:</p>
  
  <p><strong><code>remote_hosts= xxx.xxx.xxx.122,xxx.xxx.xxx.121</code></strong></p>
  
  <p><strong>2)</strong> Added the following to servers (in each slave machines) <strong>jmeter-server</strong>:</p>
  
  <p><strong><code>RMI_HOST_DEF=-Djava.rmi.server.hostname=xxx.xxx.xxx.123</code></strong>(Client Machine IP)</p>
  
  <p><strong>3)</strong> Then started <strong>jmeter-server</strong> from those two Slave machines(<strong>xxx.xxx.xxx.122,xxx.xxx.xxx.121</strong>) using this command</p>
  
  <p><code>./jmeter-server</code></p>
  
  <p>and get following <strong>output</strong>.Which means the slave machines are started.</p>
  
  <p><strong>Output of xxx.xxx.xxx.121:</strong></p>
  
  <pre><code>Created remote object: UnicastServerRef [liveRef: [endpoint:[xxx.xxx.xxx.123:41864](local),objID:[1707296d:154c281318b:-7fff, -8101068266055605468]]]
  </code></pre>
  
  <p><strong>Output of xxx.xxx.xxx.122:</strong></p>
  
  <pre><code>Using local port: 4000
  Created remote object: UnicastServerRef [liveRef: [endpoint:[xxx.xxx.xxx.123:4000](local),objID:[-2a2acf13:154c285ffa2:-7fff, 2939294752655639469]]]
  </code></pre>
  
  <p>Now I ran the following command from <strong>client machine</strong>(xxx.xxx.xxx.123) to start <strong>remote tests</strong>.</p>
  
  <p><code>./jmeter -n -t RemoteTest.jmx -r</code> </p>
  
  <p>It provided me with the following output:</p>
  
  <pre><code>Creating summariser &lt;summary&gt;
  Created the tree successfully using RemoteTest.jmx
  Configuring remote engine: xxx.xxx.xxx.121
  Configuring remote engine: xxx.xxx.xxx.122
  Starting remote engines
  Starting the test @ Wed May 18 06:27:52 GMT 2016 (1463552872376)
  Error in rconfigure() method java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.123; nested exception is: 
          java.net.ConnectException: Connection refused
  Error in rconfigure() method java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.123; nested exception is: 
          java.net.ConnectException: Connection refused
  Remote engines have been started
  </code></pre>
  
  <p><strong>Output of jmeter.log file (xxx.xxx.xxx.123)</strong></p>
  
  <pre><code>2016/05/18 06:52:22 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_GB 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: Loading user properties from: /usr/apache-jmeter-2.13/bin/user.properties 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: Loading system properties from: /usr/apache-jmeter-2.13/bin/system.properties 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: Copyright (c) 1998-2015 The Apache Software Foundation 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: Version 2.13 r1665067 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: java.version=1.6.0_25 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: java.vm.name=Java HotSpot(TM) 64-Bit Server VM 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: os.name=Linux 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: os.arch=amd64 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: os.version=2.6.32-358.el6.x86_64 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: file.encoding=UTF-8 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: Default Locale=English (United Kingdom) 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: JMeter  Locale=English (United Kingdom) 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: JMeterHome=/usr/apache-jmeter-2.13 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: user.dir  =/usr/apache-jmeter-2.13/bin 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: PWD       =/usr/apache-jmeter-2.13/bin 
  2016/05/18 06:52:22 INFO  - jmeter.JMeter: IP: 127.0.0.1 Name: Switch018 FullName: localhost.localdomain 
  2016/05/18 06:52:22 INFO  - jmeter.services.FileServer: Default base='/usr/apache-jmeter-2.13/bin' 
  2016/05/18 06:52:22 INFO  - jmeter.services.FileServer: Set new base='/usr/apache-jmeter-2.13/bin' 
  2016/05/18 06:52:22 INFO  - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 
  2016/05/18 06:52:22 INFO  - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8 
  2016/05/18 06:52:22 INFO  - jmeter.save.SaveService: Using SaveService properties file version 1656252 
  2016/05/18 06:52:22 INFO  - jmeter.save.SaveService: Using SaveService properties version 2.8 
  2016/05/18 06:52:22 INFO  - jmeter.save.SaveService: All converter versions present and correct 
  2016/05/18 06:52:22 INFO  - jmeter.save.SaveService: Loading file: RemoteTest.jmx 
  2016/05/18 06:52:22 INFO  - jmeter.protocol.http.control.CookieManager: Settings: Delete null: true Check: true Allow variable: true Save: false Prefix: COOKIE_ 
  2016/05/18 06:52:22 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Cannot find .className property for htmlParser, using default 
  2016/05/18 06:52:22 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is  
  2016/05/18 06:52:22 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is  
  2016/05/18 06:52:22 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is  
  2016/05/18 06:52:22 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is  
  2016/05/18 06:52:22 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser 
  2016/05/18 06:52:23 INFO  - jmeter.JMeter: Creating summariser &lt;summary&gt; 
  2016/05/18 06:52:23 INFO  - jmeter.engine.DistributedRunner: Configuring remote engine: xxx.xxx.xxx.121 
  2016/05/18 06:52:23 INFO  - jmeter.engine.DistributedRunner: Configuring remote engine: xxx.xxx.xxx.122 
  2016/05/18 06:52:23 INFO  - jmeter.engine.DistributedRunner: Starting remote engines 
  2016/05/18 06:52:23 INFO  - jmeter.engine.DistributedRunner: Starting the test @ Wed May 18 06:52:23 GMT 2016 (1463554343104) 
  2016/05/18 06:52:23 INFO  - jmeter.engine.ClientJMeterEngine: running clientengine run method 
  2016/05/18 06:52:23 INFO  - jmeter.engine.util.CompoundVariable: Note: Function class names must contain the string: '.functions.' 
  2016/05/18 06:52:23 INFO  - jmeter.engine.util.CompoundVariable: Note: Function class names must not contain the string: '.gui.' 
  2016/05/18 06:52:23 INFO  - jmeter.samplers.SampleEvent: List of sample_variables: [] 
  2016/05/18 06:52:23 INFO  - jmeter.samplers.BatchSampleSender: Using batching (client settings) for this run. Thresholds: num=100, time=60000 
  2016/05/18 06:52:23 INFO  - jmeter.samplers.DataStrippingSampleSender: Using DataStrippingSampleSender for this run 
  2016/05/18 06:52:23 INFO  - jmeter.samplers.BatchSampleSender: Using batching (client settings) for this run. Thresholds: num=100, time=60000 
  2016/05/18 06:52:23 INFO  - jmeter.samplers.DataStrippingSampleSender: Using DataStrippingSampleSender for this run 
  2016/05/18 06:52:23 ERROR - jmeter.engine.ClientJMeterEngine: Error in rconfigure() method java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.123; nested exception is: 
          java.net.ConnectException: Connection refused 
  2016/05/18 06:52:23 INFO  - jmeter.engine.ClientJMeterEngine: Interrupting RMI Reaper 
  2016/05/18 06:52:23 INFO  - jmeter.engine.ClientJMeterEngine: running clientengine run method 
  2016/05/18 06:52:23 INFO  - jmeter.samplers.BatchSampleSender: Using batching (client settings) for this run. Thresholds: num=100, time=60000 
  2016/05/18 06:52:23 INFO  - jmeter.samplers.DataStrippingSampleSender: Using DataStrippingSampleSender for this run 
  2016/05/18 06:52:23 INFO  - jmeter.samplers.BatchSampleSender: Using batching (client settings) for this run. Thresholds: num=100, time=60000 
  2016/05/18 06:52:23 INFO  - jmeter.samplers.DataStrippingSampleSender: Using DataStrippingSampleSender for this run 
  2016/05/18 06:52:23 ERROR - jmeter.engine.ClientJMeterEngine: Error in rconfigure() method java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.123; nested exception is: 
          java.net.ConnectException: Connection refused 
  2016/05/18 06:52:23 INFO  - jmeter.engine.DistributedRunner: Remote engines have been started
  </code></pre>
  
  <p><strong>So what could be the exact solution to overcome this Exception.</strong>
  I have spent the last two days exploring <strong>StackOverflow</strong> and <strong>Stack Exchange</strong> for similar kind of questions and already tried almost all of the possible solutions but still can't get rid of this exception.Actually, I failed!!!!<strong>So please be specific and detail at your answers.</strong></p>