Cool Solutions

Promoting Secondary Server to Primary Server



By:

October 24, 2008 2:08 pm

Reads:6,713

Comments:0

Score:Unrated

Print/PDF
  1. Take the backup of the database using zlm_dbbackup.sh in primary server.
  2. Take the backup of e-Directory using zlm_ndsbackup.sh in primary server.
  3. Type etc/init.d/ndsd restart on each secondary server that doesn’t have a read/write replica of eDirectory.
  4. Choose a secondary server with a read/write replica to be the new primary server and change the ZENworks Object Store replica on that server to be the master replica by typing ndsrepair -P -Ad.
  5. On all the secondary servers, copy var/opt/novell/zenworks/zfs/pds/security/csr/*.csr to var/opt/novell/zenworks/zfs/pds/security/*.cer.
  6. From within the /opt/novell/convertserver directory, type ./convertserver on the server that is being promoted to the primary server, then follow the prompts. You’ll need the administrator password.
  7. Add the following lines in Secondary Server in “/var/lib/pgsql/data/postgresql.conf” file of # zlm datamodel configured # section and remove the old lines if exists any.
    	max_connections = 500
    	authentication_timeout = 1
    	shared_buffers = 2048
    	work_mem = 2048
    	max_fsm_pages = 40000
    	maintenance_work_mem = 16384
    	listen_addresses = '*'
    	timezone = GMT
    	unix_socket_permissions = 0770	
    	
  8. Edit “/etc/opt/novell/zenworks/hibernate.cfg.xml” file in Secondary Server in order to point to the local server postgres database.
    1. Edit the connection url to jdbc:postgresql://127.0.0.1:5432/zenworks
    2. Change the password of this file to the value of
    3. /etc/opt/novell/zenworks/serversecret
  9. Edit the “/var/lib/pgsql/data/pg_hba.conf” to point to the local Database in the secondary server and if this zone has more secondary servers we need to add all the hosts in this file in order to access this database by all the secondary servers.

    In this step its better to copy pg_hba.conf file from primary to secondary and remove the line of IP of secondary.

  10. Edit ~/.pgpass file as follows:
    localhost:5432:zenworks:zenadmin:ValueOf /etc/opt/novell/zenworks/serversecret
  11. Copy the backup file that has been created in step 2 to the secondary server /tmp folder.
  12. Now copy the given script to /tmp folder and run the script using the following command from /tmp on the same server. This script will create the schema in secondary server and it will restore the database.

    sh zlm_migrate.sh -F <FileNameCreatedInStep 2 available in /tmp>

  13. Just Restart all the services using “zlm-config –restart” . With this secondary server will become primary and the database will be available locally for this server.
  14. If we have more secondary servers connected to this zone then we need to edit “/etc/opt/novell/zenworks/hibernate.cfg.xml” of all secondary server to point to the new primary server . Change the following lines in all secondary servers.
    1. Edit the connection url to jdbc:postgresql://NewPrimaryIP:5432/zenworks
    2. Change the password of this file to the value of /etc/opt/novell/zenworks/serversecret
      of new primary server.
    3. Restart all the services using “zlm-config –restart” on all secondary servers.

Known Issues:

  1. If we are getting the following error message:

    could not change directory to "/root"
    createlang: could not connect to database zenworks: could not connect to server: No such file or directory
            Is the server running locally and accepting
            connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
    Shutting down PostgreSQLpg_ctl: PID file "/var/lib/pgsql/data/postmaster.pid" does not exist
    Is postmaster running?
                                                                          failed
    Initializing the PostgreSQL database at location /var/lib/pgsql/data  failed
    
    

    You can find a log of the initialization in ~postgres/initlog.

    Workaround:

    1. Move directory /var/lib/pgsql/data to /var/lib/pgsql/data.old
    2. Restart the postgres service .
  2. If we are getting the following error message:

    could not change directory to "/root" 
    

    Work around:

    Run the script from /tmp folder

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.
Loading...

Tags:
Categories: Uncategorized

0

Disclaimer: This content is not supported by Micro Focus. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

Comment

RSS