Collapse AllExpand All

Synchronizing Configuration in Eucalyptus HA

This section provides guidance on how to keep configuration files sychronized between Eucalyptus HA component pairs. The csync2 utility can be used to achieve this, it's designed to keep configuration consistent between systems in large clusters. Two standalone Walrus systems assumed to be in HA are used in the following example.
High Availability
High Availability
Only perform these steps between HA pairs containing the same components to ensure the configuration matches. For assistance in implementing more advanced tasks the csync2 man pages should be consulted directly.
Note
Note
Completion of this section is optional. You may also wish to expand on this example and generate your own more complex configurations for other components, adding more groups and including additional files in the sychronization tasks.

  1. Install the csync2 utility via the EPEL repository on both systems:
    yum -y install csync2
  2. On the primary system, generate a pre-shared key for the hosts you wish to sync:
    csync2 -k /etc/csync2/eucalyptus.key
  3. On the primary system edit the /etc/csync2/csync2.cfg configuration file to create the synchronization template. Use the one below as an example, creating a group for your two Walrus hosts and adding the eucalyptus and drbd configuration files. Replace the host lines below with the full hostnames of your Walrus systems:
    				group eucalyptus {
    				host euca-walrus-ha-1; 
    				host euca-walrus-ha-2;
    				key /etc/csync2/eucalyptus.key; 
    				include /etc/csync2/csync2.cfg; 
    				include /etc/eucalyptus/eucalyptus.conf; 
    				include /etc/eucalyptus/drbd.conf; 
    				include /etc/drbd.conf; 
    				}
    		      
  4. Copy the base configuration file and pre-shared key generated earlier to the secondary Walrus server:
    scp /etc/csync2/csync2.cfg /etc/csync2/eucalyptus.key euca-walrus-ha-2:/etc/csync2/
  5. Next, ensure the csync2 service and xinetd are set to start at boot on both Walrus systems:
    		chkconfig csync2 on 
    		chkconfig xinetd on
    		service xinetd restart
    		
  6. Next, perform a dry-run sync to check for proposed changes. Run this on your primary Walrus.
    csync2 -xvd
  7. If you are happy with the proposed changes, go ahead and perform the sync.
    csync2 -xv
  8. With the initial synchronization complete, a periodic compare and sync could be run via a cronjob which runs the csync2 utility every 5 minutes. In the future, changes can be made to the synchronized files on your primary Walrus and these would be propogated to the other system by the cronjob. Add the following to /etc/cron.d/csync2 as root on the primary Walrus:
    */5 * * * * root csync2 -x