Product SiteDocumentation Site

2.3. How Should the Configuration be Updated?

There are three basic rules for updating the cluster configuration:
Now that it is clear how NOT to update the configuration, we can begin to explain how you should.
The most powerful tool for modifying the configuration is the cibadmin command which talks to a running cluster. With cibadmin, the user can query, add, remove, update or replace any part of the configuration and all changes take effect immediately so there is no need to perform a reload-like operation.
The simplest way of using cibadmin is to us it to save the current configuration to a temporary file, edit that file with your favorite text or XML editor and then upload the revised configuration.
  cibadmin --query > tmp.xml
  vi tmp.xml
  cibadmin --replace --xml-file tmp.xml
Figure 2.3. Safely using an editor to modify the cluster configuration

Some of the better XML editors can make use of a Relax NG schema to help make sure any changes you make are valid. The schema describing the configuration can normally be found in /usr/lib/heartbeat/pacemaker.rng on most systems.
If you only wanted to modify the resources section, you could instead do
  cibadmin --query --obj_type resources > tmp.xml
  vi tmp.xml
  cibadmin --replace --obj_type resources --xml-file tmp.xml
Figure 2.4. Safely using an editor to modify a subsection of the cluster configuration

to avoid modifying any other part of the configuration.