jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Rancati <ivan.ranc...@gmail.com>
Subject autostarting jmeter-server with systemd
Date Fri, 31 May 2019 10:20:54 GMT
Hello,

Yesterday I installed from scratch jmeter on some virtual machines in a
cloud environment, and had an odd problem with starting jmeter-server.
As this might happen to other testers, I'm sharing the workaround that I
found


My environment
I have 10 JMeter remotes, they are virtual machines (CentOS) that are
switched off when no performance test is running,, and can be started with
OpenStack.

My problem
I wanted jmeter-server to start automatically, so I created a .service file
for bin/jmeter-service
I noticed that the Java process would start on 6 or 7 vm, not on the
remaining 3 or 4
It turns out that, with systemd, unless a dependency is explicitly given,
the order of startup is not guaranteed.
So sometimes, jmeter-server started before the network initialization was
finished, and rmi could not bind to any ip address

The workaround
Simply adding an "After" statement to the .service file (see below), to
make sure the network is fully initialized. Important in cloud
environments, where the ip address is assigned by a dhcp server.

The two other relevant settings in the file are "ExecStart" (the full path
to jmeter-server) and "WorkingDirectory" (basically, where
jmeter-server.log will be saved)

[Unit]
Description=Start Jmeter-service
After=network-online.target

[Service]
Type=simple
WorkingDirectory=/root/lasttest
ExecStart="/opt/lasttest/jmeter/bin/jmeter-server"

[Install]
WantedBy=multi-user.target


----------------

Your mileage may vary. There might be better/cleaner workarounds then mine

Thanks to the JMeter for Jmeter and happy testing,
Ivan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message