mosquitto 真的集群化



[root@CentOSNode2 mosquitto]# vim  mosquitto.conf

每个节点有要安装 :这样的额配置共三个节点

node_name CentOSNode1
node_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).
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值