|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们!1、实行情况
3
rabbitmq-node1.com192.168.1.112
rabbitmq-node2.com192.168.1.113
rabbitmq-node3.com192.168.1.128
2、设置前反省同步工夫
#ntpdatepool.ntp.org
3、注重必定要修正hosts
[size=1em][size=1em]#cat/etc/hosts
[size=1em]192.168.1.112rabbitmq-node1.comrabbitmq-node1
[size=1em]192.168.1.113rabbitmq-node2.comrabbitmq-node2
[size=1em]192.168.1.128rabbitmq-node3.comrabbitmq-node3
4、装置erlang
[size=1em][size=1em]#yum-yinstallerlang
5、装置rabbitqmq
[size=1em][size=1em]#wgethttp://www.rabbitmq.com/releases/rabbitmq-server/v2.8.6/rabbitmq-server-2.8.6-1.noarch.rpm
[size=1em]#yum-yinstallrabbitmq-server-2.8.6-1.noarch.rpm
[size=1em]
[size=1em][root@rabbitmq-node1~]#/etc/init.d/rabbitmq-serverstart
[size=1em]Startingrabbitmq-server:SUCCESS
[size=1em]rabbitmq-server.
[size=1em][size=1em]#rabbitmqctlstatus//检察形态
6、装置插件办理界面
[size=1em][size=1em]#mkdir-m777/etc/rabbitmq/(假如目次已存在间接实行#chmod777/etc/rabbitmq/)
[size=1em]#rabbitmq-pluginsenablerabbitmq_management
[size=1em]重启rabbitmq-server
[size=1em]#rabbitmqctlstop
[size=1em]#/etc/init.d/rabbitmq-serverstart
检察办理端口有无启动:
[size=1em][size=1em]#netstat-tnlp|grep55672
扫瞄器翻开http://IP:55672账号暗码都是guest
注重:rabbitmq从3.3.0入手下手克制利用guest/guest权限经由过程除localhost外的会见。
假如想利用guest/guest经由过程近程呆板会见,必要在rabbitmq设置文件中(/etc/rabbitmq/rabbitmq.config)中设置loopback_users为[]。
/etc/rabbitmq/rabbitmq.config文件完全内容以下(注重前面的半角句号):
[{rabbit,[{loopback_users,[]}]}].
7、rabbitmq集群设置
(1)设置每一个节点Cookie
Rabbitmq的集群是依附于erlang的集群来事情的,以是必需先构建起erlang的集群情况。Erlang的集群中各节点是经由过程一个magiccookie来完成的,这个cookie寄存在/var/lib/rabbitmq/.erlang.cookie中,文件是400的权限。以是必需包管各节点cookie坚持分歧,不然节点之间就没法通讯
[size=1em][size=1em]#cat/var/lib/rabbitmq/.erlang.cookie
[size=1em]EJARCZORCOTEQWFGPWXR
(2)中断一切节点RabbitMQ办事,然后利用detached参数自力运转,这步很关头,特别增添节点中断节点后再次启动碰到没法启动都能够参照这个按次
[size=1em][size=1em][root@rabbitmq-node3~]#rabbitmq-server-detached
[size=1em][root@rabbitmq-node2~]#rabbitmq-server-detached
[size=1em][root@rabbitmq-node1~]#rabbitmq-server-detached
(3)关于节点范例(ram|disk)
ram节点的形态保留在内存中,disk节点保留在磁盘中被到场的节点为disk,如本例中rabbit@host2为ram节点,rabbit@host1,rabbit@host3为ram节点,能够经由过程rabbitmqctlcluster下令改动到场的集群和节点范例该下令后能够加多个节点称号,指定的节点就会酿成disk节点
<divstyle="padding:0px;margin:0px;color:rgb(44,44,44);font-family:宋体,ArialNarrow,arial,serif;font-size:14px;line-height:28px;"><divclass="syntaxhighlighterbash"id="highlighter_973480"style="width:720px;padding:0px!important;margin:0.3em0px!important;border-radius:0px!important;border:0px!important;bottom:auto!important;float:none!important;left:auto!important;line-height:1.1em!important;outline:0px!important;overflow-y:visible!important;overflow-x:auto!important;position:relative!important;right:auto!important;top:auto!important;vertical-align:baseline!important;box-sizing:content-box!important;font-family:Consolas,BitstreamVeraSansMono,CourierNew,Courier,monospace!important;font-size:1em!important;min-height:inherit!important;background-image:none!important;background-attachment:initial!important;background-size:initial!important;background-origin:initial!important;background-clip:initial!important;background-position:initial!important;background-repeat:initial!important;"><divclass="container"style="padding:0px!important;margin:0px!important;border-radius:0px!important;border:0px!important;bottom:auto!important;float:none!important;left:auto!important;line-height:1.1em!important;outline:0px!important;overflow:visible!important;position:relative!important;right:auto!important;top:auto!important;vertical-align:baseline!important;width:auto!important;box-sizing:content-box!important;font-size:1em!important;min-height:inherit!important;background:none!important;"> |
|