RabbitMQ集群II3

2022-05-03 11:05:36 浏览数 (1)

查看集群状态

代码语言:javascript复制
[root@h101 mnesia]# rabbitmqctl  -n hare cluster_status
Cluster status of node hare@h101 ...
[{nodes,[{disc,[hare@h101]}]},
 {running_nodes,[hare@h101]},
 {cluster_name,<<"hare@h101.temp">>},
 {partitions,[]}]
[root@h101 mnesia]# rabbitmqctl  -n rabbit cluster_status
Cluster status of node rabbit@h101 ...
[{nodes,[{disc,[rabbit@h101]}]},
 {running_nodes,[rabbit@h101]},
 {cluster_name,<<"rabbit@h101.temp">>},
 {partitions,[]}]
[root@h101 mnesia]#

创建集群

代码语言:javascript复制
[root@h101 mnesia]# rabbitmqctl  -n rabbit stop_app 
Stopping node rabbit@h101 ...
[root@h101 mnesia]# rabbitmqctl  -n rabbit cluster_status
Cluster status of node rabbit@h101 ...
[{nodes,[{disc,[rabbit@h101]}]}]
[root@h101 mnesia]# rabbitmqctl  -n rabbit status
Status of node rabbit@h101 ...
[{pid,2975},
 {running_applications,[{xmerl,"XML parser","1.2.10"},
                        {sasl,"SASL  CXC 138 11","2.1.10"},
                        {stdlib,"ERTS  CXC 138 10","1.17.5"},
                        {kernel,"ERTS  CXC 138 10","2.14.5"}]},
 {os,{unix,linux}},
 {erlang_version,"Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:64] [kernel-poll:true]n"},
 {memory,[{total,27473232},
          {connection_readers,0},
          {connection_writers,0},
          {connection_channels,0},
          {connection_other,0},
          {queue_procs,0},
          {queue_slave_procs,0},
          {plugins,0},
          {other_proc,8922352},
          {mnesia,0},
          {mgmt_db,0},
          {msg_index,0},
          {other_ets,643008},
          {binary,3416},
          {code,14756074},
          {atom,1367393},
          {other_system,1780989}]},
 {alarms,[]},
 {listeners,[]},
 {processes,[{limit,1048576},{used,46}]},
 {run_queue,0},
 {uptime,251}]
[root@h101 mnesia]# rabbitmqctl  -n rabbit join_cluster hare@h101
Clustering node rabbit@h101 with hare@h101 ...
[root@h101 mnesia]# rabbitmqctl  -n rabbit start_app 
Starting node rabbit@h101 ...
[root@h101 mnesia]# rabbitmqctl  -n rabbit cluster_status
Cluster status of node rabbit@h101 ...
[{nodes,[{disc,[hare@h101,rabbit@h101]}]},
 {running_nodes,[hare@h101,rabbit@h101]},
 {cluster_name,<<"hare@h101.temp">>},
 {partitions,[]}]
[root@h101 mnesia]#

0 人点赞