Difference between revisions of "Shared memory for Ldap 5.x"

(Created page with "To setup SHM keys : 1. Calculate and set kernel.shmall and kernel.shmmax (you already have detailed steps for this from the wiki) 2. ldap stop 3. /opt/zimbra/sleepycat/bin/db_r...")
 
Line 2: Line 2:
  
 
1. Calculate and set kernel.shmall and kernel.shmmax  (you already have detailed steps for this from the wiki)
 
1. Calculate and set kernel.shmall and kernel.shmmax  (you already have detailed steps for this from the wiki)
 +
 
2. ldap stop
 
2. ldap stop
3. /opt/zimbra/sleepycat/bin/db_recover -c -h /opt/zimbra/openldap-data/
+
 
 +
3. Remove existing cache files
 +
  /opt/zimbra/sleepycat/bin/db_recover -c -h /opt/zimbra/openldap-data/
 
   This is being done to clear current MMAP files, so that if and when you roll back you have a clean slate.
 
   This is being done to clear current MMAP files, so that if and when you roll back you have a clean slate.
 +
 
3.5 Confirm whether "/opt/zimbra/openldap-data" and  __db.* is deleted.
 
3.5 Confirm whether "/opt/zimbra/openldap-data" and  __db.* is deleted.
 +
 
4. Set the shared memory keys in /opt/zimbra/conf/slapd.conf.in
 
4. Set the shared memory keys in /opt/zimbra/conf/slapd.conf.in
#shmkey
+
  #shmkey
shm_key 5
+
  shm_key 5.
 +
 
 
5. Start ldap.
 
5. Start ldap.
 +
 
6. Verify if memory keys are being used:
 
6. Verify if memory keys are being used:
ipcs -mp  (the column CPID is the process ID which is using the shared memory referenced by the key which was set up in step 6)
+
  ipcs -mp  (the column CPID is the process ID which is using the shared memory referenced by the key which was set up in step 6)
  
Only change in the above from before, is the addition of db_recover before setting the shm keys. This is to ensure we delete the cache files before changing the config.
 
  
 +
To Roll back to MMAP :
  
To Roll back to MMAP :
+
1. ldap stop.
 +
 
 +
2. Remove the cache files
 +
  /opt/zimbra/sleepycat/bin/db_recover -c -h /opt/zimbra/openldap-data/  (this should delete the bdb cache files)
  
1. ldap stop
 
2. /opt/zimbra/sleepycat/bin/db_recover -c -h
 
/opt/zimbra/openldap-data/  (this should delete the bdb cache files)
 
 
3. ipcrm [ -M key or -m id ] (to delete files from memory, at this point rebooting should also clear the memory files)******
 
3. ipcrm [ -M key or -m id ] (to delete files from memory, at this point rebooting should also clear the memory files)******
      Skip this if the file has already been removed, but please confirm using ipcs -m or ipcs -mp to check if the memory keys have been removed. If not then user ipcrm to manually delete the shm keys
+
  Skip this if the file has already been removed, but please confirm using ipcs -m or ipcs -mp to check if the memory keys have been removed. If not then user ipcrm to manually delete the shm keys.
4. update config to comment/remove shm keys configuration
+
 
5. start ldap (this should now be using the MMAP files)
+
4. update config to comment/remove shm keys configuration.
 +
 
 +
5. start ldap (this should now be using the MMAP files).

Revision as of 12:04, 9 July 2012

To setup SHM keys :

1. Calculate and set kernel.shmall and kernel.shmmax (you already have detailed steps for this from the wiki)

2. ldap stop

3. Remove existing cache files

  /opt/zimbra/sleepycat/bin/db_recover -c -h /opt/zimbra/openldap-data/
  This is being done to clear current MMAP files, so that if and when you roll back you have a clean slate.

3.5 Confirm whether "/opt/zimbra/openldap-data" and __db.* is deleted.

4. Set the shared memory keys in /opt/zimbra/conf/slapd.conf.in

  #shmkey
  shm_key 5.

5. Start ldap.

6. Verify if memory keys are being used:

  ipcs -mp  (the column CPID is the process ID which is using the shared memory referenced by the key which was set up in step 6)


To Roll back to MMAP :

1. ldap stop.

2. Remove the cache files

  /opt/zimbra/sleepycat/bin/db_recover -c -h /opt/zimbra/openldap-data/  (this should delete the bdb cache files)

3. ipcrm [ -M key or -m id ] (to delete files from memory, at this point rebooting should also clear the memory files)******

  Skip this if the file has already been removed, but please confirm using ipcs -m or ipcs -mp to check if the memory keys have been removed. If not then user ipcrm to manually delete the shm keys.

4. update config to comment/remove shm keys configuration.

5. start ldap (this should now be using the MMAP files).

Jump to: navigation, search