Re: ER setup cookbook
Posted in 2000
I just looked at this a bit more carefully and think that there might have been a
problem. I should have checked it out a bit more carefully before I posted. Sorry.
ER uses the 'group' name almost exclusivelly. Therefor on the define replicate
command, the group name should be used instead of the INFORMIXSERVER.
Madison Pruet wrote:
> The following is the cookbook that I have refered to in previous
> emails. We are putting in several example setup scripts in the 9.3
> documentation so hopefully this will be a much easier task than in the
> past. The procedure for setting up the system in 7.31 and 9.20 is
> similar to the one described. Hopefully this will help...
>
> -------------------------------------------------------------
> Summary:
>
> This documents intent is to assist customers in setting up ER
> for the first time with 7.30 servers. It will detail how to
> accomplish this by using the GUI on NT (Replication Manager)
> or by using the Command Line Interface on UNIX or NT.
>
> --------------------------------------------------------------------------------
>
> Detail:
> Preparing for ER:
>
> - Databases on all instances involved should be set to logging
> (unbuffereded logging is recommended)
> - If using Conflict Resolution other than 'Ignore' for a
> replicate - each table will need to have the CRCOLS columns
> added. This can be done one of two ways:
> - ALTER table tabname add CRCOLS; -- for existing tables
> - CREATE table tabname (...) with CRCOLS; -- for new tables
> - If planning to define the replicate using "select * from
> tabname", are the tables identical on all instances defined
> for this replicate?
> - Any table defined in a replicate must have a PRIMARY KEY
> constraint defined on at least one column.
>
> Setting up the SQLHOSTS file on UNIX:
>
> All machines where ER will be running on need to have a Trusted
> relationship. To determine if your host is trusted by the other
> host(s) in the ER system - use dbaccess -> connection -> connect,
> and connect to the Group Name and the Servername of the other
> host(s).
>
> Before using dbaccess to test this however - you need to set up
> the SQLHOSTS file on all servers involved. Below is an example
> of the SQLHOSTS file from the UNIX server 'unix1' before modified
> for ER:
>
> ol_unix1shm onipcshm unix1 ol_unix1shm
> ol_unix1tcp oltlitcp unix1 ol_unix1tcp
> ol_unix2tcp oltlitcp unix2 ol_unix2tcp>
> Also - the SQLHOSTS file on the other UNIX server 'unix2' would
> look like this:
>
> ol_unix2shm onipcshm unix2 ol_unix2shm
> ol_unix2tcp oltlitcp unix2 ol_unix2tcp
> ol_unix1tcp oltlitcp unix1 ol_unix1tcp>
> Currently, (based upon the files above) you can see that the two
> servers already have connectivity to each other. This means that
> the /etc/services file has entries for the TCP services listed in
> the SQLHOSTS file, and there may also be entries in the /etc/hosts
> or .rhost files for these servers. (Note: the TLI connection
> method is only supported on certain platforms - please check the
> Machine Specific Notes for you engine to find out if your platform
> support TLI, or SOC connections.)
>
> The following modifications will need to be made to enable ER to
> be defined on each of these servers.
>
> The Unix1 server:
> unix1grp group - - i=1
> ol_unix1tcp oltlitcp unix1 ol_unix1tcp g=unix1grp
> ol_unix1shm onipcshm unix1 ol_unix1shm g=unix1grp
>
> The Unix2 server:
> unix2grp group - - i=2
> ol_unix2tcp oltlitcp unix2 ol_unix2tcp g=unix2grp
> ol_unix2shm onipcshm unix2 ol_unix2shm g=unix2grp
>
> Verify that the INFORMIXSERVER environment variable is set for the
> network
> connection and not the shared memory connection. For this example set
> INFORMIXSERVER to "ol_unix1tcp". Also, pre-9.20, set the DBSERVERNAME
> in the
> onconfig file for both servers to the TCP connection. Please check out
> bug
> #113269 for more info on this.
>
> Setting up the SQLHOSTS registry entries on NT:
>
> There is a demo program in $INFORMIXDIR/demo named ershed.exe -
> this is the SQLHOSTS editor. This tool can read an SQLHOSTS
> (that has been copied from a UNIX system) and write it into the
> registry on NT. If you are just setting up NT boxes however,
> this tool can still be helpful - as you and create a standard
> SQLHOSTS file (as you would on UNIX) and use it write all the
> registry entries needed. If you feel uncomfortable using this
> tool - then the release notes on NT and UNIX detail two other
> ways to accomplish the same task - 1) by using the IECC client,
> and 2) by adding the entries directly to the registry.
>
> After the registry has a group entry for each server - use the
> SetNet32 utility to populate the host information with a username
> and password for each host. Then use I-Login to make a connection
> to each host - to ensure connectivity. If you have an engine
> installed on NT - you can use dbaccess to insure this connectivity.
>
> Using the Command Line on UNIX or NT:
>
> 1 - Define the server:
>
> UNIX: cdr define server -c unix1grp -s rootdbs -r rootdbs \\
> -A /tmp -R /tmp -I unix1grp
>
> NT: cdr define server -c ai_airprt1 -A /tmp -R /tmp \\
> -I ai_airprt1 -S ai_unix1grp
>
> 2 - Define the replicate:
>
> Update Anywhere Syntax:
> cdr define repl -c unix1grp -C"timestamp" -S tran -A repA \\
> "database@ol_unix1tcp:informix.tablename" "select * from tablename" \\
> "database@ol_unix2tcp:informix.tablename" "select * from tablename"
>
> Primary/Target Syntax:
> cdr define repl -c unix1grp -C"timestamp" -S tran -A repA \\
> "P database@ol_unix1tcp:informix.tablename" "select * from tablename" \\
> "R database@ol_unix2tcp:informix.tablename" "select * from tablename"
>
> 3 - Start the replicate
> cdr start repl repA unix1grp unix2grp
>
> Using the Replication Manager on NT:
>
> Refer to Chapters 7 and 8 of the Guide to Informix Enterprise
> Replication version 7.3. These chapters go into great detail on
> defining the server and starting replication using the GUI tool.