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

  1. Dependency packages required to install

    $ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    
     
            Copied!
        
    Copy the code
  2. 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
  3. 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.

  4. Install a specific version of EMQ X Broker

    1. 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
    2. 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
  5. 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
  6. Stop the EMQ X Broker

    $ emqx stop
    ok
    
     
            Copied!
        
    Copy the code
  7. Uninstall EMQ X Broker

    $ sudo yum remove emqx
    Copy the code

    Ubuntu, Debian

  8. 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
  9. 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
  10. 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.

  11. Update apt package index

    $ sudo apt update
    
     
            Copied!
        
    Copy the code
  12. 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.

  13. Install a specific version of EMQ X Broker

    1. 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
    2. 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
  14. 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
  15. Stop the EMQ X Broker

    $ emqx stop
    ok
    
     
            Copied!
        
    Copy the code
  16. Uninstall EMQ X Broker

    $ sudo apt remove emqx
    Copy the code