OpenStack HA集群2

  • 时间:
  • 浏览:2

本文转自 OpenStack2015 51CTO博客,原文链接:http://blog.51cto.com/andyliu/1901022,如需转载请自行联系原作者

 {running_nodes,[rabbit@controller3,rabbit@controller1,rabbit@controller2]},

[root@controller1 ~]# scp /var/lib/rabbitmq/.erlang.cookie controller3:/var/lib/rabbitmq/.erlang.cookie

 {cluster_name,<<"rabbit@controller1">>},

[root@controller2 ~]# rabbitmqctl cluster_status

[root@controller2 ~]# rabbitmqctl stop_app

[root@controller3 ~]# rabbitmqctl stop_app

          {rabbit@controller2,[]}]}]

[root@controller1 ~]# systemctl status rabbitmq-server.service

 {partitions,[]},

[root@controller3 ~]# systemctl restart rabbitmq-server.service

[root@controller1 ~]#

2

[root@controller2 ~]# systemctl restart rabbitmq-server.service

[root@controller1 ~]# systemctl status rabbitmq-server.service

Creating user "openstack" ...

The following plugins have been enabled:

 {alarms,[{rabbit@controller3,[]},

登录:http://192.168.17.132:15672/#/

          {rabbit@controller1,[]}]}]

以上一另八个 节点同去进行

[root@controller2 ~]# rabbitmqctl join_cluster --ram rabbit@controller1

 {alarms,[{rabbit@controller3,[]},

[root@controller1 ~]# systemctl start rabbitmq-server.service

[root@controller1 ~]# rabbitmqctl add_user openstack zoomtech

   Changes will take effect at broker restart.

          {rabbit@controller2,[]},

[root@controller3 ~]# rabbitmqctl join_cluster --ram rabbit@controller1

1、安装RabbitMQ-server

[root@controller2 ~]# rabbitmqctl start_app

Stopping node rabbit@controller3 ...

 * Could not contact node rabbit@controller1.

[root@controller1 ~]# rabbitmqctl set_permissions -p / mqadmin ".*" ".*" ".*"

 {cluster_name,<<"rabbit@controller1">>},

 * Options: --online  - fail if broker cannot be contacted.

 {running_nodes,[rabbit@controller3,rabbit@controller2,rabbit@controller1]},

[root@controller1 ~]# rabbitmqctl add_user mqadmin mqadmin

  rabbitmq_management

将controller2加入到controller1集群中

  rabbitmq_web_dispatch

[root@controller1 ~]# systemctl restart rabbitmq-server.service

rabbitmq-server.service                       enabled

Cluster status of node rabbit@controller2 ...

Stopping node rabbit@controller2 ...

[{nodes,[{disc,[rabbit@controller1]},

Creating user "mqadmin" ...

新增一另八个 用户,在一另八个 节点中操作

Clustering node rabbit@controller2 with rabbit@controller1 ...

Setting permissions for user "mqadmin" in vhost "/" ...

在Controller1上查看集群请况

[root@controller1 ~]# systemctl list-unit-files | grep rabbitmq

[root@controller1 ~]# /usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management mochiweb webmachine rabbitmq_web_dispatch amqp_client rabbitmq_management_agent

[root@controller1 ~]# rabbitmqctl set_permissions openstack ".*" ".*" ".*"

         {ram,[rabbit@controller3,rabbit@controller2]}]},

 {partitions,[]},

[root@controller1 ~]# rabbitmqctl cluster_status

          {rabbit@controller1,[]},

  webmachine

Cluster status of node rabbit@controller1 ...

  mochiweb

Applying plugin configuration to rabbit@controller1... failed.

  amqp_client

[root@controller1 ~]# yum install -y erlang rabbitmq-server

[root@controller1 ~]# rabbitmqctl status

  rabbitmq_management_agent

Setting permissions for user "openstack" in vhost "/" ...

         {ram,[rabbit@controller3,rabbit@controller2]}]},

Username: guest      Password:guest

[{nodes,[{disc,[rabbit@controller1]},

克隆qq.erlang.coolie到controller2和controller3

[root@controller1 ~]# systemctl enable rabbitmq-server.service

Starting node rabbit@controller2 ...

[root@controller1 ~]# scp /var/lib/rabbitmq/.erlang.cookie controller2:/var/lib/rabbitmq/.erlang.cookie

将controller3加入到controller1集群中

            --offline - do not try to contact broker.

Clustering node rabbit@controller3 with rabbit@controller1 ...