<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Utkarsh Malhotra on Medium]]></title>
        <description><![CDATA[Stories by Utkarsh Malhotra on Medium]]></description>
        <link>https://medium.com/@utkarsh.06raj?source=rss-9fa7c3e79979------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lGNRnavTHArO6GhdB9JHPQ.jpeg</url>
            <title>Stories by Utkarsh Malhotra on Medium</title>
            <link>https://medium.com/@utkarsh.06raj?source=rss-9fa7c3e79979------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 01:09:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@utkarsh.06raj/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Apache JMeter Master-Slave Setup on AWS EC2]]></title>
            <link>https://medium.com/@utkarsh.06raj/apache-jmeter-master-slave-setup-on-aws-ec2-simplified-updated-for-2025-9082470947fc?source=rss-9fa7c3e79979------2</link>
            <guid isPermaLink="false">https://medium.com/p/9082470947fc</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[jmeter]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[load-testing]]></category>
            <dc:creator><![CDATA[Utkarsh Malhotra]]></dc:creator>
            <pubDate>Mon, 28 Jul 2025 11:42:27 GMT</pubDate>
            <atom:updated>2025-07-30T07:03:03.794Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rd6nOzbhaDx2aaFFXnX0-w.png" /></figure><h3><strong>Overview</strong></h3><p>JMeter’s distributed (Master-Slave) mode is ideal when you’re load testing with high concurrency. This setup uses:</p><ul><li>One <strong>Master EC2</strong> instance to control test execution</li><li>One or more <strong>Slave EC2</strong> instances to generate load</li></ul><p>This guide documents all steps taken to successfully run a distributed load test on AWS Amazon EC2 using <strong>Apache JMeter 5.6.3</strong>.</p><h3><strong>Prerequisites</strong></h3><ul><li>EC2 instances (Amazon Linux 2 recommended)</li><li>Java (same version on all nodes) — Java Version 17 or below</li><li>JMeter 5.6.3 installed on all nodes</li><li>Open communication between instances</li><li>SSH access to all servers</li></ul><h3><strong>Step-by-Step Setup</strong></h3><h4><strong>Step 1: Launch EC2 Instances</strong></h4><ul><li>Create <strong>1 Master</strong> and <strong>1 or more Slave EC2</strong> instances in the <strong>same VPC and subnet</strong></li><li>Use Amazon Linux 2 (t2.medium or higher), based on your requirement and load, increase the size.</li><li>Assign <strong>private IPs</strong> manually if needed (for fixed communication)</li></ul><p><strong>Step 2: Install Java &amp; JMeter (on all instances)</strong></p><pre>sudo yum update -y <br>sudo yum install java-1.8.0 -y <br>wget https://downloads.apache.org//jmeter/binaries/apache-jmeter-5.6.3.tgz <br>tar -xvzf apache-jmeter-5.6.3.tgz</pre><p>You Can also do this using this script —</p><pre>#!/bin/bash<br><br>set -e<br><br># Versions<br>JMETER_VERSION=&quot;5.6.3&quot;<br>JMETER_HOME=&quot;/opt/apache-jmeter-$JMETER_VERSION&quot;<br><br># Functions<br>log_success() { echo &quot;✅ $1 installed successfully.&quot;; }<br>log_error() { echo &quot;❌ $1 failed to install.&quot;; }<br>is_installed() { command -v &quot;$1&quot; &gt;/dev/null 2&gt;&amp;1; }<br><br>echo &quot;Updating system...&quot;<br>sudo yum update -y &amp;&amp; echo &quot;OS updated.&quot;<br><br># ---------------------------<br># Install Java<br># ---------------------------<br>echo &quot;Checking Java installation...&quot;<br>if is_installed java; then<br>    echo &quot;Java is already installed. Skipping...&quot;<br>else<br>    echo &quot;Installing Java 11...&quot;<br>    sudo amazon-linux-extras enable java-openjdk11<br>    sudo yum install -y java-11-openjdk java-11-openjdk-devel wget unzip git curl &amp;&amp; log_success &quot;Java&quot; || log_error &quot;Java&quot;<br>fi<br><br># Set JAVA_HOME<br>echo &quot;Setting JAVA_HOME...&quot;<br>echo &quot;export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))&quot; | sudo tee -a /etc/profile<br>echo &quot;export PATH=\$JAVA_HOME/bin:\$PATH&quot; | sudo tee -a /etc/profile<br>source /etc/profile<br><br># ---------------------------<br># Install JMeter<br># ---------------------------<br>if [ -d &quot;$JMETER_HOME&quot; ]; then<br>    echo &quot;JMeter already installed at $JMETER_HOME. Skipping...&quot;<br>else<br>    echo &quot;Installing Apache JMeter $JMETER_VERSION...&quot;<br>    cd /opt<br>    sudo wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-$JMETER_VERSION.tgz || { log_error &quot;JMeter Download&quot;; exit 1; }<br>    sudo tar -xzf apache-jmeter-$JMETER_VERSION.tgz<br>    sudo rm -f apache-jmeter-$JMETER_VERSION.tgz<br>    echo &quot;export JMETER_HOME=$JMETER_HOME&quot; | sudo tee -a /etc/profile<br>    echo &quot;export PATH=\$JMETER_HOME/bin:\$PATH&quot; | sudo tee -a /etc/profile<br>    source /etc/profile<br>    log_success &quot;JMeter&quot;<br>fi<br><br># ---------------------------<br># Install Plugin Manager &amp; CMDRunner<br># ---------------------------<br>echo &quot;Installing JMeter Plugin Manager and CMDRunner...&quot;<br><br>cd &quot;$JMETER_HOME/lib&quot;<br>if [ -f &quot;cmdrunner.jar&quot; ]; then<br>    echo &quot;CMDRunner already exists. Skipping...&quot;<br>else<br>    sudo wget https://repo1.maven.org/maven2/kg/apc/cmdrunner/2.2.1/cmdrunner-2.2.1.jar -O cmdrunner.jar &amp;&amp; log_success &quot;CMDRunner&quot; || log_error &quot;CMDRunner&quot;<br>fi<br><br>cd &quot;$JMETER_HOME/lib/ext&quot;<br>if [ -f &quot;PluginManager.jar&quot; ]; then<br>    echo &quot;Plugin Manager already exists. Skipping...&quot;<br>else<br>    sudo wget https://jmeter-plugins.org/get/ -O PluginManager.jar &amp;&amp; log_success &quot;Plugin Manager&quot; || log_error &quot;Plugin Manager&quot;<br>fi<br><br># Install Plugins<br>echo &quot;Installing JMeter plugins...&quot;<br>cd &quot;$JMETER_HOME/bin&quot;<br>sudo java -cp &quot;$JMETER_HOME/lib/ext/PluginManager.jar:$JMETER_HOME/lib/*&quot; org.jmeterplugins.repository.PluginManagerCMDInstaller || log_error &quot;PluginManagerCMDInstaller&quot;<br>sudo java -cp &quot;$JMETER_HOME/lib/ext/PluginManager.jar:$JMETER_HOME/lib/*&quot; org.jmeterplugins.repository.PluginManagerCMD install jpgc-standard jpgc-graphs-basic jpgc-casutg jpgc-functions jpgc-json jpgc-tst jpgc-dummy || log_error &quot;JMeter Plugin Install&quot;<br><br># Fix permissions<br>sudo chown -R ec2-user:ec2-user &quot;$JMETER_HOME&quot;<br><br>echo &quot;&quot;<br>echo &quot;All available components have been installed or skipped if already present.&quot;<br>echo &quot;JMeter path: $JMETER_HOME&quot;</pre><p><strong>Note:</strong> You can install the required software’s in 1 EC2 and create a AMI from it and then use to it launch new EC2 instances.</p><h4><strong>Step 3: Configure Security Groups</strong></h4><p><strong><em>For Slave EC2:</em></strong></p><ul><li><strong>Inbound Rules</strong></li><li>TCP 1099 from Master Private IP (for RMI)</li><li>TCP 1024–65535 from Master Private IP (for dynamic ports) or AWS VPC CIDR or Anywhere</li><li>Do open ICMP in all the servers</li><li><strong>Outbound Rules</strong></li><li>Allow All Traffic (or restrict to Master private IP)</li></ul><p><strong><em>For Master EC2:</em></strong></p><ul><li><strong>Inbound</strong>:</li><li>Allow SSH from your laptop IP or Anywhere or any trusted IP.</li><li>For traffic received from slave you can open allow ALL traffic from VPC CIDR, as the slave servers are in the VPC itself.</li><li>Do open ICMP here.</li><li><strong>Outbound</strong>: Allow all or at least access to Slave IPs</li></ul><h4><strong>Step 4: Verify Network Connectivity (Ping &amp; Telnet Checks)</strong></h4><p>From <strong>Master to Slave</strong>, verify:</p><p><strong><em>Ping Check:</em></strong></p><pre>ping &lt;slave-private-ip&gt;</pre><p>Expect a successful ICMP response.</p><p><strong><em>Telnet Check for RMI (Port 1099):</em></strong></p><pre>telnet &lt;slave-private-ip&gt; 1099</pre><p>If this returns Connected to, the slave is reachable on the RMI port.</p><p>If you get Connection refused, ensure:</p><ul><li>Slave JMeter is running, if not running — in the “apache-jmeter-directory/bin/” run it using, in Screen Mode —</li></ul><pre>cd apache-jmeter-5.6.3/bin/<br>./jmeter -s -Jserver.rmi.ssl.disable=true -Djava.rmi.server.hostname=&lt;private-ip-of the-server&gt; -Djava.rmi.server.useLocalHostname=false</pre><ul><li>Security group inbound rules are correct</li><li>server_port=1099 is set in slave’s jmeter.properties</li></ul><p>You can also use:</p><pre>nc -zv &lt;slave-private-ip&gt; 1099</pre><p>to verify if the port is open without relying on telnet.</p><h4><strong>Step 5: Update JMeter Config on Both Master &amp; Slave</strong></h4><p><strong><em>Edit jmeter.properties (in $JMETER_HOME/bin/):</em></strong></p><pre>server.rmi.ssl.disable=true <br>server_port=1099 <br>remote_hosts=&lt;slave-private-ip&gt; # Add your Slave(s) private IPs, comma-separated.</pre><p><strong>Note — Do not add any space after comma.</strong></p><h4><strong>Step 6: Start Slave(s)</strong></h4><p>On each Slave EC2 instance:</p><pre>cd apache-jmeter-5.6.3/bin <br>./jmeter -s \ <br> -Jserver.rmi.ssl.disable=true \ <br> -Djava.rmi.server.hostname=&lt;slave-private-ip&gt; \ <br> -Djava.rmi.server.useLocalHostname=false</pre><p><strong>Note: You can create a script for this in the Slave Server and even maybe use a lambda function with SSM agent integrated to run this script from AWS lambda console. Use the below code for the same —</strong></p><pre>import boto3<br>import time<br>from botocore.exceptions import BotoCoreError, ClientError<br><br>def lambda_handler(event, context):<br>    region = &quot;ap-south-1&quot;<br>    ec2 = boto3.client(&quot;ec2&quot;, region_name=region)<br>    ssm = boto3.client(&quot;ssm&quot;, region_name=region)<br><br>    try:<br>        # Step 1: Get EC2s by tag<br>        response = ec2.describe_instances(<br>            Filters=[<br>                {<br>                    &#39;Name&#39;: &#39;tag:Name&#39;,<br>                    &#39;Values&#39;: [&#39;Slave-Load-Test-Server&#39;]<br>                },<br>                {<br>                    &#39;Name&#39;: &#39;instance-state-name&#39;,<br>                    &#39;Values&#39;: [&#39;running&#39;]<br>                }<br>            ]<br>        )<br><br>        instance_ids = []<br>        for reservation in response[&#39;Reservations&#39;]:<br>            for instance in reservation[&#39;Instances&#39;]:<br>                instance_ids.append(instance[&#39;InstanceId&#39;])<br><br>        if not instance_ids:<br>            return {<br>                &#39;statusCode&#39;: 404,<br>                &#39;body&#39;: &#39;No running EC2 instances found with the specified tag.&#39;<br>            }<br><br>        # Step 2: Run script on each EC2 via SSM<br>        command_response = ssm.send_command(<br>            InstanceIds=instance_ids,<br>            DocumentName=&#39;AWS-RunShellScript&#39;,<br>            Parameters={<br>                &#39;commands&#39;: [&#39;bash /root/startslave.sh&#39;]<br>            },<br>            TimeoutSeconds=60,<br>        )<br><br>        command_id = command_response[&#39;Command&#39;][&#39;CommandId&#39;]<br><br>        # Step 3: Wait for all command invocations to complete<br>        time.sleep(2)  # give it a moment to start<br><br>        results = {}<br>        for instance_id in instance_ids:<br>            for _ in range(10):  # check status up to 10 times (approx 30s)<br>                time.sleep(3)<br>                try:<br>                    invocation = ssm.get_command_invocation(<br>                        CommandId=command_id,<br>                        InstanceId=instance_id,<br>                    )<br>                    if invocation[&#39;Status&#39;] in [&#39;Success&#39;, &#39;Failed&#39;, &#39;TimedOut&#39;, &#39;Cancelled&#39;]:<br>                        results[instance_id] = {<br>                            &#39;Status&#39;: invocation[&#39;Status&#39;],<br>                            &#39;Output&#39;: invocation.get(&#39;StandardOutputContent&#39;, &#39;&#39;).strip(),<br>                            &#39;Error&#39;: invocation.get(&#39;StandardErrorContent&#39;, &#39;&#39;).strip()<br>                        }<br>                        break<br>                except ssm.exceptions.InvocationDoesNotExist:<br>                    continue<br>            else:<br>                results[instance_id] = {<br>                    &#39;Status&#39;: &#39;Unknown&#39;,<br>                    &#39;Output&#39;: &#39;&#39;,<br>                    &#39;Error&#39;: &#39;No response after waiting.&#39;<br>                }<br><br>        return {<br>            &#39;statusCode&#39;: 200,<br>            &#39;CommandId&#39;: command_id,<br>            &#39;ExecutionResults&#39;: results<br>        }<br><br>    except (BotoCoreError, ClientError) as e:<br>        return {<br>            &#39;statusCode&#39;: 500,<br>            &#39;body&#39;: f&quot;AWS error occurred: {str(e)}&quot;<br>        }<br>    except Exception as e:<br>        return {<br>            &#39;statusCode&#39;: 500,<br>            &#39;body&#39;: f&quot;Unexpected error: {str(e)}&quot;<br>        }</pre><p><strong>Note: </strong>Make sure you have the following tag in the Slave EC2 instances — <br>‘tag-Name’: ‘Name’,<br>‘Values’: ‘Slave-Load-Test-Server’</p><ul><li>Make sure to give the necessary IAM permissions to the lambda function for interacting to the EC2 server, as well as for generating lambda logs.</li></ul><p>You should see:</p><pre>Created remote object: UnicastServerRef2 […]</pre><h4><strong>Step 7: Run Load Test from Master</strong></h4><p>On the Master EC2:</p><pre>cd apache-jmeter-5.6.3/bin <br>./jmeter -n \ <br> -t /path/to/test.jmx \ <br> -l /path/to/results.csv \ <br> -e -o /path/to/html-report \ <br> -r \ <br> -Djava.rmi.server.hostname=&lt;master-private-ip&gt; \ <br> -Dserver.rmi.ssl.disable=true</pre><p>This will trigger the test on all the slaves listed in remote_hosts.</p><h3><strong>Generating HTML Report</strong></h3><p>Make sure to add the following flags during execution in the above shared load test command:</p><pre>-e -o /path/to/html-report</pre><p>After test completes, open index.html inside the html-report folder, here you will get the report for your load test.</p><h3><strong>Common Issues &amp; Fixes</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*ZwmRkmo59ulZBVUQkLJjIg.png" /></figure><p><strong>Note: If you face any OOM (OutOfMemory) or Heap error in the slave server, then — [The below configuration is for c6a.8xlarge EC2 server]</strong></p><pre>: &quot;${HEAP:=&quot;-Xms4g -Xmx48g -XX:MaxMetaspaceSize=1024m -XX:+UseG1GC&quot;}&quot;</pre><p>Explanation of the HEAP settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nX42U7TjgvtR7mBoUdpcdA.png" /></figure><p>You can adjust it as per your EC2 configuration.</p><p><strong>Note —</strong> Do leave around 25 to 35% of memory for OS and Kernel related processes, else it may end up in silently killing your Java process in the middle of the load test.</p><h3><strong>Ready for Scale</strong></h3><ul><li>Add multiple slaves by listing them in remote_hosts. You can add both private and public IPs here.</li><li>Monitor EC2 CPU and memory during test runs</li><li>You can also dockerize this setup for containerized load testing</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9082470947fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Set Up JMeter Master-Slave Distributed Load Testing on a Single AWS EC2 Instance (With…]]></title>
            <link>https://medium.com/@utkarsh.06raj/how-to-set-up-jmeter-master-slave-distributed-load-testing-on-a-single-aws-ec2-instance-with-b18f74471df6?source=rss-9fa7c3e79979------2</link>
            <guid isPermaLink="false">https://medium.com/p/b18f74471df6</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[jmeter]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[loadtest]]></category>
            <dc:creator><![CDATA[Utkarsh Malhotra]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 10:53:15 GMT</pubDate>
            <atom:updated>2025-07-01T11:07:11.562Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Set Up JMeter Master-Slave Distributed Load Testing on a Single AWS EC2 Instance (With Advanced Multi-Slave Configuration)</h3><h3><strong>Introduction</strong></h3><p>Performance testing is a crucial part of validating the scalability and stability of any backend infrastructure. Apache JMeter is a widely used open-source tool for load and performance testing. One of its powerful features is support for distributed load testing using a master-slave architecture.</p><p>This guide shows you how to configure multiple JMeter slave servers on a single AWS EC2 instance, enabling you to simulate concurrent users in parallel, without needing multiple machines.</p><h3><strong>Why Run Multiple Slaves on One Machine?</strong></h3><p>Although JMeter’s distributed mode is traditionally used with multiple servers (one master, multiple slaves), it is perfectly valid to simulate multiple slave nodes on the same machine. This has several benefits:</p><ul><li><strong>Parallel Execution</strong>: Each slave runs the full test plan independently, generating concurrent load.</li><li><strong>Thread Isolation</strong>: You can better simulate separate users with clean JVM contexts.</li><li><strong>Cost Efficiency</strong>: Useful when you’re limited to one EC2 instance or running on a budget.</li><li><strong>Debugging Ease</strong>: All logs and processes are centralized, simplifying troubleshooting.</li></ul><h3>System Requirement</h3><ul><li><strong>OS:</strong> Amazon Linux 2 (or any CentOS/RHEL-like system)</li><li><strong>JMeter Version:</strong> 5.6.3</li><li><strong>Java Version:</strong> 11+</li></ul><p>Make sure Java is installed and available in your $PATH.</p><h3><strong>Steps for Master-Slave Setup</strong></h3><h4><strong>Step1: Install Apache JMeter</strong></h4><p>=&gt; Download and extract JMeter:</p><pre>cd /Path-to-your-location-where-you-want-JMeter-to-be-Installed-and-Runned-From<br>wget https://downloads.apache.org//jmeter/binaries/apache-jmeter-5.6.3.tgz<br>tar -xvzf apache-jmeter-5.6.3.tgz</pre><h4>Step 2: Prepare Your Test Plan</h4><p>=&gt; Your JMeter .jmx test plan should be placed in a known directory for execution.</p><pre>mkdir -p /Path-to-your-load-test-folder<br>mv your-plan.jmx /Path-to-your-load-test-folder/</pre><p>Ensure your test plan is designed to be thread-parameterized if you’re planning on scaling the load across slaves.</p><h4>Step 3: Create the Load Test Script</h4><p>=&gt; This script will automate:</p><ul><li>Cleanup of old results</li><li>Executing the JMeter test in non-GUI mode</li><li>Generating the HTML report</li></ul><pre>#!/bin/bash<br>JMETER_HOME=&quot;/Path-to-your-location-where-you-want-JMeter-to-be-Installed-and-Runned-From/apache-jmeter-5.6.3&quot;<br>TEST_PLAN=&quot;/Path-to-your-load-test-folder/your-plan.jmx&quot;<br>RESULT_FILE=&quot;/Path-to-your-load-test-folder/Path-to-your-results-load-test-folder/results.jtl&quot;<br>REPORT_DIR=&quot;/Path-to-your-load-test-folder/Path-to-your-results-load-test-folder/Path-to-your-html-report&quot;<br># Step 1: Clean up previous results<br>rm -rf &quot;$REPORT_DIR&quot; &quot;$RESULT_FILE&quot;<br>echo &quot;Step 1: Cleaning up previous test artifacts…&quot;<br># Step 2: Run JMeter in non-GUI mode using remote slaves<br>echo &quot;Step 2: Running the JMeter load test…&quot;<br>#Add more slaves using localhost and Port Number - (127.0.0.1:1103,127.0.0.1:1104,…….)<br>&quot;$JMETER_HOME/bin/jmeter&quot; -n -t &quot;$TEST_PLAN&quot; -R127.0.0.1:1100,127.0.0.1:1101,127.0.0.1:1102 -l &quot;$RESULT_FILE&quot;<br>echo &quot;Load test execution completed.&quot;<br># Step 3: Generate HTML Report<br>echo &quot;Step 3: Generating detailed HTML report…&quot;<br>&quot;$JMETER_HOME/bin/jmeter&quot; -g &quot;$RESULT_FILE&quot; -o &quot;$REPORT_DIR&quot;<br>echo &quot;Report generation completed.&quot;</pre><p>Make the script executable:</p><pre>chmod +x new-example-load-test-script.sh</pre><h4><strong>Step 4: Start Multiple JMeter Slave Servers</strong></h4><p>Each JMeter slave listens on a set of three unique ports to allow remote control by the master process:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZkENTAtM96UyND4FZBEAAA.png" /></figure><p>Each slave must have its own non-overlapping set of these ports to avoid conflicts.</p><p>Configuration Example for 3 Slaves:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*cvWg12akK3Npvh8eodcYIQ.png" /></figure><p><strong>=&gt; Start Slave 1:</strong></p><pre>SERVER_PORT=1100 JVM_ARGS=&quot;-Dserver.rmi.localport=4000 -Dserver.rmi.registry.port=5000 -Djava.rmi.server.hostname=127.0.0.1&quot; ./apache-jmeter-5.6.3/bin/jmeter-server</pre><p><strong>=&gt; Start Slave 2:</strong></p><pre>SERVER_PORT=1101 JVM_ARGS=&quot;-Dserver.rmi.localport=4001 -Dserver.rmi.registry.port=5001 -Djava.rmi.server.hostname=127.0.0.1&quot; ./apache-jmeter-5.6.3/bin/jmeter-server</pre><p><strong>=&gt; Start Slave 3:</strong></p><pre>SERVER_PORT=1102 JVM_ARGS=&quot;-Dserver.rmi.localport=4002 -Dserver.rmi.registry.port=5002 -Djava.rmi.server.hostname=127.0.0.1&quot; ./apache-jmeter-5.6.3/bin/jmeter-server</pre><p>When successful, each terminal will show:</p><pre>Using local port: 400X<br>Created remote object...</pre><p><strong>Bonus: Bash Script for running Slaves (All Slave Servers at once)</strong></p><p>=&gt; Use “Screen” command for running this bash script.</p><pre>cd /Path-to-your-location-where-you-want-JMeter-to-be-Installed-and-Runned-From/apache-jmeter-5.6.3/bin<br>screen -S slave<br>vim start-slave.sh</pre><p>=&gt; Run this bash script:</p><pre>#!/bin/bash<br><br>JMETER_HOME=&quot;/Path-to-your-location-where-you-want-JMeter-to-be-Installed-and-Runned-From/apache-jmeter-5.6.3&quot;<br>COUNT=&quot;${1:-3}&quot;<br>LOG_DIR=&quot;./logs&quot;<br>mkdir -p &quot;$LOG_DIR&quot;<br><br>for ((i=0; i&lt;COUNT; i++)); do<br>  SP=$((1100 + i))<br>  RMI_L=$((4000 + i))<br>  RMI_R=$((5000 + i))<br>  LOG=&quot;$LOG_DIR/slave_$i.log&quot;<br><br>  echo &quot;Starting slave #$i on port $SP&quot;<br>  SERVER_PORT=$SP \<br>  JVM_ARGS=&quot;-Dserver.rmi.localport=$RMI_L -Dserver.rmi.registry.port=$RMI_R -Djava.rmi.server.hostname=127.0.0.1&quot; \<br>  &quot;$JMETER_HOME/bin/jmeter-server&quot; &gt; &quot;$LOG&quot; 2&gt;&amp;1 &amp;<br><br>  echo &quot;  -&gt; PID $!, log: $LOG&quot;<br>done</pre><h4><strong>Step 5: Run the Load Test from Master</strong></h4><p>After the slaves are up and running, proceed to execute the master script (refer to Step 3 for details and code).</p><p>=&gt; Adding the step 3 code here for ease:</p><pre>#!/bin/bash<br>JMETER_HOME=&quot;/Path-to-your-location-where-you-want-JMeter-to-be-Installed-and-Runned-From/apache-jmeter-5.6.3&quot;<br>TEST_PLAN=&quot;/Path-to-your-load-test-folder/your-plan.jmx&quot;<br>RESULT_FILE=&quot;/Path-to-your-load-test-folder/Path-to-your-results-load-test-folder/results.jtl&quot;<br>REPORT_DIR=&quot;/Path-to-your-load-test-folder/Path-to-your-results-load-test-folder/Path-to-your-html-report&quot;<br><br># Step 1: Clean up previous results<br>rm -rf &quot;$REPORT_DIR&quot; &quot;$RESULT_FILE&quot;<br>echo &quot;Step 1: Cleaning up previous test artifacts…&quot;<br># Step 2: Run JMeter in non-GUI mode using remote slaves<br>echo &quot;Step 2: Running the JMeter load test…&quot;<br>#Add more slaves using localhost and Port Number - (127.0.0.1:1103,127.0.0.1:1104,…….)<br>&quot;$JMETER_HOME/bin/jmeter&quot; -n -t &quot;$TEST_PLAN&quot; -R127.0.0.1:1100,127.0.0.1:1101,127.0.0.1:1102 -l &quot;$RESULT_FILE&quot;<br>echo &quot;Load test execution completed.&quot;<br># Step 3: Generate HTML Report<br>echo &quot;Step 3: Generating detailed HTML report…&quot;<br>&quot;$JMETER_HOME/bin/jmeter&quot; -g &quot;$RESULT_FILE&quot; -o &quot;$REPORT_DIR&quot;<br>echo &quot;Report generation completed.&quot;</pre><p>You’ll see:</p><pre>Configuring remote engine: 127.0.0.1:1100<br>Configuring remote engine: 127.0.0.1:1101<br>Configuring remote engine: 127.0.0.1:1102<br>Starting test on remote engines...</pre><p>This confirms that the master is dispatching the load to all three slaves.</p><h3><strong>Confirm Everything Is Running</strong></h3><p>You can verify all ports are actively being used with:</p><pre>netstat -tunlp | grep java</pre><p>You should see entries like:</p><pre>:::1100  :::1101  :::1102  (server ports)<br>:::4000  :::4001  :::4002  (RMI local ports)<br>:::5000  :::5001  :::5002  (RMI registry ports)</pre><p>If any of these are missing, that specific slave isn’t running correctly.</p><h3>Tip: Understanding Thread Distribution</h3><p><strong>Important:</strong> In JMeter’s distributed mode, each slave runs the entire test plan independently.</p><h4>Example:</h4><p>If your .jmx defines 1000 threads:</p><ul><li>With 3 slaves, total = 3000 threads (1000 each)</li></ul><h4>To control total load:</h4><ul><li>Parameterize thread count in your plan: ${__P(threads)}</li><li>Pass runtime property: -Jthreads=333</li><li>Update script like:</li></ul><pre>&quot;$JMETER_HOME/bin/jmeter&quot; -n -t &quot;$TEST_PLAN&quot; -Jthreads=333 ...</pre><p>Or split the test plan manually among different .jmx files.</p><h3>Troubleshooting Guide</h3><h4>Error: Connection refused</h4><p><strong>Cause:</strong> Slave server not started or port misconfigured<br> <strong>Fix:</strong> Verify that the SERVER_PORT is correct and not blocked by firewall or another service.</p><h4>Error: Port 1099 already in use</h4><p><strong>Cause:</strong> Default JMeter RMI port conflict<br> <strong>Fix:</strong> Always specify a custom server.rmi.registry.port to avoid collisions.</p><h4>Error: results.jtl not found or HTML report is empty</h4><p><strong>Cause:</strong> The test did not execute successfully<br> <strong>Fix:</strong> Check terminal logs. One or more slaves may not be connected or failed during execution.</p><h4>Error: JMeter command not found</h4><p><strong>Cause:</strong> $JMETER_HOME incorrect or binary missing permissions<br> <strong>Fix:</strong> Confirm the path and run chmod +x on your script and JMeter binaries if needed.</p><h3>Conclusion</h3><p>You now have a full JMeter master-slave setup running multiple remote engines on a single EC2 instance. This configuration is ideal for cost-effective testing, sandbox load simulations, and prototyping distributed tests.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b18f74471df6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing ‘Logon Failure: The User Has Not Been Granted the Requested Logon Type’ Error on Windows…]]></title>
            <link>https://medium.com/@utkarsh.06raj/fixing-logon-failure-the-user-has-not-been-granted-the-requested-logon-type-error-on-windows-08f9b1f0076e?source=rss-9fa7c3e79979------2</link>
            <guid isPermaLink="false">https://medium.com/p/08f9b1f0076e</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[os-hardening]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[Utkarsh Malhotra]]></dc:creator>
            <pubDate>Tue, 03 Jun 2025 11:16:40 GMT</pubDate>
            <atom:updated>2025-06-03T11:17:09.194Z</atom:updated>
            <content:encoded><![CDATA[<h3>Fixing ‘Logon Failure: The User Has Not Been Granted the Requested Logon Type’ Error on Windows Server</h3><p>While performing OS hardening on a Windows Server for a specific user account, you might encounter the following error when attempting to connect via Remote Desktop Protocol (RDP):</p><blockquote><strong><em>Logon failure: the user has not been granted the requested logon type at this computer.</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZMqG_fSzjnB3WhQoZsFBFQ.png" /></figure><p>This guide walks you through a systematic resolution of the issue without compromising on server security.</p><h3>Understanding the Error</h3><p>This RDP login error generally occurs when:</p><ul><li>The user is <strong>not part of the Remote Desktop Users</strong> group</li><li>The user <strong>lacks “Allow log on through Remote Desktop Services”</strong> privilege</li><li><strong>Group Policy or local security policy</strong> denies login</li><li>The user account is <strong>disabled or locked</strong></li></ul><h3>Step-by-Step Solution</h3><p>Use an administrative account to perform these steps.</p><h4>Step 1: Add User to Remote Desktop Users Group</h4><ol><li>Right-click on <strong>This PC &gt; Manage</strong></li><li>Navigate to: Local Users and Groups &gt; Groups</li><li>Double-click on <strong>Remote Desktop Users</strong></li><li>Click <strong>Add</strong>, enter the target username, and click <strong>OK</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D52T1vDm4772nDRhvPHQew.png" /></figure><h4>Step 2: Assign RDP Login Rights</h4><ol><li>Open secpol.msc</li><li>Go to: Local Policies &gt; User Rights Assignment</li><li>Open <strong>Allow log on through Remote Desktop Services</strong></li><li>Add the target username if it’s missing</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mGbrNpYQcscEXl43Lm171A.png" /></figure><h4>Step 3: Review Group Policy (If Domain-Joined)</h4><ol><li>Open <strong>Group Policy Management</strong> on a domain controller</li><li>Navigate to the server’s <strong>OU &gt; User Rights Assignment</strong></li><li>Ensure the username is <strong>not present</strong> in <strong>Deny log on through Remote Desktop Services</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*buee5cH04-TPhVS3JxkirA.png" /></figure><h4>Step 4: Ensure Account Is Active</h4><ol><li>Go to Computer Management &gt; Users</li><li>Verify the account has no <strong>red X icon</strong> (i.e., not disabled)</li><li>Reset password if necessary</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nVEXhx6zVLquUVpXAo7Ruw.png" /></figure><h4>Step 5: Remove Deny Policies (If Present)</h4><ol><li>Again in secpol.msc</li><li>Check <strong>Deny log on through Remote Desktop Services</strong></li><li>Ensure the username is <strong>not listed</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n1ZjEKfPaG3ICIDNtSkhQQ.png" /></figure><h4>Step 6: Enable RDP and Grant Access</h4><ol><li>Go to: System Properties &gt; Remote</li><li>Select <strong>Allow remote connections to this computer</strong></li><li>Click <strong>Select Users…</strong> and add the username</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aa26UPKRcYqVmE98Zrmo5w.png" /></figure><h4>Step 7: Restart RDP Services</h4><ol><li>Open services.msc</li><li>Restart <strong>Remote Desktop Services</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2wA1F3TcpDGnNpsF97nthw.png" /></figure><h3>Conclusion</h3><p>Following these steps will restore RDP access for the specified account. If issues persist, further troubleshooting may include:</p><ul><li>Firewall rules</li><li>Network Level Authentication (NLA)</li><li>Windows Event Logs</li></ul><p>Always verify security policies are balanced with operational access needs after OS hardening.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08f9b1f0076e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>