Promoting Secondary Server to Primary Server

0 Likes

 

    1. Take the backup of the database using zlm_dbbackup.sh in primary server.



    1. Take the backup of e-Directory using zlm_ndsbackup.sh in primary server.



    1. Type etc/init.d/ndsd restart on each secondary server that doesn't have a read/write replica of eDirectory.



    1. 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.



    1. On all the secondary servers, copy var/opt/novell/zenworks/zfs/pds/security/csr/*.csr to var/opt/novell/zenworks/zfs/pds/security/*.cer.



    1. 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.



    1. 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



    1. 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

        1. Change the password of this file to the value of

        1. /etc/opt/novell/zenworks/serversecret



    1. 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.



    1. Edit ~/.pgpass file as follows:
      localhost:5432:zenworks:zenadmin:ValueOf /etc/opt/novell/zenworks/serversecret



    1. Copy the backup file that has been created in step 2 to the secondary server /tmp folder.

    2. 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>



    1. 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.



    1. 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

        1. Change the password of this file to the value of /etc/opt/novell/zenworks/serversecret
          of new primary server.

        1. 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

        1. Restart the postgres service .




    1. If we are getting the following error message:

       


      could not change directory to "/root" 

       


      Work around:


      Run the script from /tmp folder

 

Labels:

How To-Best Practice
Collateral
Comment List
Anonymous
Related Discussions
Recommended