我试图configuration一个configuration文件的起搏器(我可以自动生成,然后要求起搏器“重新加载”)。 但是我所看到的所有例子都是针对命令行命令或交互式编辑器的。 (我正在运行Ubuntu)。
命令行方法是这样的 :
crm configure primitive VIP ocf:IPaddr2 params ip=10.0.2.200 nic=eth0 op monitor interval=10s
虽然交互模式是这样的 :
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
但我想要一个静态configuration文件,我可以更新和重新加载。 像心跳使用的/etc/ha.d/haresources文件。 这是可能吗?
当然。 使用您在示例命令中使用的相同语法创build一个configuration文件(在本例中名为“cib.txt”):
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
然后您可以使用以下CRM shell命令加载该文件:
# crm configure load update cib.txt
或完全replaceconfiguration:
# crm configure load replace cib.txt
注:您可以使用以下命令从集群中导出configuration,以用于新集群或用于备份目的:
# crm configure show > cib.txt
警告:如果你打算把它加载到其他地方(节点ID,DC版本,last-lrm-refresh等),一定要删除特定于原始群集的任何东西。