MAN07 VOMS Replication

From EGIWiki
Jump to: navigation, search
Main operations services Support Documentation Tools Activities Performance Technology Catch-all Services Resource Allocation Security

Documentation menu: Home Manuals Procedures Training Other Contact For: VO managers Administrators

Title VOMS Replication
Document link
Last modified 19 August 2014
Policy Group Acronym OMB
Policy Group Name Operations Management Board
Contact Group
Document Status Approved
Approved Date
Procedure Statement This manual provides information on how to implement a MySQL VOMS server replication.
Owner Owner of procedure


In this manual we will show you how to implement a MySQL VOMS server replication: you need one master server, on which you can perform writing operations, and you can have from 1 to "n" replica servers that will work in read-only mode. In such a scenario you can do a whatever intervention on one of the servers without breaking the service, i.e. proxies creation and grid-mapfile downloads: just the users registration and the usual VOs management operations might be forbidden during an intervention on the master server (because it is the only server in writing mode).

This failover procedure is simply based on mysql replication therefore every mysql setting is referred to the current mysql version (5.0.77 in this moment)

Settings on the MASTER SERVER

In order to allow the replica server to read the master database, you have to create an user with which the slave will connect to the master. Suppose the replica hostname is, the user is bonjovi and the password is always: what you have to launch on the master server is

mysql -p -e "grant super, reload , replication slave, replication client on *.* to bonjovi@'' identified by 'always'" ;

Then for each DB (VO) you want to replicate, you have to assign the right permissions, by launching:

mysql -p -e "grant select, lock tables on voms_myvo.* to bonjovi@''"

Eventually you have to modify the file /etc/my.cnf by adding the following lines into the section "[mysqld]":


It is important that on the master server it is set "server-id=1": it is the identification number that distinguish a master from its several slaves (each slave will have a unique number starting from 2)

For example, the content of my.cnf file may appear like this:

# less /etc/my.cnf 
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).

max_connections = 800
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0


At this point, you have to restart mysql, by launching:

service mysqld restart

In order to check that on the master side the mechanism is working, you can launch for example:

mysql> show master status;
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
| mysql-bin.000001 |    24844 |              |                  | 
1 row in set (0.00 sec)

Eventually, through the web interface, in the ACL section of each VO you want to replicate, add an entry granting all the permissions to the slave server:

  • select "a non VO member" from the menu
  • fill in the replica server DN and a reference email address
  • select "all" for the permissions and tick the "Propagate entry to children contexts" option

In this way, when the slave server copies the DB, it will have the proper permissions on acting on the DB. Morover, in order to avoid the sending of notification to the email address you filled in before, connect to the mysql DB and do the following:

mysql> use voms_myvo;
mysql> update admins set email_address=NULL where email_address="what you filled before";

Settings on the SLAVE SERVER

Install a VOMS server as usual, configuring the VOs you want to replicate: keep in mind that every modification done on the slave DB breaks the replica mechanism, so that on this server disable the users registration, by setting the yaim variable


and therefore ask the VO managers to not perform any action on the slave server web interface.

Then launch the following scripts:

  • for the first database you want to replicate or in the case it is the only one
  • for the next databases (one database for each launch)

For both the scripts, set the following variables:

  • master_host, master_mysql_user, master_mysql_pwd that refers to the master server and to the user created on it
  • mysql_username_admin e mysql_password_admin that refers to the slave


voms_database=""                                    # VOMS database (leave unset)
master_host=""                     # Master hostname
master_mysql_user="bonjovi"                         # Master MySQL admin user for replication
master_mysql_pwd="always"                           # Master MySQL admin pass for replication user
master_log_file=""                                  # Master LOG file (leave unset)
master_log_pos=""                                   # Master LOG file (leave unset)
mysql_username_admin="root"                         # Slave MySQL admin username
mysql_password_admin="secret"                       # Slave MySQL admin pass

with the launch of, the file /etc/my.cnf will be properly written; if you need to replicate further databases, modify /etc/my.cnf adding the following lines related to the db you are replicating (similar to the first db you've replicated):


Having set the variables in the way shown above, for replicating the first database the scripts launch syntax is the following:

./ --master-db=voms_myvo --db=voms_myvo

In your /etc/my.cnf file you will find lines like the following:

# Connection with master

# Replicas settings

now you may want to replicate a second database, let's say voms_hervo: therefore in my.cnf file add the following lines:


modify the script in according to the VO parameters and launch it:

./ --master-db=voms_hervo --db=voms_hervo

when you finished to replicate all the desired VOs, in order to make active the database modifications, restart voms and voms-admin:

/etc/init.d/voms-admin stop
/etc/init.d/voms stop
/etc/init.d/voms start
/etc/init.d/voms-admin start

Keep in mind that every modification done on the slave DB breaks the replica mechanism, so that on this server disable the users registration, by setting the yaim variable:


and ask the VO managers to not perform any action on the slave server web interface

Revision History

Version Authors Date Comments
1.0 Alessandro Paolini 2011-10-14 First Draft
M. Krakowian 19 August 2014 Change contact group -> Operations support