[root@CentOSNode2 mosquitto]# vim mosquitto.conf
每个节点有要安装 :这样的额配置共三个节点
node_name CentOSNode1node_address CentOSNode1:1883
node_name CentOSNode2
node_address CentOSNode2:1883
node_name CentOSNode3
node_address CentOSNode3:1883
#node_keepalive <keepalive seconds>
#node_remote_username <username>
#node_remote_password <password>
#node_remote_clientid <clientid>
#node_cafile
#node_capath
#node_certfile
#node_keyfile
#node_insecure false
#node_tls_version
#node_identity
#node_psk
[wangshumin@CentOSNode1 mosquitto]$ ll
总用量 92-rw-r--r--. 1 root root 230 5月 9 12:32 aclfile.example
drwxr-xr-x. 2 root root 126 5月 9 12:17 confmy
-rw-r--r--. 1 root root 40276 5月 9 13:44 mosquitto.conf
-rw-r--r--. 1 root root 40153 5月 9 12:32 mosquitto.conf.example
-rw-r--r--. 1 root root 23 5月 9 12:32 pskfile.example
-rw-r--r--. 1 root root 355 5月 9 12:32 pwfile.example
[wangshumin@CentOSNode1 mosquitto]$ mosquitto -c /etc/mosquitto/mosquitto.conf
1525844857: mosquitto version 1.4.90 starting
1525844857: Config loaded from /etc/mosquitto/mosquitto.conf.
1525844857: Opening ipv4 listen socket on port 1883.
1525844857: Opening ipv6 listen socket on port 1883.
1525844857: [CLUSTER] totally 3 remote nodes configured:
1525844857: [CLUSTER] Node(1):CentOSNode1, ip:CentOSNode1, port:1883, local_clientid:CentOSNode1, remote_clientid:CentOSNode1_18082, remote_username:(null), remote_password:(null), keepalive:10
1525844857: [CLUSTER] Node(2):CentOSNode2, ip:CentOSNode2, port:1883, local_clientid:CentOSNode2, remote_clientid:CentOSNode1_18082, remote_username:(null), remote_password:(null), keepalive:10
1525844857: [CLUSTER] Node(3):CentOSNode3, ip:CentOSNode3, port:1883, local_clientid:CentOSNode3, remote_clientid:CentOSNode1_18082, remote_username:(null), remote_password:(null), keepalive:10
1525844857: New connection from 192.168.72.141 on port 1883.
1525844858: [CLUSTER INIT] Finally handshake with node: CentOSNode1 success.
1525844858: [CLUSTER INIT] Finally handshake with node: CentOSNode2 success.
1525844858: [CLUSTER INIT] Finally handshake with node: CentOSNode3 success.
1525844858: [CLUSTER] Receive CONNECT from peer: (null), remote_time:60196, local_time:60196, offset:0
1525844858: New peer connected from 192.168.72.141 as CentOSNode1_18082 (c0, k10).
1525844875: New connection from 192.168.72.142 on port 1883.
1525844877: [CLUSTER] Receive CONNECT from peer: (null), remote_time:60214, local_time:60215, offset:-1
1525844877: New peer connected from 192.168.72.142 as CentOSNode2_18150 (c0, k10).