3

rabbitmq用配置文件配置集群

 3 years ago
source link: https://www.wencst.com/archives/174
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

rabbitmq用配置文件配置集群

作者: wencst 分类: linux,Uncategorized 发布时间: 2016-08-24 22:51 阅读: 1,870 次

在rabbitmq_server-3.6.3/etc/rabbitmq/rabbitmq.config文件中可以配置启动时集群状态,配置文件内容如下:

[
{rabbit,
[
  {tcp_listeners, [5672]},
  {num_tcp_acceptors, 10},
  {log_levels, [{connection, info}, {channel, info},{federation, info},{mirroring, info}]},
  {loopback_users, [] },
  {default_vhost,       <<"/">>},
  {default_user,        <<"guest">>},
  {default_pass,        <<"guest">>},
  {default_permissions, [<<".*">>,<<".*">>, <<".*">>]},
  {default_user_tags, [administrator]},
  {cluster_nodes, {['rabbit@rabbit1', 'rabbit@rabbit2'], disc}},
  {channel_max, 128}
]
}
].

其中{cluster_nodes, {[‘rabbit@rabbit1’, ‘rabbit@rabbit2’], disc}}即为配置集群的方式。

此种方式注意几点:

1.rabbitmqctl reset命令执行时,集群节点恢复至配置文件配置情形

2.初始时,集群节点不是高可用状态

3.当集群中所有节点均停止时,需要先启动最后停止的节点,否则其他节点无法启动,若不能启动最后一个节点,则要使用forget_cluster_node命令将其移出集群

若集群中节点几乎同时以不可控的方式down了此时在其中一个节点使用force_boot命令重启节点

如果文章对您有用,扫一下支付宝的红包,不胜感激!

欢迎加入QQ群进行技术交流:656897351(各种技术、招聘、兼职、培训欢迎加入)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK