http://blog.51yip.com/server/1680.html
http://serverfault.com/questions/651849/is-it-possible-to-configure-pacemaker-with-a-configuration-file(如何从导出cib供另一个集群使用)
启动脚本
启动脚本都放在了/uer/lib/ocf/resource.d下面。
如果全用的fuel安装的openstack,启动脚本在/usr/lib/ocf/resource.d/fuel下面。

pacemaker所管理的网卡,网桥的配置文件
pacemaker所管理的网桥的相关信息放在了: /sys/class/net/
并且这个目录下的虚IP的相关的文件是pacemaker在启动的时候动态生成的。

haproxy的配置文件
注意:如果修改了hostname,这里也要做相应的修改
/etc/haproxy/conf.d
root@node-378:/etc/haproxy/conf.d# ls
010-stats.cfg 030-keystone-2.cfg 070-cinder-api.cfg 110-mysqld.cfg 161-heat-api-cfn.cfg
015-horizon.cfg 040-nova-api-1.cfg 080-glance-api.cfg 120-swift.cfg 162-heat-api-cloudwatch.cfg
017-horizon-ssl.cfg 050-nova-api-2.cfg 085-neutron.cfg 140-ceilometer.cfg 170-nova-novncproxy.cfg
020-keystone-1.cfg 060-nova-metadata-api.cfg 090-glance-registry.cfg 160-heat-api.cfg
root@jeguan-ctrl-0:/var/lib/pacemaker# ls
blackbox cib cores crm lrm pengine
上面修改完成后,执行rm /var/lib/pacemaker/cib/*
然后重新上传resource: crm configure upload replace cib_backup.txt
其中:cib_backup.txt可以用下面命令从另一个环境中得到crm configure show > cib_backup.txt.
在执行replace前要记得把cib_backup.txt中与环境相关的特殊配置改成自己的。
注:crm相关配置
/etc/crm/crm.conf
总结一下上面的步骤:
1. 修改各个host上的/etc/hosts中的controller的名字
2. 修改controller结点的hostname
3. rm /var/lib/pacemaker/cib/*
4. 修改haproxy中的配置文件:/etc/haproxy/confi.d/*
5. crm configure load update cib_backup.txt.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
http://serverfault.com/questions/651849/is-it-possible-to-configure-pacemaker-with-a-configuration-file
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
I'm trying to configure pacemaker with a config file (that I can automatically generate and then ask pacemaker to "reload"). But all the examples that I see are for command-line commands or the interactive editor. (I'm running Ubuntu).
The command-line approach is something like this:
crm configure primitive VIP ocf:IPaddr2 params ip=10.0.2.200 nic=eth0 op monitor interval=10s
While the interactive mode is something like this:
sudo crm configure
And then we add the res_ip resource:
crm(live)configure# primitive res_ip ocf:heartbeat:IPaddr2 params ip="102.169.122.254" cidr_netmask="24" nic="eth0"
crm(live)configure# commit
crm(live)configure# exit
But I want a static config file that I can update and reload. Something like the /etc/ha.d/haresources file that heartbeat uses. Is that a possibility?
|
asked
Dec 11 '14 at 12:50
|
|
|
|
|
Definitely. Create a configuration file (named 'cib.txt', in our example) with the same syntax you've used in your example commands:
primitive VIP ocf:heartbeat:IPaddr2 params ip=10.0.2.200 nic=eth0 \
op monitor interval=10s timeout=20s \
op start interval=0 timeout=20s \
op stop interval=0 timeout=20s
Then you can load that file using the following CRM shell command:
# crm configure load update cib.txt
or completely replace the configuration:
# crm configure load replace cib.txt
NOTE: You can export the configuration from a cluster, for use on a new cluster or for backup purposes, with the following command:
# crm configure show > cib.txt
WARN: Be sure to cut out anything specific to the original cluster if you intend to load it elsewhere (node id's, dc-version, last-lrm-refresh, etc).
|
|
answered
Dec 11 '14 at 19:57
| |
|
|