MQTT(EMQX) - Linux CentOS Docker 安装

MQTT(EMQX) - Linux CentOS 直接安装 和 Docker 安装

常规安装

下载文件

版本选择:https://www.emqx.com/zh/downloads/broker/
文本下载:https://www.emqx.com/zh/downloads/broker/4.4.16/emqx-4.4.16-otp24.3.4.2-1-el7-amd64.zip
el7-amd64 => EL 是 Red Hat Enterprise Linux 的简写, “el7” 表示的是 centos7/redhat7, amd64 一般指:x86-64
先介绍 常规安装,再描述
将下载的 zip 包,传至服务器
image

安装运行

[root@localhost ~]# cd /opt/emqx/
#将文件解压到 /usr/local/ 目录中,一般应用程序会安装在此目录
[root@localhost emqx]# unzip emqx-4.4.16-otp24.3.4.2-1-el7-amd64.zip -d /usr/local/
[root@localhost emqx]# cd /usr/local/emqx/
//启动
[root@localhost emqx]# ./bin/emqx start
//停止
[root@localhost emqx]# ./bin/emqx stop
//查看状态
[root@localhost emqx]# ./bin/emqx_ctl status

image

验证

访问地址:http://172.16.3.88:18083/
默认用户名: admin
默认密码: public
登录后会要求修改密码
image
image

Docker 安装 MQTT(EMQX)

安装运行

[root@localhost ~]# docker pull emqx:4.4.16
4.4.16: Pulling from library/emqx
3f9582a2cbe7: Pull complete 
396ee3d6a271: Pull complete 
f79aa88ad721: Pull complete 
8943a0bcb1f0: Pull complete 
66a2b18c61a7: Pull complete 
Digest: sha256:7d65f058645c9d9b9dbb9645333ebf720d06671ee752f530bb0f649e326f3785
Status: Downloaded newer image for emqx:4.4.16
docker.io/library/emqx:4.4.16
[root@localhost ~]# docker run -it --name emqx -p 18083:18083 -p 1883:1883 -p 8084:8084 -p 8883:8883 -p 8083:8083 -d emqx:4.4.16
–name 容器名字
-p 18083 服务器启动端口
-p 1883 TCP端口
-p 8083 WS端口
-p 8084 WSS端口
-p 8883 SSL端口
-d 后台启动

验证(同上)

http://172.16.3.88:18083/
image

posted @ 2023-03-29 08:47  VipSoft  阅读(737)  评论(0编辑  收藏  举报