程序安装 (Installation)
EMQ 2.0 消息服务器可跨平台运行在 Linux、FreeBSD、Mac OS X 或 Windows 服务器上。
TIP
产品部署建议 Linux、FreeBSD 服务器,不推荐 Windows 服务器。
EMQ 2.0 程序包下载
EMQ 2.0 消息服务器每个版本会发布 Ubuntu、CentOS、FreeBSD、Mac OS X、Windows 平台程序包与 Docker 镜像。
下载地址: https://www.emqx.io/downloads (opens new window)
RPM 包安装
EMQ Linux RPM 程序包:
CentOS6.8 https://www.emqx.io/downloads/v2/latest/emqttd-centos6.rpm (opens new window)
CentOS7 https://www.emqx.io/downloads/v2/latest/emqttd-centos7.rpm (opens new window)
安装包命名由平台、版本、操纵系统位数组成,例如: emqttd-centos7-v2.0_x86_64.rpm
CentOS、RedHat 操作系统下,推荐 RPM 包安装。RPM 包安装后可通过操作系统,直接管理启停 EMQ 服务。
RPM 安装
TIP
Erlang/OTP R19 依赖 lksctp-tools 库
yum install lksctp-tools
配置文件
EMQ 配置文件: /etc/emqttd/emq.conf,插件配置文件: /etc/emqttd/plugins/*.conf。
日志文件
日志文件目录: /var/log/emqttd
数据文件
数据文件目录:/var/lib/emqttd/
启动停止
systemctl start|stop|restart emqttd.service
DEB 包安装
EMQ Linux DEB 程序包:
Ubuntu12.04 https://www.emqx.io/downloads/v2/latest/emqttd-ubuntu12.04.deb (opens new window)
Ubuntu14.04 https://www.emqx.io/downloads/v2/latest/emqttd-ubuntu14.04.deb (opens new window)
Ubuntu16.04 https://www.emqx.io/downloads/v2/latest/emqttd-ubuntu16.04.deb (opens new window)
Debian7 https://www.emqx.io/downloads/v2/latest/emqttd-debian7.deb (opens new window)
Debian8 https://www.emqx.io/downloads/v2/latest/emqttd-debian7.deb (opens new window)
安装包命名由平台、版本、操纵系统位数组成,例如: emqttd-debian7-v2.0_amd64.deb
Debian、Ubuntu 操作系统下,推荐 DEB 包安装。DEB 包安装后可通过操作系统,直接管理启停 EMQ 服务。
TIP
Erlang/OTP R19 依赖 lksctp-tools 库
配置文件
EMQ 配置文件: /etc/emqttd/emq.conf,插件配置文件: /etc/emqttd/plugins/*.conf。
日志文件
日志文件目录: /var/log/emqttd
数据文件
数据文件目录:/var/lib/emqttd/
启动停止
service emqttd start|stop|restart
Linux 通用包安装
EMQ Linux 通用程序包:
Ubuntu12.04 https://www.emqx.io/downloads/v2/latest/emqtt-ubuntu12.04.zip (opens new window)
Ubuntu14.04 https://www.emqx.io/downloads/v2/latest/emqtt-ubuntu14.04.zip (opens new window)
Ubuntu16.04 https://www.emqx.io/downloads/v2/latest/emqtt-ubuntu16.04.zip (opens new window)
CentOS6.8 https://www.emqx.io/downloads/v2/latest/emqtt-centos6.zip (opens new window)
CentOS7 https://www.emqx.io/downloads/v2/latest/emqtt-centos7.zip (opens new window)
Debian7 https://www.emqx.io/downloads/v2/latest/emqtt-debian7.zip (opens new window)
Debian8 https://www.emqx.io/downloads/v2/latest/emqtt-debian8.zip (opens new window)
FreeBSD https://www.emqx.io/downloads/v2/latest/emqtt-freebsd.zip (opens new window)
安装包命名由平台、版本组成,例如: emqttd-macosx-v2.0.zip
CentOS 平台为例,下载安装过程:
unzip emqttd-centos7-v2.0.zip
控制台调试模式启动,检查 EMQ 是否可正常启动:
cd emqttd && ./bin/emqttd console
EMQ 消息服务器如启动正常,控制台输出:
emqttd ctl is starting...[ok]
emqttd hook is starting...[ok]
emqttd router is starting...[ok]
emqttd pubsub is starting...[ok]
emqttd stats is starting...[ok]
emqttd metrics is starting...[ok]
emqttd pooler is starting...[ok]
emqttd trace is starting...[ok]
emqttd client manager is starting...[ok]
emqttd session manager is starting...[ok]
emqttd session supervisor is starting...[ok]
emqttd wsclient supervisor is starting...[ok]
emqttd broker is starting...[ok]
emqttd alarm is starting...[ok]
emqttd mod supervisor is starting...[ok]
emqttd bridge supervisor is starting...[ok]
emqttd access control is starting...[ok]
emqttd system monitor is starting...[ok]
dashboard:http listen on 0.0.0.0:18083 with 2 acceptors.
mqtt:tcp listen on 0.0.0.0:1883 with 8 acceptors.
mqtt:ssl listen on 0.0.0.0:8883 with 4 acceptors.
mqtt:ws listen on 0.0.0.0:8083 with 4 acceptors.
Erlang MQTT Broker 2.0 is running now
CTRL+c 关闭控制台。守护进程模式启动:
启动错误日志将输出在 log/ 目录。
EMQ 消息服务器进程状态查询:
正常运行状态,查询命令返回:
$ ./bin/emqttd_ctl status
Node 'emqttd@127.0.0.1' is started
emqttd 2.0 is running
EMQ 消息服务器提供了状态监控 URL :
http://localhost:8080/status
停止服务器:
./bin/emqttd stop
相关文章推荐 : wmap使用apache ab进行压力测试实操
linux下如何实现mysql数据库每天自动备份定时备份?