http://linux-vserver.org/index.php?title=Fail-over&feed=atom&action=historyFail-over - Revision history2024-03-28T21:24:52ZRevision history for this page on the wikiMediaWiki 1.20.2http://linux-vserver.org/index.php?title=Fail-over&diff=4909&oldid=prevGlenn: + Category:Documentation2011-10-21T19:33:03Z<p>+ <a href="/Category:Documentation" title="Category:Documentation">Category:Documentation</a></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 19:33, 21 October 2011</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 91:</td>
<td colspan="2" class="diff-lineno">Line 91:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Note the use of the Filesystem agent to mount your drbd device before starting your vserver.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Note the use of the Filesystem agent to mount your drbd device before starting your vserver.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[Category:Documentation]]</ins></div></td></tr>
</table>Glennhttp://linux-vserver.org/index.php?title=Fail-over&diff=3309&oldid=prev198.24.6.135: typos2008-09-26T13:54:44Z<p>typos</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 13:54, 26 September 2008</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Active VServer Failover ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Active VServer Failover ===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>To perform active vserver failover without user intervention from one host to another you may use heartbeat.  To do this, you must first have a mechanism to actively replicate your vserver filesystem and configuration from one host to another.  This mechanism must be able to provide a consistent filesystem view to either host on demand (but not <del class="diffchange diffchange-inline">neccessarily </del>at the same time).  In other words you may use something like NFS, a clustered filesystem like OCFS2 or GFS, or a network replicated block device like drbd, but you cannot use something like rsync, scp or ftp.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>To perform active vserver failover without user intervention from one host to another you may use heartbeat.  To do this, you must first have a mechanism to actively replicate your vserver filesystem and configuration from one host to another.  This mechanism must be able to provide a consistent filesystem view to either host on demand (but not <ins class="diffchange diffchange-inline">necessarily </ins>at the same time).  In other words you may use something like NFS, a clustered filesystem like OCFS2 or GFS, or a network replicated block device like drbd, but you cannot use something like rsync, scp or ftp.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===== Organizing your VServer Directories =====</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===== Organizing your VServer Directories =====</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 22:</td>
<td colspan="2" class="diff-lineno">Line 22:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  /var/lib/vservers/<server-name>  -> /vservers/<server-name>/barrier/var</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  /var/lib/vservers/<server-name>  -> /vservers/<server-name>/barrier/var</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>With this arrangement you could replicate the entire /vservers directory to all hosts and you will <del class="diffchange diffchange-inline">than </del>be able to run the vserver anywhere the /vservers directory is replicated.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>With this arrangement you could replicate the entire /vservers directory to all hosts and you will <ins class="diffchange diffchange-inline">then </ins>be able to run the vserver anywhere the /vservers directory is replicated.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>===== <del class="diffchange diffchange-inline">FileSystem </del>Fail Over =====</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>===== <ins class="diffchange diffchange-inline">Filesystem </ins>Fail Over =====</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Finally, you will need a mechanism to start and stop your vservers on the appropriate hosts.  This is where heartbeat comes in.  If you do not have a permanently mounted filesystem on each node, because maybe you are using a regular filesystem on top of a non-shared block device such as drbd, you will need to configure heartbeat to first provide the ''/vservers'' file system on the node which is going to be the active host.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Finally, you will need a mechanism to start and stop your vservers on the appropriate hosts.  This is where heartbeat comes in.  If you do not have a permanently mounted filesystem on each node, because maybe you are using a regular filesystem on top of a non-shared block device such as drbd, you will need to configure heartbeat to first provide the ''/vservers'' file system on the node which is going to be the active host.</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 30:</td>
<td colspan="2" class="diff-lineno">Line 30:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===== Multiple Vservers and Devices with DRBD 7 =====</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===== Multiple Vservers and Devices with DRBD 7 =====</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>If you have multiple <del class="diffchange diffchange-inline">Vservers </del>which you want to be able to fail over independently from one host to another with drbd 7 you might have a hard time doing this with heartbeat.  The drbd agent distributed with heartbeat tends to be focused on drbd 8, if you are using drbd 7 you are expected to be using heartbeat 1 which does not use ocf agents and does provide support for multiple independent drbd devices.  Instead, you may try this custom [http://www.theficks.name/bin/lib/ocf/drbd drbd ocf agent].  Here is a sample heartbeat configuration for use with this agent:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>If you have multiple <ins class="diffchange diffchange-inline">vservers </ins>which you want to be able to fail over independently from one host to another with drbd 7 you might have a hard time doing this with heartbeat.  The drbd agent distributed with heartbeat tends to be focused on drbd 8, if you are using drbd 7 you are expected to be using heartbeat 1 which does not use ocf agents and does provide support for multiple independent drbd devices.  Instead, you may try this custom [http://www.theficks.name/bin/lib/ocf/drbd drbd ocf agent].  Here is a sample heartbeat configuration for use with this agent:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <primitive id="vserver_foo_drbd" class="ocf" provider="bar" type="drbd"></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <primitive id="vserver_foo_drbd" class="ocf" provider="bar" type="drbd"></div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 46:</td>
<td colspan="2" class="diff-lineno">Line 46:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===== VServer Fail Over =====</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===== VServer Fail Over =====</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Once you have configured your filesystem for failover you can configure the vservers themselves for failover.  If you want to control more than one vserver with heartbeat, you may use the following [http://www.theficks.name/bin/lib/ocf/VServer vserver ocf agent] to do so.  Be sure to specify a colocation constraint between the filesystem and your vservers.  You will also need to specify an <del class="diffchange diffchange-inline">oderering </del>constraint to be sure that the filesystem is mounted before the vservers are started.  Here is a sample ocf vserver configuration for a vserver named ''foo'' and an ocf provider named ''bar'':</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Once you have configured your filesystem for failover you can configure the vservers themselves for failover.  If you want to control more than one vserver with heartbeat, you may use the following [http://www.theficks.name/bin/lib/ocf/VServer vserver ocf agent] to do so.  Be sure to specify a colocation constraint between the filesystem and your vservers.  You will also need to specify an <ins class="diffchange diffchange-inline">ordering </ins>constraint to be sure that the filesystem is mounted before the vservers are started.  Here is a sample ocf vserver configuration for a vserver named ''foo'' and an ocf provider named ''bar'':</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <primitive id="vserver_foo" class="ocf" type="VServer" provider="bar" restart_type="restart"></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <primitive id="vserver_foo" class="ocf" type="VServer" provider="bar" restart_type="restart"></div></td></tr>
</table>198.24.6.135http://linux-vserver.org/index.php?title=Fail-over&diff=2665&oldid=prev85.127.111.97: "concat" example hb config to ease c/p2007-08-17T09:25:06Z<p>"concat" example hb config to ease c/p</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 09:25, 17 August 2007</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 61:</td>
<td colspan="2" class="diff-lineno">Line 61:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <group id="vserver_aaa"></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <group id="vserver_aaa"></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <primitive id="vserver_foo_drbd" class="ocf" provider="bar" type="drbd"></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <primitive id="vserver_foo_drbd" class="ocf" provider="bar" type="drbd"></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>     <instance_attributes id="vserver_foo_drbd_ia"></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>     <instance_attributes id="vserver_foo_drbd_ia"></div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 69:</td>
<td colspan="2" class="diff-lineno">Line 69:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>     </instance_attributes></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>     </instance_attributes></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </primitive>     </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </primitive>     </div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <primitive id="vserver_foo_fs" class="ocf" provider="heartbeat" type="Filesystem"></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <primitive id="vserver_foo_fs" class="ocf" provider="heartbeat" type="Filesystem"></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>     <instance_attributes id="vserver_foo_fs_ia"></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>     <instance_attributes id="vserver_foo_fs_ia"></div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 79:</td>
<td colspan="2" class="diff-lineno">Line 79:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>     </instance_attributes></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>     </instance_attributes></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </primitive></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </primitive></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <primitive id="vserver_foo" class="ocf" type="VServer" provider="bar" restart_type="restart"></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <primitive id="vserver_foo" class="ocf" type="VServer" provider="bar" restart_type="restart"></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>     <instance_attributes id="vserver_foo_ia"></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>     <instance_attributes id="vserver_foo_ia"></div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 87:</td>
<td colspan="2" class="diff-lineno">Line 87:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>     </instance_attributes></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>     </instance_attributes></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </primitive></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   </primitive></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </group></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </group></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Note the use of the Filesystem agent to mount your drbd device before starting your vserver.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Note the use of the Filesystem agent to mount your drbd device before starting your vserver.</div></td></tr>
</table>85.127.111.97http://linux-vserver.org/index.php?title=Fail-over&diff=2384&oldid=prev84.35.81.146: /* Active VServer Failover */2007-03-09T09:02:15Z<p><span dir="auto"><span class="autocomment">Active VServer Failover</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 09:02, 9 March 2007</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Active VServer Failover ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Active VServer Failover ===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>To perform active vserver failover without user intervention from one host to another you may use heartbeat.  To do this, you must first have a mechanism to actively replicate your <del class="diffchange diffchange-inline">veserver </del>filesystem and configuration from one host to another.  This mechanism must be able to provide a consistent filesystem view to either host on demand (but not neccessarily at the same time).  In other words you may use something like NFS, a clustered filesystem like OCFS2 or GFS, or a network replicated block device like drbd, but you cannot use something like rsync, scp or ftp.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>To perform active vserver failover without user intervention from one host to another you may use heartbeat.  To do this, you must first have a mechanism to actively replicate your <ins class="diffchange diffchange-inline">vserver </ins>filesystem and configuration from one host to another.  This mechanism must be able to provide a consistent filesystem view to either host on demand (but not neccessarily at the same time).  In other words you may use something like NFS, a clustered filesystem like OCFS2 or GFS, or a network replicated block device like drbd, but you cannot use something like rsync, scp or ftp.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===== Organizing your VServer Directories =====</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>===== Organizing your VServer Directories =====</div></td></tr>
</table>84.35.81.146http://linux-vserver.org/index.php?title=Fail-over&diff=2372&oldid=prev68.167.189.55: /* Active Vserver Failover */2007-03-02T06:58:36Z<p><span dir="auto"><span class="autocomment">Active Vserver Failover</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 06:58, 2 March 2007</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>=== Active <del class="diffchange diffchange-inline">Vserver </del>Failover ===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== Active <ins class="diffchange diffchange-inline">VServer </ins>Failover ===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>To perform active vserver failover without user intervention from one host to another you may use heartbeat.  To do this, you must first have a mechanism to actively replicate your veserver filesystem and configuration from one host to another.  This mechanism must be able to provide a consistent filesystem view to either host on demand (but not neccessarily at the same time).  In other words you may use something like NFS, a clustered filesystem like OCFS2 or GFS, or a network replicated block device like drbd, but you cannot use something like rsync, scp or ftp.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>To perform active vserver failover without user intervention from one host to another you may use heartbeat.  To do this, you must first have a mechanism to actively replicate your veserver filesystem and configuration from one host to another.  This mechanism must be able to provide a consistent filesystem view to either host on demand (but not neccessarily at the same time).  In other words you may use something like NFS, a clustered filesystem like OCFS2 or GFS, or a network replicated block device like drbd, but you cannot use something like rsync, scp or ftp.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Once you have an active replication method, you will likely need to organize your vserver files to be on the same device/filesystem so that you only need one replicated device/filesystem and do not need a separate one just for your vserver configuration files.  One way to do this would be to use a ''/vservers'' mount point and to have a subdirectory for each vserver in there: ''/vservers/<server-name>''.  <del class="diffchange diffchange-inline">Since </del>you <del class="diffchange diffchange-inline">will </del>want to put both the ''/var'' and ''/etc'' sections of your vserver in the vserver's subdirectory and soft link to them<del class="diffchange diffchange-inline">, it will probably end up looking something like </del>this:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">===== Organizing your VServer Directories =====</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Once you have an active replication method, you will likely need to organize your vserver files to be on the same device/filesystem so that you only need one replicated device/filesystem and do not need a separate one just for your vserver configuration files.  One way to do this would be to use a ''/vservers'' mount point and to have a subdirectory for each vserver in there: ''/vservers/<server-name>''.  <ins class="diffchange diffchange-inline">If </ins>you want to put both the ''/var'' and ''/etc'' sections of your vserver in the vserver's subdirectory and soft link to them <ins class="diffchange diffchange-inline">you may be tempted to try </ins>this <ins class="diffchange diffchange-inline">arrangement</ins>:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  /vservers/<server-name>/etc</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  /vservers/<server-name>/etc</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 10:</td>
<td colspan="2" class="diff-lineno">Line 12:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  /etc/vservers/<server-name>      -> /vservers/<server-name>/etc</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  /etc/vservers/<server-name>      -> /vservers/<server-name>/etc</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  /var/lib/vservers/<server-name>  -> /vservers/<server-name>/var</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  /var/lib/vservers/<server-name>  -> /vservers/<server-name>/var</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">But if you do this and you enable the util-vserver init script, you are likely to run into a chroot barrier problem.  Since this init script sets a chroot barrier on all vservers' var directory's parent you will see something like this error message:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> vlimit: fstat("/etc/vservers/<server-name>/rlimits"): Permission denied</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">One workaround to this is to simply put the vserver's var directory into a subdirectory of the vserver's combined directory like this:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> /vservers/<server-name>/barrier/var</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> /var/lib/vservers/<server-name>  -> /vservers/<server-name>/barrier/var</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>With this arrangement you could replicate the entire /vservers directory to all hosts and you will than be able to run the vserver anywhere the /vservers directory is replicated.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>With this arrangement you could replicate the entire /vservers directory to all hosts and you will than be able to run the vserver anywhere the /vservers directory is replicated.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Finally, you will need a mechanism to start and stop your vservers on the appropriate hosts.  This is where heartbeat comes in.  If you do not have a permanently mounted filesystem on each node <del class="diffchange diffchange-inline">(</del>because you are using a non-shared block device such as drbd <del class="diffchange diffchange-inline">7</del>,<del class="diffchange diffchange-inline">) </del>you will need to configure heartbeat to first provide the ''/vservers'' file system on the node which is going to be the active host.  Once you have configured your filesystem for failover you can configure the vservers themselves for failover.  If you want to control more than one vserver with heartbeat, you may use the following <del class="diffchange diffchange-inline">vserver </del>[http://www.theficks.name/bin/lib/ocf/VServer ocf agent] to do so.  Be sure to specify a colocation constraint between the filesystem and your vservers.  You will also need to specify an oderering constraint to be sure that the filesystem is mounted before the vservers are started.  Here is a sample ocf vserver configuration for a vserver named ''foo'' and an ocf provider named ''bar'':</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">===== FileSystem Fail Over =====</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Finally, you will need a mechanism to start and stop your vservers on the appropriate hosts.  This is where heartbeat comes in.  If you do not have a permanently mounted filesystem on each node<ins class="diffchange diffchange-inline">, </ins>because <ins class="diffchange diffchange-inline">maybe </ins>you are using <ins class="diffchange diffchange-inline">a regular filesystem on top of </ins>a non-shared block device such as drbd, you will need to configure heartbeat to first provide the ''/vservers'' file system on the node which is going to be the active host<ins class="diffchange diffchange-inline">.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">===== Multiple Vservers and Devices with DRBD 7 =====</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">If you have multiple Vservers which you want to be able to fail over independently from one host to another with drbd 7 you might have a hard time doing this with heartbeat</ins>.  <ins class="diffchange diffchange-inline">The drbd agent distributed with heartbeat tends to be focused on drbd 8, if you are using drbd 7 you are expected to be using heartbeat 1 which does not use ocf agents and does provide support for multiple independent drbd devices.  Instead, you may try this custom [http://www.theficks.name/bin/lib/ocf/drbd drbd ocf agent].  Here is a sample heartbeat configuration for use with this agent:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> <primitive id="vserver_foo_drbd" class="ocf" provider="bar" type="drbd"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  <instance_attributes id="vserver_foo_drbd_ia"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    <attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">      <nvpair id="vserver_foo_drbd_resource" name="drbd_resource" value="vs_foo"/></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    </attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  </instance_attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </primitive></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">===== OCF Provider =====</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">The ''ocf provider'' is simply a fancy term for the directory name under ''/usr/lib/ocf/resource.d/'' where you place your ocf agent (script).  The ocf agents distributed with heartbeat are in the heartbeat subdirectory and therefor the provider for them is heartbeat.  If you are adding a custom agent, you can either put it in the same directory (heartbeat) and use the heartbeat provider, or you can create a new ''provider'' (bar in the examples) and a directory for that provider ''/usr/lib/ocf/resource.d/bar''.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">===== VServer Fail Over =====</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Once you have configured your filesystem for failover you can configure the vservers themselves for failover.  If you want to control more than one vserver with heartbeat, you may use the following [http://www.theficks.name/bin/lib/ocf/VServer <ins class="diffchange diffchange-inline">vserver </ins>ocf agent] to do so.  Be sure to specify a colocation constraint between the filesystem and your vservers.  You will also need to specify an oderering constraint to be sure that the filesystem is mounted before the vservers are started.  Here is a sample ocf vserver configuration for a vserver named ''foo'' and an ocf provider named ''bar'':</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> <primitive id="vserver_foo" class="ocf" type="VServer" provider="bar" restart_type="restart"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  <instance_attributes id="vserver_foo_ia"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    <attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">      <nvpair id="vserver_foo_name" name="vserver" value="foo"/></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    </attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  </instance_attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </primitive></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">===== Complete VServer DRBD Example Heartbeat Config =====</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">The simplest way to combine related resources in heartbeat is to use a group.  With a group you do not have to specify colocation and ordering constraints, they are implied.  To use the above DRBD and VServer ocf resource agents together in a group, your heartbeat configuration will look something like this:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> <group id="vserver_aaa"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  <primitive id="vserver_foo_drbd" class="ocf" provider="bar" type="drbd"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    <instance_attributes id="vserver_foo_drbd_ia"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">      <attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">        <nvpair id="vserver_foo_drbd_resource" name="drbd_resource" value="vs_foo"/></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">      </attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    </instance_attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  </primitive>    </ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  <primitive id="vserver_foo_fs" class="ocf" provider="heartbeat" type="Filesystem"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    <instance_attributes id="vserver_foo_fs_ia"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">      <attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">        <nvpair id="vserver_foo_fs_dev" name="device" value="/dev/drbd/vs_foo"/></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">        <nvpair id="vserver_foo_fs_mount" name="directory" value="/vservers/foo"/></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">        <nvpair id="vserver_foo_fs_type" name="fstype" value="ext3"/></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">      </attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    </instance_attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  </primitive></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  <primitive id="vserver_foo" class="ocf" type="VServer" provider="bar" restart_type="restart"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    <instance_attributes id="vserver_foo_ia"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">      <attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">        <nvpair id="vserver_foo_name" name="vserver" value="foo"/></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">      </attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">    </instance_attributes></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">  </primitive></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">    <primitive id="vserver_foo" class="ocf" type="VServer" provider="bar" restart_type="restart"></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins></<ins class="diffchange diffchange-inline">group</ins>></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">        <instance_attributes id="vserver_foo_ia"></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">          <attributes></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">            <nvpair id="vserver_foo_name" name="vserver" value="foo"/></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">          </attributes></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">        </instance_attributes></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">      </del></<del class="diffchange diffchange-inline">primitive</del>></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">The ''ocf provider'' is simply a fancy term for </del>the <del class="diffchange diffchange-inline">directory name under ''/usr/lib/ocf/resource.d/'' where you place your ocf agent.  The ocf agents distributed with heartbeat are in </del>the <del class="diffchange diffchange-inline">heartbeat subdirectory and therefor the provider for them is heartbeat</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Note </ins>the <ins class="diffchange diffchange-inline">use of </ins>the <ins class="diffchange diffchange-inline">Filesystem agent to mount your drbd device before starting your vserver</ins>.</div></td></tr>
</table>68.167.189.55http://linux-vserver.org/index.php?title=Fail-over&diff=2366&oldid=prev68.167.189.55: First draft2007-02-28T06:07:59Z<p>First draft</p>
<p><b>New page</b></p><div>=== Active Vserver Failover ===<br />
<br />
To perform active vserver failover without user intervention from one host to another you may use heartbeat. To do this, you must first have a mechanism to actively replicate your veserver filesystem and configuration from one host to another. This mechanism must be able to provide a consistent filesystem view to either host on demand (but not neccessarily at the same time). In other words you may use something like NFS, a clustered filesystem like OCFS2 or GFS, or a network replicated block device like drbd, but you cannot use something like rsync, scp or ftp.<br />
<br />
Once you have an active replication method, you will likely need to organize your vserver files to be on the same device/filesystem so that you only need one replicated device/filesystem and do not need a separate one just for your vserver configuration files. One way to do this would be to use a ''/vservers'' mount point and to have a subdirectory for each vserver in there: ''/vservers/<server-name>''. Since you will want to put both the ''/var'' and ''/etc'' sections of your vserver in the vserver's subdirectory and soft link to them, it will probably end up looking something like this:<br />
<br />
/vservers/<server-name>/etc<br />
/vservers/<server-name>/var<br />
<br />
/etc/vservers/<server-name> -> /vservers/<server-name>/etc<br />
/var/lib/vservers/<server-name> -> /vservers/<server-name>/var<br />
<br />
With this arrangement you could replicate the entire /vservers directory to all hosts and you will than be able to run the vserver anywhere the /vservers directory is replicated.<br />
<br />
Finally, you will need a mechanism to start and stop your vservers on the appropriate hosts. This is where heartbeat comes in. If you do not have a permanently mounted filesystem on each node (because you are using a non-shared block device such as drbd 7,) you will need to configure heartbeat to first provide the ''/vservers'' file system on the node which is going to be the active host. Once you have configured your filesystem for failover you can configure the vservers themselves for failover. If you want to control more than one vserver with heartbeat, you may use the following vserver [http://www.theficks.name/bin/lib/ocf/VServer ocf agent] to do so. Be sure to specify a colocation constraint between the filesystem and your vservers. You will also need to specify an oderering constraint to be sure that the filesystem is mounted before the vservers are started. Here is a sample ocf vserver configuration for a vserver named ''foo'' and an ocf provider named ''bar'':<br />
<br />
<primitive id="vserver_foo" class="ocf" type="VServer" provider="bar" restart_type="restart"><br />
<instance_attributes id="vserver_foo_ia"><br />
<attributes><br />
<nvpair id="vserver_foo_name" name="vserver" value="foo"/><br />
</attributes><br />
</instance_attributes><br />
</primitive><br />
<br />
The ''ocf provider'' is simply a fancy term for the directory name under ''/usr/lib/ocf/resource.d/'' where you place your ocf agent. The ocf agents distributed with heartbeat are in the heartbeat subdirectory and therefor the provider for them is heartbeat.</div>68.167.189.55