...
HiveMQ provides a specific run script called recovery.sh
that can be utilized for starting a HiveMQ node in cluster mode with persistent data
Startup via using the start up script
Execute the the
recovery.sh
file in theHIVEMQ_HOME/bin
folder.Code Block cd <your-hivemq-home-folder>/bin./recovery.sh
Start up HiveMQ as a service (init.d)
Open the HiveMQ init.d start script
Code Block vi /etc/init.d/hivemq
Change the startup to using
recovery.sh
instead of
at line 19run.shCode Block ... failure $"HiveMQ start" echo; else echo -n Starting HiveMQ server su $HIVEMQ_USER -c "$HIVEMQ_HOME/bin/recovery.sh >/dev/null 2>&1 &" ### Create the lock file ### touch /var/lock/subsys/hivemq success $"HiveMQ server started" ...
Start the HiveMQ Service
Code Block /etc/init.d/hivemq start
- Make sure to revert the changes from step 2
...
Open the HiveMQ init.d start script
Code Block vi /etc/init.d/hivemq
Change the startup to using
recovery.sh
instead of
at line 19run.shCode Block ... BASEDIR=/opt/hivemq NAME=hivemq DESC="MQTT Broker" DAEMON=/opt/hivemq/bin/recovery.sh DAEMON_USER=hivemq DAEMON_GROUP=hivemq PID_FILE="/var/run/${NAME}.pid" ...
Start the HiveMQ Service
Code Block /etc/init.d/hivemq start
- Make sure to revert the changes from step 2
...
Open the HiveMQ systemd script
Code Block vi /etc/systemd/system/hivemq.service
Change the startup to using
recovery.sh
instead of
at line 12run.shCode Block ... ExecStart=/opt/hivemq/bin/recovery.sh ...
Start the HiveMQ Service
Code Block systemctl start hivemq
- Make sure to revert the changes from step 2
...
Page Properties | ||
---|---|---|
| ||
|