Configuring Connectivity

The following example shows how to configure connectivity between two IDS instances. It is assumed that two instances named penguin and icebear exist. Please check the article Configuring your own IDS instance which describes the necessary steps to setup your own instance.

Current sqlhosts files

Below you see the current content of the sqlhosts files for both IDS instances before the change. Instance penguin is running on machine apollo4 and instance icebear runs on starship2.

Instance penguin

#--------------------------------------------------------
#dbserver           protocol  hostname            service
#--------------------------------------------------------
penguin             onsoctcp  apollo4             50100
penguin_drda        drsoctcp  apollo4             50101
penguin_shm         onipcshm  apollo4             dummy

Instance icebear

#--------------------------------------------------------
#dbserver           protocol  hostname            service
#--------------------------------------------------------
icebear             onsoctcp  starship2            50200
icebear_drda        drsoctcp  starship2            50201
icebear_shm         onipcshm  starship2            dummy

Add sqlhosts Entry

In order to be able to connect from one instance to the other we need to add a new entry to the existing sqlhosts files.

sqlhosts penguin

  1. Setup your proper environment
    • . /home/informix/instances/penguin/env.sh
  2. Add a new entry for instance icebear to your sqlhosts file.
    • vi $INFORMIXSQLHOSTS
      #--------------------------------------------------------
      #dbserver           protocol  hostname            service
      #--------------------------------------------------------
      icebear             onsoctcp  starship2           50200

sqlhosts icebear

  1. Setup your proper environment
    • . /home/informix/instances/icebear/env.sh
  2. Add a new entry for instance penguin to your sqlhosts file.
    • vi $INFORMIXSQLHOSTS
      #--------------------------------------------------------
      #dbserver           protocol  hostname            service
      #--------------------------------------------------------
      penguin             onsoctcp  apollo4             50100

The examples are based on Linux. Depending on your platform, you might need to change the protocol from onsoctcp to ontlitcp.

Connect via dbaccess

You can now start the dbaccess utility and go to menu item Connection→Connect. Pick the new connection and you will be asked for a username and password. If you press return without entering a username, dbaccess will not prompt you for a password, instead it tries to connect with the current user.

telnet Test

If the connection attempt is unsuccessful, make sure that your second IDS instance is started and that the connection port is not blocked by a firewall. A simple telnet test can help:

  • Connection test to machine apollo4, instance penguin, port 50100 via telnet:
    • telnet apollo4 50100

If the connection attempt is successful, you will see something like this:

telnet apollo4 50100
Trying 192.168.178.22...
Connected to apollo4.
Escape character is '^]'.

Just press <strg-c> to interrupt the telnet request. If the connection attempt is unsuccessful, you will see something like this:

telnet apollo4 50100
Trying 192.168.178.22...
telnet: connect to address 192.168.178.22: Connection refused

Make sure that port 50100 on machine apollo4 is not blocked by a firewall.

Trusting Users

If the two IDS instances are running on separate hosts and you don't want to enter a password, you can simply trust the user.

Machine starship2

  • Trusting user informix to connect from machine apollo4, instance penguin to machine starship2, instance icebear without password:
    • Logon as informix to machine starship2
      • vi ~informix/.rhosts
        apollo4   informix

Machine apollo4

  • Trusting user informix to connect from machine starship2, instance icebear to machine apollo4, instance penguin without password:
    • Logon as informix to machine apollo4
      • vi ~informix/.rhosts
        starship2   informix

You can now perform the connection test again. Just press the <enter> key when you are prompted for a username. A password is no longer required.

From a security point of view, trusting users is not recommended.

Connection Environment Variables

  • INFORMIXSQLHOSTS
    • IDS instance connectivity file
  • INFORMIXSERVER
    • Default IDS instance to connect to if nothing is specified
  • INFORMIXCONTIME and INFORMIXCONRETRY
    • those variables specifies the interval (INFORMIXCONTIME) in seconds as well as the total number (INFORMIXCONRETRY) of connection attempts that are internally performed by the Informix client (for example: dbaccess) before a connection error is returned
    • if INFORMIXCONTIME is set to 30 and INFORMIXCONRETRY is set to 3, attempts to connect to the database server are made at 0 (initial attempt), 10, 20, and 30 seconds before returning a connection error
 
idsdev/admin/connectivity.txt · Last modified: 2007/11/24 18:31 by eherber     Back to top