The installation
Emqx official documentation address: docs.emqx.cn/broker/v4.3…
One-click Installation of Shell Scripts (Linux)
curl https://repos.emqx.io/install_emqx.sh | bash
Copy the code
Package Manager Installation (Linux)
#CentOS
-
Dependency packages required to install
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2 Copied! Copy the code
-
Run the following command to set the stable repository. CentOS 7 is used as an example
$ sudo yum-config-manager --add-repo https://repos.emqx.io/emqx-ce/redhat/centos/7/emqx-ce.repo Copied! Copy the code
-
Install the latest version of EMQ X Broker
$ sudo yum install emqx Copied! Copy the code
If you are prompted to accept the GPG key, ensure that the key matches FC84 1BA6 3775 5CA8 487b 1E3C C0B4 0946 3E64 0D53 and accept the fingerprint.
-
Install a specific version of EMQ X Broker
-
Querying the available version
$yum list emqx - showduplicates | sort - r emqx. X86_64 4.0.0-1. El7 emqx - stable emqx. X86_64 3.0.1-1. El7 emqx - stable Emqx. X86_64 3.0.0-1. El7 emqx - stable Copied!Copy the code
-
Install a specific version, such as 4.0.0, based on the version string in the second column
$sudo yum install emqx-4.0.0 Copied!Copy the code
-
-
Start EMQ X Broker
-
Direct start
$emqx start emqx 4.0.0 is started successfully! $emqx_ctl status Node '[email protected]' is started emqx V4.0.0 is running Copied!Copy the code
-
Systemctl start
$ sudo systemctl start emqx Copied! Copy the code
-
The service start
$ sudo service emqx start Copied! Copy the code
-
-
Stop the EMQ X Broker
$ emqx stop ok Copied! Copy the code
-
Uninstall EMQ X Broker
$ sudo yum remove emqx Copy the code
Ubuntu, Debian
-
Dependency packages required to install
$ sudo apt update && sudo apt install -y \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common Copied! Copy the code
-
Add EMQ X’s official GPG key
$ curl -fsSL https://repos.emqx.io/gpg.pub | sudo apt-key add - Copied! Copy the code
Authentication key
$ sudo apt-key fingerprint 3E640D53 pub rsa2048 2019-04-10 [SC] FC84 1BA6 3775 5CA8 487B 1E3C C0B4 0946 3E64 0D53 uid [ unknown] emqx team <[email protected]> Copied! Copy the code
-
Use the following command to set up the stable repository. To add unstable repository, add the word unstable after the word stable in the following command.
$ sudo add-apt-repository \ "deb [arch=amd64] https://repos.emqx.io/emqx-ce/deb/ubuntu/ \ ./$(lsb_release -cs) \ stable" Copied!Copy the code
The lsb_release-cs subcommand returns the name of the distribution, such as Xenial. Sometimes, in distributions like Linux Mint, you may need to change $(LSB_release-cs) to your parent distribution. For example, if you use Linux Mint Tessa, you can use Bionic. EMQ X Broker makes no warranties for untested and unsupported distributions.
-
Update apt package index
$ sudo apt update Copied! Copy the code
-
Install the latest version of EMQ X Broker
$ sudo apt install emqx Copied! Copy the code
In cases where multiple EMQ X repositories are enabled, the latest version of EMQ X Broker is automatically installed if the apt install and apt update commands do not specify a version number. This can be a problem for users with stability requirements.
-
Install a specific version of EMQ X Broker
-
Querying the available version
$sudo apt - cache Madison emqx emqx | 4.0.0 | https://repos.emqx.io/emqx-ce/deb/ubuntu bionic/stable amd64 Packages emqx | 3.0.1 | https://repos.emqx.io/emqx-ce/deb/ubuntu bionic/stable amd64 Packages emqx | 3.0.0 | https://repos.emqx.io/emqx-ce/deb/ubuntu bionic/stable amd64 Packages Copied!Copy the code
-
Install a specific version, such as 4.0.0, using the version string in the second column
$sudo apt install emqx=4.0.0 Copied!Copy the code
-
-
Start EMQ X Broker
-
Direct start
$emqx start emqx 4.0.0 is started successfully! $emqx_ctl status Node '[email protected]' is started emqx V4.0.0 is running Copied!Copy the code
-
Systemctl start
$ sudo systemctl start emqx Copied! Copy the code
-
The service start
$ sudo service emqx start Copied! Copy the code
-
-
Stop the EMQ X Broker
$ emqx stop ok Copied! Copy the code
-
Uninstall EMQ X Broker
$ sudo apt remove emqx Copy the code