天天看点

pacemaker的启动脚本启动脚本pacemaker所管理的网卡,网桥的配置文件haproxy的配置文件总结一下上面的步骤: Is it possible to configure pacemaker with a configuration file?

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所管理的网卡,网桥的配置文件haproxy的配置文件总结一下上面的步骤: Is it possible to configure pacemaker with a configuration file?

pacemaker所管理的网卡,网桥的配置文件

pacemaker所管理的网桥的相关信息放在了: /sys/class/net/

并且这个目录下的虚IP的相关的文件是pacemaker在启动的时候动态生成的。

pacemaker的启动脚本启动脚本pacemaker所管理的网卡,网桥的配置文件haproxy的配置文件总结一下上面的步骤: Is it possible to configure pacemaker with a configuration file?

haproxy的配置文件

注意:如果修改了hostname,这里也要做相应的修改

/etc/haproxy/conf.d

[email protected]:/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           
[email protected]:/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

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Is it possible to configure pacemaker with a configuration file?

up vote 1 down vote favorite

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?

pacemaker  corosync

share improve this question asked  Dec 11 '14 at 12:50
pacemaker的启动脚本启动脚本pacemaker所管理的网卡,网桥的配置文件haproxy的配置文件总结一下上面的步骤: Is it possible to configure pacemaker with a configuration file?
moomima 107 1 1 7
add a comment

1 Answer

active oldest votes

up vote 3 down vote accepted 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).
share improve this answer edited Dec 18 '14 at 6:30 answered  Dec 11 '14 at 19:57
pacemaker的启动脚本启动脚本pacemaker所管理的网卡,网桥的配置文件haproxy的配置文件总结一下上面的步骤: Is it possible to configure pacemaker with a configuration file?
Matt Kereczman 605 3 8
Awesome! All three commands that you explained are great! –  moomima  Dec 12 '14 at 13:48
This only works for pacemaker < 1.1.18, there is no "crm" now. –  kubanczyk  Jun 8 '15 at 10:14
'crmsh' (the crm shell) used to be a part of Pacemaker, but was split into it's own project long ago. You can still get from here if you prefer it: crmsh.github.io –  Matt Kereczman  Jun 9 '15 at 16:43
Is there a a version of this command for the newer management shell? cman, pcs? –  FreeSoftwareServers Jun 12 at 19:19
Or could I load crmsh, and just use it for this purpose? –  FreeSoftwareServers  Jun 12 at 19:19
You can install and use both crmsh and pcs to manage your Pacemaker config without causing issues. SUSE packages crmsh for the more popular distros here: software.opensuse.org/… –  Matt Kereczman  Jun 13 at 4:17

继续阅读