411 and FE data synchronization

Now the next step is to synchronize account management and important data between Frontend. The idea is

  1. User can be added on any frontend
  2. “rocks sync users” will also synchronize account information on FE and also to other compute nodes

To achieve 2, we will now create a special custom command to synchronize important data between FE. I will call this command “rocks sync frontend”.

Synchronize Frontend data

Rocks sync frontend command

  • On both FE, create a directory named “frontend” at Rocks python library dir

mkdir -p /opt/rocks/lib/python2.4/site-packages/rocks/commands/sync/frontend

  • Now copy the init.py file to that directory.

  • Edit /opt/rocks/lib/python2.4/site-packages/rocks/commands/sync/frontend/init.py and add/remove entry in file_list as you like, but I would suggest to leave it like this for now

    • key mean the destination directory
    • value contains list of file to be copied to that directory
    • The command use “rsync” command to copy file. Since we already use the same SSH private key on both FE, so the command will succeed without password prompt.
  • Try the “rocks sync frontend”, it should synchronize account information along with some other important files to another frontend. This command should be run on FE with most updated content only.
  • You can also run “rocks sync frontend db=yes” to synchronize database to 2nd Frontend. You will need to type your MySQL password once. Usually database synchronization should be needed only if you modify your cluster (add/remove node).

Plug-in for rocks sync users command

To make life easier, let’s add plug-in to rocks sync users command so it synchronize frontend data automatically between frontend.

  • Download and place this plugin_sync_frontend.py to /opt/rocks/lib/python2.4/site-packages/rocks/commands/sync/users
  • Try ‘rocks sync users’, rocks sync frontend will be called automatically.

411

411 on Frontends

  • Synchronize /etc/411-security between both FE

scp /etc/411-security/* fe2:/etc/411-security

Beware! now both FE1 and FE2 can distribute your account information (/etc/passwd, etc..). Make sure that both FE has the same account information for now.

411 on Client

411 already support dual master with weighting. Edit extend-client.xml again and add the following snippet

<file name=”/etc/411.conf”>

&lt;config&gt;

&lt;master url=”http://172.16.0.2/411.d/” score=”100” /&gt;

&lt;master url=”http://172.16.0.3/411.d/” score=”50” /&gt;

&lt;group&gt;&lt;var name=’Node_Membership’/&gt;&lt;/group&gt;

&lt;/config&gt;

</file>

If you just hand-edit /etc/411.conf, restart greceptor on compute nodes. Or the better way is to reinstall compute nodes again.

tentakel -g compute /boot/kickstart/cluster-kickstart

Testing

Try adding a user and see if it appears properly on compute nodes. Also try this on 2nd FE, see if the change being propagated.