1、添加 EPEL 软件库
[root@localhost data1]# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
2、查看结果
[root@localhost data1]# yum repolist all | grep enabled
已经添加了 EPEL 软件库,它显示有 13634 个软件包
3、查找 mosquitto 软件包
[root@localhost data1]# yum info mosquitto
4、安装 mosquitto 软件包
[root@localhost data1]# yum -c /etc/yum.conf --installroot=/data1/mosquitto/ --releasever=/ install mosquitto
5、查看安装结果
[root@localhost data1]# yum list installed | grep mosquitto
6、启动关闭mosquitto
启动:
[root@localhost data1]# service mosquitto start
关闭:
[root@localhost data1]# service mosquitto stop
7、查看mosquitto服务状态
[root@localhost data1]# service mosquitto status
8、如果上述都不能使用
直接使用yum安装:
yum -y install mosquitto
systemctl start mosquitto
systemctl enable mosquitto(可以不用)
查看是否启动