How to split a database backend.
Purpose
This procedure describes how to take a backend database with multiple VOs in it, and remove a single VO from it. putting the VO into its own database account.
Roles
This procedure is for LFC Administrators.
Required Information and Materials
Field |
Purpose |
Account name of current DB backend |
To be communicated to DB Team |
Proposed account name and password of new DB backend |
To be communicated to DB Team |
Alias name of the VO that is to be moved |
To know which daemons to shut down |
passwordfile for SINDES |
To update with the new NSCONFIG details |
Referred Documents
Preparations
- Before starting the procedure, you need to get a new database account created. To do this, contact physics-database.support@cernNOSPAMPLEASE.ch and ask for a new account to be created on the LCG RAC. Also request that they will need to make a backup of the current DB backend, and apply it to the new database account during the intervention.
- Once you have the new database account, you need to do the following:
- setup the password on the new account using
sqlplus
- update the SINDES config file with the new account details, and upload into SINDES. You will need a FIO person for this if you don't have a copy of the
lfcNSCONFIG.tar.gz
to work from.
sindes-upload-file -f lfcNSCONFIG.tar.gz -i lfcNSCONFIG --target gridlfc -S sindes-server -s cluster
- You should announce the intervention via the EGEE Broadcast system.
Activities
For the intervention:
- Identify the nodes for the VO to be moved, and use
sms
to put them into maintenance.
- Stop the lfcdaemons for the VO to be moved.
- Ask the DB team to take the hot backup, and apply it to the new account.
- Run the SINDES NCM component to get the new NSCONFIG (check it in /opt/lcg/etc)
[root@lfc002 root]# ncm-ncd --co sindes
[INFO] NCM-NCD version 1.2.3 started by root at: Wed Aug 30 09:41:33 2006
[INFO] executing configure on components....
[INFO] running component: sindes
---------------------------------------------------------
[INFO] Using cache
[INFO] SINDES won't download grid-host-certificates, HTTP server return NOT MODIFIED since Sun, 28 May 2006 19:50:40 GMT
[INFO] SINDES won't download group-header, HTTP server return NOT MODIFIED since Tue, 25 Apr 2006 12:37:43 GMT
[OK] SINDES downloaded lfcNSCONFIG successfully
[OK] SINDES configured lfcNSCONFIG successfully
[INFO] SINDES won't download passwd-header, HTTP server return NOT MODIFIED since Wed, 23 Aug 2006 08:59:27 GMT
[INFO] SINDES won't download snmpd_passwd, HTTP server return NOT MODIFIED since Wed, 16 Aug 2006 10:44:30 GMT
[INFO] configure on component sindes executed, 0 errors, 0 warnings
=========================================================
After the intervention, you need to clean up the entries from the two catalogs. To do this, run the following SQL. This lists all the entries of the form
/grid/
.
select fileid, name, nlink from Cns_file_metadata where parent_fileid =
(select fileid from Cns_file_metadata where parent_fileid =
(select fileid from Cns_file_metadata
where parent_fileid = 0 and name ='/'));
Now, Now find the fileid for the VO you want to remove in this list and fill it into the
var FID
line below. Then run the following SQL which deletes all the entries in the tables related to this VO.
--
-- find the fileid from above that you want to delete,
-- fill in here, and then run the rest.
--
var FID = XXXXXXX;
delete from Cns_user_metadata where u_fileid in
(select fileid from Cns_file_metadata start with parent_fileid = :FID
connect by prior fileid = parent_fileid );
delete from Cns_file_replica where fileid in
(select fileid from Cns_file_metadata start with parent_fileid = :FID
connect by prior fileid = parent_fileid );
commit;
delete from Cns_symlinks where fileid in
(select fileid from Cns_file_metadata start with parent_fileid = :FID
connect by prior fileid = parent_fileid);
commit;
delete from Cns_file_metadata where fileid in
(select fileid from Cns_file_metadata start with parent_fileid = :FID
connect by prior fileid = parent_fileid);
update Cns_file_metadata set nlink = 0 where fileid = :FID;
commit;
Repeat for each VO to be removed.
Checking Completion
Use the LFC CLI tools to check the right entries are in the right databases.
[root@lxb1132 root]# export LFC_HOST=lxb1132
[root@lxb1132 root]# /opt/lcg/bin/lfc-ls /grid
atlas
cms
ops
After Completion
Error |
Action |
any |
CAll LFC Expert |