QPID集群安装部署

在CentOS/Redhat 发行版本的安装的Openstack,默认是使用qpid作为消息队列服务.那么生产环境固然是要做高可用,下面就单独部署一套QPID集群服务.

[root@qpid01 ~] rm /etc.yum.repo.d/* -f
[root@qpid01 ~] cat /etc/yum.repo.d/ustc.repo

[ustc]
name = ustc
baseurl = http://centos.ustc.edu.cn/centos/6.6/os/x86_64/
gpgcheck=0
enable=1

[update]
name = update
baseurl = http://centos.ustc.edu.cn/centos/6.6/updates/x86_64/
gpgcheck=0
enable=1

[extras]
name = extras
baseurl = http://centos.ustc.edu.cn/centos/6.6/extras/x86_64/
gpgcheck=0
enable=1

更新系统,安装必要的软件包

[root@qpid01 ~] yum makecache
[root@qpid01 ~] yum upgrade -y
[root@qpid01 ~] yum install qpid-cpp-server qpid-cpp-server-cluster qpid-tools -y
[root@qpid01~] yum install corosync corosynclib -y
[root@qpid01 ~] init 6

修改qpid配置文件 vi /etc/qpidd.conf

auth=no
cluster-name="cluster-qpid"

创建配置文件

[root@qpid01~] cat /etc/corosync/corosync.conf

compatibility: whitetank

aisexec { user: root group: root } totem { version: 2 secauth: on threads: 0 interface { ringnumber: 0 bindnetaddr: 10.0.0.0 mcastaddr: 226.94.1.1 mcastport: 5405 ttl: 1 } } logging { fileline: off to_stderr: no to_logfile: yes to_syslog: yes logfile: /var/log/cluster/corosync.log debug: off timestamp: on logger_subsys { subsys: AMF debug: off } } amf { mode: disabled }

创建集群认证密钥

[root@qpid01 ~] cd /etc/corosync/
[root@qpid01 corosync] corosync-keygen

打开新终端,加快密钥生成速度

[root@qpid01 corosync] tar cvj / | md5sum > /dev/null

开通corosync防火墙规则

[root@qpid01 ~] iptables --insert INPUT 1 --proto udp --source 10.0.0.0/24 --destination 226.94.1.1/32 --dport 5405 -j ACCEPT
[root@qpid01 ~] iptables --insert INPUT 1 --proto udp --source 10.0.0.0/24 --destination 10.0.0.101/32 --dport 5405 -j ACCEPT
[root@qpid01 ~] iptables --insert INPUT 1 --proto udp --source 10.0.0.0/24 --destination 10.0.0.101/32 --dport 5404 -j ACCEPT
[root@qpid01 ~] iptables --insert INPUT 1 --proto tcp --source 10.0.0.0/24 --destination 10.0.0.101/32 --dport 5672 -j ACCEPT
[root@qpid01 ~] service iptables save

qpid02上也需要开通相同的防火墙设置

把创建好的 密钥和corosync.conf都拷贝到qpid02上相同的目录下
分别启动corosync

[root@qpid01 ~]# service corosync start
Starting Corosync Cluster Engine (corosync):       [  OK  ]
[root@qpid01 ~]# corosync-cfgtool -s
Printing ring status.
Local node ID 687865866
RING ID 0
    id  = 10.0.0.101
    status  = ring 0 active with no faults
[root@qpid01 ~]# corosync-objctl | grep members | grep ip
runtime.totem.pg.mrp.srp.members.687865866.ip=r(0) ip(10.0.0.101) 
runtime.totem.pg.mrp.srp.members.704643082.ip=r(0) ip(10.0.0.102)

以集群方式启动QPID

[root@qpid01 ~] qpidd cluster-name='cluster-qpid' -d 
[root@qpid01 ~] qpid-cluster

要在openstack中访问qpid集群,在服务配置文件中使用

qpid_hosts = qpid01:5672,qpid02:5672

你可能感兴趣的:(openstack,qpid)