Posts tagged ‘CentoOS’

Configure Resource on LVS cluster

To add an ip resource who's a member of group "ip_group" create an xml file :

XML:
  1. <group id="group_vips">
  2.  <primitive id="vip_1" class="ocf" type="IPaddr2" provider="heartbeat">
  3.  <instance_attributes id="vip_170_instance_attrs">
  4.   <attributes>
  5.    <nvpair id="vip_1_ip" name="ip" value="192.168.1.1"/>
  6.    <nvpair id="vip_1_nic" name="nic" value="eth0"/>
  7.    <nvpair id="vip_1_netmask" name="netmask" value="255.244.255.0"/>
  8.  </attributes>         
  9.   </instance_attributes>         
  10. <meta_attributes id="vip_1_meta_attrs">           
  11. <attributes>             
  12. <nvpair id="vip_1_metaattr_resource_stickiness" name="resource_stickiness"  value="INFINITY"/>
  13. <nvpair id="vip_1_metaattr_target_role" name="target_role" value="started"/>                   </attributes>   
  14. </meta_attributes>
  15. </primitive>
  16. </group>

import the resource using :

CODE:
  1. cibadmin -V -M -o resources -x file.xml


( note you are using -M to modify the existing group ... )
delete the resource :

CODE:
  1. cibadmin -V -D -o resources -X' <primitive id="vip_1"/>'