You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ivan Rancati <iv...@gmail.com> on 2019/05/31 10:20:54 UTC

autostarting jmeter-server with systemd

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

Re: autostarting jmeter-server with systemd

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 31.05.19 um 12:20 schrieb Ivan Rancati:
> 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

You might want to change the user running the jmeter service to some
less privileged one.

Regards,

 Felix

>
> Thanks to the JMeter for Jmeter and happy testing,
> Ivan
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: autostarting jmeter-server with systemd

Posted by Philippe Mouawad <ph...@gmail.com>.
Thanks for sharing !

On Friday, May 31, 2019, Ivan Rancati <iv...@gmail.com> wrote:

> 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
>


-- 
Cordialement.
Philippe Mouawad.