-
Notifications
You must be signed in to change notification settings - Fork 267
Installing HiveMQ
HiveMQ CE can be packaged into a zip file, which contains the executables, init scripts and sample configurations.
The zip contains the following directories:
Folder name | Description |
---|---|
|
The folder with start scripts and binary files. |
|
The folder with the configurations. |
|
Persistent client data and cluster data are located here. |
|
All log files can be found here. |
|
The folder where extensions reside. |
|
Information about the licenses of third party libraries can be found here. |
Note
|
Example configurations
HiveMQ comes with many example configuration files in the conf/examples directory.
|
The default installation directory is /opt/hivemq
and the default user to run HiveMQ is named hivemq
. If you need to install HiveMQ to a custom directory or run it under a custom user please be aware of changing the $HIVEMQ_DIRECTORY
and/or the HIVEMQ_USER
in the $HIVEMQ_DIRECTORY/bin/start.sh
script.
-
Login as root
Some of the following commands need root privileges, please login as root or use sudo to execute the commands.
-
Check out the git repository and build the binary package.
git clone https://github.com/hivemq/hivemq-community-edition.git cd hivemq-community-edition ./gradlew clean hivemqZip
-
Go to the folder containing the zip file
cd build/distributions/
-
Extract the files
unzip hivemq-ce-<version>.zip
-
Create hivemq symlink
ln -s /opt/hivemq-ce-<version> /opt/hivemq
-
Create HiveMQ user
useradd -d /opt/hivemq hivemq
-
Make scripts executable and change owner to
hivemq
userchown -R hivemq:hivemq /opt/hivemq-ce-<version> chown -R hivemq:hivemq /opt/hivemq cd /opt/hivemq chmod +x ./bin/run.sh
-
Adjust the configuration properties to your needs.
See chapter Configuration for detailed instructions how to configure HiveMQ.
-
Install the init script (optional)
For Debian-based linux like Debian, Ubuntu, Raspbian using init.d scripts
cp /opt/hivemq/bin/init-script/hivemq-debian /etc/init.d/hivemq chmod +x /etc/init.d/hivemq
For linux systems using systemd
cp /opt/hivemq/bin/init-script/hivemq.service /etc/systemd/system/hivemq.service
For all other linux systems
cp /opt/hivemq/bin/init-script/hivemq /etc/init.d/hivemq chmod +x /etc/init.d/hivemq
-
Modify /etc/init.d/hivemq (optional)
Set the HIVEMQ_HOME and the HIVEMQ_USER variable to the correct values for your system.
By default this would be:
HIVEMQ_HOME=/opt/hivemq
HIVEMQ_USER=hivemq
If you installed HiveMQ to a different directory than
/opt/hivemq
please point the HIVEMQ_HOME in your init script to the correct directory. Otherwise the daemon will not start correctly. -
Start HiveMQ on boot (optional)
For Debian-based linux like Debian, Ubuntu, Raspbian
update-rc.d hivemq defaults
For Debian-based linux like Debian, Ubuntu, Raspbian using systemd
systemctl enable hivemq
Debian > 6.0
insserv hivemq
CentOS or RHEL
chkconfig hivemq on
The following instructions show how to start HiveMQ after the installation.
-
Change directory to HiveMQ directory
cd /opt/hivemq
-
Execute startup script
./bin/run.sh
-
Clone the repository from https://github.com/hivemq/hivemq-community-edition.git and run
./gradlew clean hivemqZip
-
Extract the hivemq-ce-<version>.zip file in the build\zip folder of the repository to C:\hivemq using your favorite Zip unpack utility.
The steps to install HiveMQ as a Windows Service are:
-
Download the hivemq-windows-service.zip file from here
-
Unzip the hivemq-windows-service.zip file.
-
Copy the windows-service folder to your HiveMQ home folder.
-
Open the windows-service folder.
-
Double click the installService.bat file.
-
Reboot
Important
|
Make sure you have the permission to install a service. Therefore it might be necessary to right click the installService.bat and select Run as administrator. |
The following instructions show how to start HiveMQ after installing:
Double click on the run.bat file.
Important
|
Please keep in mind that a click with the left mouse button (QuickEdit) stops the output of the command line. When you click the command line before "Started HiveMQT in xxx ms" is displayed, the HiveMQ start up is interrupted and needs to be continued via a click of the right mouse button. A click after the HiveMQ start up has no impact on the execution of HiveMQ. |