Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > fd1445e4ec50ea0254985a386bb83a07 > files > 259

pacemaker-doc-1.1.1-1.fc13.i686.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>2.3. How Should the Configuration be Updated?</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css" /><meta name="generator" content="publican 1.6" /><meta name="package" content="Pacemaker-Pacemaker_Explained-1.1-en-US-1-0" /><link rel="home" href="index.html" title="Configuration Explained" /><link rel="up" href="ch-basics.html" title="Chapter 2. Configuration Basics" /><link rel="prev" href="s-cluster-status.html" title="2.2. The Current State of the Cluster" /><link rel="next" href="s-config-delete.html" title="2.4. Quickly Deleting Part of the Configuration" /></head><body class=""><p id="title"><a class="left" href="https://fedorahosted.org/publican"><img src="Common_Content/images/image_left.png" alt="Product Site" /></a><a class="right" href="https://fedorahosted.org/publican"><img src="Common_Content/images/image_right.png" alt="Documentation Site" /></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="s-cluster-status.html"><strong>Prev</strong></a></li><li class="next"><a accesskey="n" href="s-config-delete.html"><strong>Next</strong></a></li></ul><div class="section" title="2.3. How Should the Configuration be Updated?"><div class="titlepage"><div><div><h2 class="title" id="s-config-updates">2.3. How Should the Configuration be Updated?</h2></div></div></div><div class="para">
			There are three basic rules for updating the cluster configuration:
		</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
					Rule 1 - Never edit the cib.xml file manually. Ever. I'm not making this up.
				</div></li><li class="listitem"><div class="para">
					Rule 2 - Read Rule 1 again.
				</div></li><li class="listitem"><div class="para">
					Rule 3 - The cluster will notice if you ignored rules 1 &amp; 2 and refuse to use the configuration.
				</div></li></ul></div><div class="para">
			Now that it is clear how NOT to update the configuration, we can begin to explain how you should.
		</div><div class="para">
			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.
		</div><div class="para">
			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.
		</div><div class="figure" id="fig-config-editor"><div class="figure-contents"><pre class="programlisting">
  <code class="command">cibadmin --query &gt; tmp.xml</code>
  <code class="command">vi tmp.xml</code>
  <code class="command">cibadmin --replace --xml-file tmp.xml</code>
</pre></div><h6>Figure 2.3. Safely using an editor to modify the cluster configuration</h6></div><br class="figure-break" /><div class="para">
			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.
		</div><div class="para">
			If you only wanted to modify the resources section, you could instead do
		</div><div class="figure" id="fig-config-replace"><div class="figure-contents"><pre class="programlisting">
  <code class="command">cibadmin --query --obj_type resources &gt; tmp.xml</code>
  <code class="command">vi tmp.xml</code>
  <code class="command">cibadmin --replace --obj_type resources --xml-file tmp.xml</code>
</pre></div><h6>Figure 2.4. Safely using an editor to modify a subsection of the cluster configuration</h6></div><br class="figure-break" /><div class="para">
			to avoid modifying any other part of the configuration.
		</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="s-cluster-status.html"><strong>Prev</strong>2.2. The Current State of the Cluster</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="s-config-delete.html"><strong>Next</strong>2.4. Quickly Deleting Part of the Configuration</a></li></ul></body></html>