Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

  1. Execute the the recovery.sh file in the HIVEMQ_HOME/bin folder.

    Code Block
    cd <your-hivemq-home-folder>/bin./recovery.sh


Start up HiveMQ as a service (init.d)

  1. Open the HiveMQ init.d start script

    Code Block
    vi /etc/init.d/hivemq


  2. Change the startup to using recovery.sh instead of run.sh at line 19

    Code 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"
    ...


  3. Start the HiveMQ Service

    Code Block
    /etc/init.d/hivemq start


  4. Make sure to revert the changes from step 2

...

  1. Open the HiveMQ init.d start script

    Code Block
    vi /etc/init.d/hivemq


  2. Change the startup to using recovery.sh instead of run.sh at line 19

    Code 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"
    ...


  3. Start the HiveMQ Service

    Code Block
    /etc/init.d/hivemq start


  4. Make sure to revert the changes from step 2

...

  1. Open the HiveMQ systemd script

    Code Block
    vi /etc/systemd/system/hivemq.service


  2. Change the startup to using recovery.sh instead of run.sh at line 12

    Code Block
    ...
      ExecStart=/opt/hivemq/bin/recovery.sh
    ...


  3. Start the HiveMQ Service

    Code Block
    systemctl start hivemq


  4. Make sure to revert the changes from step 2

...

Page Properties
hiddentrue


Related issues