OpenSource

rabbitmq clustering

아르비스 2016. 4. 28. 21:53

<rabbitmq clustering>

모든 node에 host 이름 넣기 

 - /etc/hosts  server, host 등록



node 1 start

# service rabbitmq-server start


 - cookie 복제 (1번 서버 .erlang.cookie 내용을 2 서버에 복제)


(scp /var/lib/rabbitmq/.erlang.cookie root@xxx.xxx.xxx.xx:/var/lib/rabbitmq/ )



node 2 start

 - 2 서버에서 실행


# service rabbitmq-server start


rabbitmqctl stop_app

rabbitmqctl join_cluster rabbit@ABC-linux20

rabbitmqctl start_app


Cluster 설정 확인


#rabbitmqctl cluster_status


[root@ABC-linux06 /]# rabbitmqctl cluster_status

Cluster status of node 'rabbit@ABC-linux06' ...

[{nodes,[{disc,['rabbit@ABC-linux06','rabbit@ABC-linux27']}]},

 {running_nodes,['rabbit@ABC-linux27','rabbit@ABC-linux06']},

 {cluster_name,<<"rabbit@ABC-linux06">>},

 {partitions,[]}]

[root@ABC-linux06 /]#