openstack controller ha测试环境搭建记录(五)——配置rabbitmq集群

配置rabbitmq集群的步骤非常简单,因为其本身含集群功能,参考openstack官网文档:
http://docs.openstack.org/ha-guide/controller-ha-rabbitmq.html

在所有节点安装rabbitmq:
# yum install -y rabbitmq-server

在所有节点设置rabbitmq开机启动:
# systemctl enable rabbitmq-server.service
# systemctl start rabbitmq-server.service

关闭所有节点的rabbitmq服务:
# systemctl stop rabbitmq-server.service

在节点1,拷贝cookie至其它节点:
# scp /var/lib/rabbitmq/.erlang.cookie root@controller2:/var/lib/rabbitmq/.erlang.cookie
# scp /var/lib/rabbitmq/.erlang.cookie root@controller3:/var/lib/rabbitmq/.erlang.cookie

在所有节点启动rabbitmq服务:
# systemctl start rabbitmq-server.service

在节点2、节点3,加入节点1的集群:
# rabbitmqctl stop_app
Stopping node rabbit@controller2...
...done.
# rabbitmqctl join_cluster rabbit@controller1
# rabbitmqctl start_app
Starting node rabbit@controller2 ...
...done.

在任意节点验证集群状态:
# rabbitmqctl cluster_status
Cluster status of node rabbit@controller1 ...
[{nodes,[{disc,[rabbit@controller1,rabbit@controller2,rabbit@controller3]}]},
{running_nodes,[rabbit@controller3,rabbit@controller2,rabbit@controller1]},
{cluster_name,<<"rabbit@controller1">>},
{partitions,[]}]
...done.

在任意节点执行HA策略设置:
# rabbitmqctl set_policy ha-all '^(?!amq\.).*' '{"ha-mode": "all"}'

在任意节点设置密码:
# rabbitmqctl change_password guest 123456

-----------------------------------------------------------------------------------

以下组件或服务以高可用队列(HA queues)的方式工作:
OpenStack Compute
OpenStack Block Storage
OpenStack Networking
Telemetry

上一篇:openstack controller ha测试环境搭建记录(七)——配置glance


下一篇:Python安装selenium,配置火狐浏览器环境