MAN07 VOMS Replication
Introduction
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 verions (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 vomsrep.cnaf.infn.it, 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@'vomsrep.cnaf.infn.it' 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@'vomsrep.cnaf.infn.it'"
Eventually you have to modify the file /etc/my.cnf by adding the following lines into the sction "[mysqld]":
log-bin=mysql-bin server-id=1 innodb_flush_log_at_trx_commit=1 sync_binlog=1
For example, the content of my.cnf file may appear like this:
# less /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 max_connections = 800 log-bin=mysql-bin server-id=1 innodb_flush_log_at_trx_commit=1 sync_binlog=1 # Disabling symbolic-links is recommended to prevent assorted security risks; # to do so, uncomment this line: # symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
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:
mysql> show master status; +------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +------------------+----------+--------------+------------------+ | mysql-bin.000001 | 24844 | | | +------------------+----------+--------------+------------------+ 1 row in set (0.00 sec)
Settings on the SLAVE SERVER
Install a VOMS server as usual, configuring the VOs you want to replicate