Creating a clone of a primary server

Use the ifxclone utility to create a clone of a primary server.

About this task

The general steps to create a clone of a server are as follows:

Procedure

  1. Verify that the ENABLE_SNAPSHOT_COPY configuration parameter on the source server is set to 1.
  2. Verify that the CDR_AUTO_DISCOVER configuration parameter is set to 1, and that the REMOTE_SERVER_CFG file is set on all cluster servers.
  3. Set the following environment variables on the target server:
    • INFORMIXDIR
    • INFORMIXSERVER
    • ONCONFIG
    • INFORMIXSQLHOSTS
  4. On the target server, create all of the chunks that exist on the source server. You can use the --createchunkfile option (-k) to automatically create cooked chunks on the target server. Follow these steps to create the chunks:
    1. On the source server, run the onstat -d command to display a list of chunks
    2. On the target server, log-in as user informix and use the commands touch, chown, and chmod to create the chunks.
      For example, to create a chunk that is named /usr/informix/chunks/rootdbs.chunk, follow these steps:
      $ su informix
      Password:
      $ touch /usr/informix/chunks/rootdbs.chunk
      $ chown informix:informix /usr/informix/chunks/rootdbs.chunk
      $ chmod 660 /usr/informix/chunks/rootdbs.chunk
    3. Repeat all of the commands in the previous step for each chunk reported by the onstat -d command.
  5. Create an sqlhosts file on the target server's host, and add the target server's connectivity information to the file.
  6. On the source server, run the admin() or task() function with the cdr add trustedhost argument, including the target server's trusted-host information.
  7. While still logged in as user informix, run the ifxclone utility with the --autoconf option (-a) and other appropriate parameters on the target system on which the clone server is started.
    Note: If trusted-host information was added manually, do not use the --autoconf option; you must configure trusted hosts and sqlhosts file information manually.

Example: Cloning a primary server

For this example, you have the following system:
  • server_1 is the source server and has the following sqlhosts file entries:
    #dbservername  nettype   hostname           servicename  options
     server_1      onsoctcp  host1.example.com  123
  • server_1 has the following configuration parameter settings:
    • ENABLE_SNAPSHOT_COPY 1
    • CDR_AUTO_DISCOVER 1
    • REMOTE_SERVER_CFG authfile.server_1
  • server_1 has the following trusted-host file entries
    #trustedhost
    host1
    host1.example.com
    host2
    host2.example.com
  • server_2 is the target server, is on host2.example.com, and uses port 456.
  1. On the target server, log in as user informix and use the touch, chown, and chmod commands to create, change the owner, and change the permissions for the chunks. The chunk paths must match the paths of the chunks on the source server. You can use the --createchunkfile option (-k) to automatically create cooked chunks on the target server.
  2. Run the ifxclone utility on the target server as user informix:
    ifxclone -T -S server_1 -I host1.example.com -P 123 -t server_2 
             -i host2.example.com -p 456 -a -k
    ifxclone -T -S server_1 -I host1.example.com -P 123 -t server_2 
             -i host2.example.com -p 456 -a
The ifxclone utility modifies the sqlhosts file on the source server and creates a copy of the file on the new target server:
#dbservername  nettype   hostname           servicename  options
 server_1      onsoctcp  host1.example.com  123
 server_2      onsoctcp  host2.example.com  456
The ifxclone utility also propagates the trusted-host file on the source server to the target server.