标签 centos7 下的文章

1.yum install epel-release
001.png
2.yum search mosquitto

002.png

3.yum install mosquitto mosquitto-devel

按【Y】
003.png
4.service mosquitto start 启动mosquitto服务 报错

Redirecting to /bin/systemctl start mosquitto.service

  1. /bin/systemctl start mosquitto.service 这么启动

6.mosquitto_sub -t test1 创建一个主题

7.另外独立开启会话 mosquitto_pub -t test1 -m joyokim

8.最终效果出来了

005.png

笔记:
开启防火墙
systemctl start firewalld
关闭防火墙
systemctl stop firewalld
禁用防火墙服务
systemctl make firewalld

添加规则:

开放80端口

firewall-cmd --permanent --add-port=80/tcp

开放443端口

firewall-cmd --permanent --add-port=443/tcp

开放22端口

firewall-cmd --permanent --add-port=22/tcp

开放21端口

firewall-cmd --permanent --add-port=21/tcp

开放23560端口

firewall-cmd --permanent --add-port=23560/tcp

开放8080端口

firewall-cmd --permanent --add-port=8080/tcp

【旧防火墙机制】
安装iptables
yum -y install iptables-services
开启iptables
systemctl enable iptables