私有云落地解決方案之openstack高可用(pike版本)-叢集引數
作者:【吳業亮】
一、新增服務
將訊息佇列加入叢集監控中
crm configure primitive rabbitmq-server systemd:rabbitmq-server \
params environment_file="/etc/profile.d/rabbitmq-server.sh" \
op start interval=0s timeout=600 \
op stop interval=0s timeout=120 \
op monitor interval=10 timeout=20 \
meta priority=100
將訊息佇列克隆加入叢集監控中
crm configure clone rabbitmq-server -clone rabbitmq-server meta target-role=Started
注意:
在三個控制節點上建立/etc/profile.d/rabbitmq-server.sh並寫入
export RABBITMQ_USE_LONGNAME=true
將haproxy加入叢集監控中
crm configure primitive haproxy systemd:haproxy \
op start interval=0s \
op start interval=0s timeout=20s \
op stop interval=0s timeout=20s \
op monitor interval =20s timeout=30s \
meta priority=100 target-role=Started
colocation haproxy-with-vip inf: vip:Started haproxy:Started
將httpd加入叢集監控中
crm configure primitive httpd systemd:httpd \
op start interval=0s timeout=40s \
op stop interval=0s timeout=60s \
op monitor interval=30s timeout=30s
將memcached加入叢集監控中
crm configure primitive memcached systemd:memcached \
params \
op monitor interval=30s timeout=30s
crm configure clone openstack-dashboard-clone httpd meta
crm configure clone openstack-memcached-clone memcached
將openstack-glance-registry加入叢集監控中
crm configure primitive openstack-glance-registry systemd:openstack-glance-registry \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將openstack-glance-registry克隆加入叢集監控中
crm configure clone openstack-glance-registry-clone openstack-glance-registry metatarget-role=Started
將openstack-glance-api加入叢集監控中
crm configure primitive openstack-glance-api systemd:openstack-glance-api \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將openstack-glance-api克隆加入叢集監控中
crm configure clone openstack-glance-api-clone openstack-glance-api meta target-role=Started
將openstack-nova-cert加入叢集監控中
crm configure primitive openstack-nova-cert systemd:openstack-nova-cert \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將openstack-nova-cert克隆加入叢集監控中
crm configure clone openstack-nova-cert-clone openstack-nova-cert meta target-role=Started
將openstack-nova-api加入叢集監控中
crm configure primitive openstack-nova-api systemd:openstack-nova-api \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將openstack-nova-api克隆加入叢集監控中
crm configure clone openstack-nova-api-clone openstack-nova-api meta target-role=Started
將openstack-nova-conductor加入叢集監控中
crm configure primitive openstack-nova-conductor systemd:openstack-nova-conductor \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將openstack-nova-conductor克隆加入叢集監控中
crm configure clone openstack-nova-conductor-clone openstack-nova-conductor metatarget-role=Started
將openstack-nova-scheduler加入叢集監控中
crm configure primitive openstack-nova-scheduler systemd:openstack-nova-scheduler \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將openstack-nova-scheduler克隆加入叢集監控中
crm configure clone openstack-nova-scheduler-clone openstack-nova-scheduler metatarget-role=Started
將openstack-nova-novncproxy加入叢集監控中
crm configure primitive openstack-nova-novncproxy systemd:openstack-nova-、
novncproxy \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將openstack-nova-novncproxy克隆加入叢集監控中
crm configure clone openstack-nova-novncproxy-clone openstack-nova-novncproxy metatarget-role=Started
將openstack-nova-consoleauth加入叢集監控中
crm configure primitive openstack-nova-consoleauth systemd:openstack-nova-consoleauth \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s \
meta target-role=Started
將openstack-nova-consoleauth克隆加入叢集監控中
crm configure clone openstack-nova-consoleauth-clone openstack-nova-consoleauth metatarget-role=Started
將openstack-cinder-api加入叢集監控中
crm configure primitive openstack-cinder-api systemd:openstack-cinder-api \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將openstack-cinder-api克隆加入叢集監控中
crm configure clone openstack-cinder-api-clone openstack-cinder-api meta target-role=Started
將openstack-cinder-scheduler加入叢集監控中
crm configure primitive openstack-cinder-scheduler systemd:openstack-cinder-scheduler \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將openstack-cinder-scheduler克隆加入叢集監控中
crm configure clone openstack-cinder-scheduler-clone openstack-cinder-scheduler metatarget-role=Started
將neutron-server 加入叢集監控中
crm configure primitive neutron-server systemd:neutron-server \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將neutron-server克隆資源加入叢集監控中
crm configure clone neutron-server-clone neutron-server meta target-role=Started
將neutron-openvswitch-agent 加入叢集監控中
crm configure primitive neutron-openvswitch-agent systemd:neutron-openvswitch-agent \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將neutron-openvswitch-agent克隆 加入叢集監控中
crm configure clone neutron-openvswitch-agent-clone neutron-openvswitch-agent metatarget-role=Started
將neutron-dhcp-agent 加入叢集監控中
crm configure primitive neutron-dhcp-agent systemd:neutron-dhcp-agent \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將neutron-dhcp-agent克隆加入叢集監控中
crm configure clone neutron-dhcp-agent-clone neutron-dhcp-agent meta target-role=Started
將neutron-metadata-agent 加入叢集監控中
crm configure primitive neutron-metadata-agent systemd:neutron-metadata-agent \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將neutron-metadata-agent克隆加入叢集監控中
crm configure clone neutron-metadata-agent-clone neutron-metadata-agent metatarget-role=Started
將systemd:neutron-l3-agent加入叢集監控中
crm configure primitive neutron-l3-agent systemd:neutron-l3-agent \
op start interval=0s timeout=45s \
op stop interval=0s timeout=45s \
op monitor interval=30s timeout=30s
將systemd:neutron-l3-agent克隆加入叢集監控中
crm configure clone neutron-l3-agent-clone neutron-l3-agent meta target-role=Started
二、定義服務啟動順序
定義neutron-metadata-agent-clone和neutron-dhcp-agent-clone:start啟動
pcs constraint order order_neutron-metadata-agent_neutron-dhcp-agent \
neutron-metadata-agent-clone:start neutron-dhcp-agent-clone:start \
symmetrical=true
定義openstack-memcached-clone和openstack-dashboard-clone啟動
pcs constraint order order_memcached_httpd openstack-memcached-clone:start\
openstack-dashboard-clone:start \
symmetrical=true
定義vip、haproxy和openstack-neutron-server-clone啟動
pcs constraint order order_vip_haproxy vip:start haproxy:start \
pcs constraint order order_vip_neutron-server vip:start \
openstack-neutron-server-clone:start
定義neutron-openvswitch-agent-clone和neutron-metadata-agent-clone啟動
pcs constraint order order_neutron-openvswitch-agent_neutron-metadata-agent \
neutron-openvswitch-agent-clone:start neutron-metadata-agent-clone:start \
symmetrical=true
定義openstack-memcached-clone和openstack-nova-consoleauth-clone啟動
pcs constraint order order_memcached_nova-consoleauth \
openstack-memcached-clone:start openstack-nova-consoleauth-clone:start\
symmetrical=true
定義neutron-metadata-agent-clone和neutron-l3-agent-clone啟動
pcs constraint order order_neutron-metadata-agent_neutron-l3-agent \
neutron-metadata-agent-clone:start neutron-l3-agent-clone:start \
symmetrical=true