Results 1 to 13 of 13
  1. #1
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655

    Unanswered: Remote Server Access Via Client

    Informix Gurus,

    Can some one give me a simplest example how to connect to remote server over tcp ip network.

    I am trying to figure out this for informix 7, 9 and 10 on aix.

    Please help with an example

    Thanks

  2. #2
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Simple, but the last one for today: almost bed time here ;-)

    the method will be the same for 9, 10,11 ... and aix or other.

    1) choose a free tcp port number, create a line in /etc/services
    with this port number and a name like ifmx_instance1_tcp

    2) replicate this line on any server you want to communicate with.

    3) on the host hosting your instance, add a line in your $INFORMIXDIR/etc/sqlhosts file, structured like this:
    yourtcpserveraliasname onsoctcp hostname c

    * yourtcpserveraliasname is the alias name of your informix instance, that you will declare for the parameter DBSERVERALIASE in $ONCONFIG
    * onsoctcp means this alias use (on)line,(soc)kets,tcp protocol
    * hostname speaks by itself
    * yourtcpserveraliasname is the name you declare in /etc/services

    replicate this sqlhosts line in any machine you want to communicate with

    You'll have to rebounce your IFMX instance, so that the new alias starts. Your instance will now listen on 2 protocols: 1 in SHMEM ( the one named in DBSERVERNAME in onconfig , the other one on tcp ( DBSERVERALIASES) .

    on the client machines, set the INFORMIXSERVER=yourtcpserveraliasname env variable, and if those machines have IDS binaries installed, you now can access this instance using dbaccess

    For other client types, see my former email :-)

    Does this answer your question?
    Last edited by begooden-it; 12-03-11 at 16:22.

  3. #3
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    ex:
    /etc/services
    Code:
    ######## Informix Servers ########
    bgdsrv00_tcp    50000/tcp               # informix dynamic server begoodenserver00
    bgdsrv01_tcp    50001/tcp               # informix dynamic server begoodenserver01
    bgdsrv02_tcp    50002/tcp               # informix dynamic server begoodenserver02
    $INFORMIXDIR/etc/sqlhosts:
    Code:
    #INFORMIXSERVER         PROTOCOL    HOSTNAME            SERVICE
    begoodenserver00        onipcshm    gigabyte    bgdsrv00
    begoodenserver00_tcp    onsoctcp    gigabyte    bgdsrv00_tcp
    begoodenserver01        onipcshm    gigabyte    bgdsrv01
    begoodenserver01_tcp    onsoctcp    gigabyte    bgdsrv01_tcp
    $INFORMIXDIR/etc/$ONCONFIG:
    Code:
    SERVERNUM       1
    DBSERVERNAME    begoodenserver01
    DBSERVERALIASES begoodenserver01_tcp
    on the clients:
    Code:
    export INFORMIXSERVER=begoodenserver00_tcp
    export INFORMIXDIR=/usr/informix ( for instance )
    export PATH=$INFORMIXDIR/bin:$PATH

  4. #4
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Super, you are a rockstar.

    Complete.

    Best Regards

  5. #5
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Tried between 11.70 to 11.70 on centos 5.4 virtual machines.
    No success yet.

    Could not get the host respond on the port that I selected (65000).

    Not sure why, but definitely host was not listening to that port.

    Also, I had allowed trafic through firewall, iptables.

    Any Idea welcome.

    Regards
    DBFinder

  6. #6
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Hi,

    can you please show on machine A and machine B
    * /etc/services ( the informix server lines )
    * $INFORMIXDIR/etc/sqlhosts
    * $INFORMIXDIR/etc/$ONCONFIG
    * do you ping from B to A and from A to B ?
    * can you nmap A and check open/closed ports, same for B ?

    This should work if all this is OK

  7. #7
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    I'll check tomorrow morning :-)

  8. #8
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Here is the info : trying to connect from B to A

    Machine A ====== 192.168.13.31 ========= First informix server
    Code:
    ====================== /etc/services
       DB2_db2inst2_1	   60004/tcp
       DB2_db2inst2_END	60005/tcp
       db2c_db2inst2	       50001/tcp
       infrem               65000/tcp
    ====================== /opt/ibm/informix/etc/sqlhosts.ol_informix1170
    ol_informix1170 onsoctcp cent54 ol_informix1170 
    dr_informix1170 drsoctcp cent54 dr_informix1170 
    super onsoctcp cent54 infrem
    ====================== /opt/ibm/informix/etc/onconfig.ol_informix1170
    SERVERNUM 0
    DBSERVERNAME ol_informix1170
    DBSERVERALIASES dr_informix1170 super
    
    ====================== nmap -sT -O localhost 
    [root@cent54 ~]# nmap -sT -O localhost
    
    Starting Nmap 4.11 ( Nmap - Free Security Scanner For Network Exploration & Security Audits. ) at 2011-12-05 14:03 EST
    Interesting ports on localhost (127.0.0.1):
    Not shown: 1673 closed ports
    PORT      STATE SERVICE
    22/tcp    open  ssh
    25/tcp    open  smtp
    111/tcp   open  rpcbind
    523/tcp   open  ibm-db2
    631/tcp   open  ipp
    797/tcp   open  unknown
    50000/tcp open  iiimsf
    No exact OS matches for host (If you know what OS is running on it, see Nmap Fingerprint Submitter 2.0).
    TCP/IP fingerprint:
    SInfo(V=4.11%P=x86_64-redhat-linux-gnu%D=12/5%Tm=4EDD1586%O=22%C=1)
    TSeq(Class=RI%gcd=1%SI=413C1A%IPID=Z%TS=1000HZ)
    TSeq(Class=RI%gcd=1%SI=413B33%IPID=Z%TS=1000HZ)
    TSeq(Class=RI%gcd=1%SI=413C31%IPID=Z%TS=1000HZ)
    T1(Resp=Y%DF=Y%W=8000%ACK=S++%Flags=AS%Ops=MNNTNW)
    T2(Resp=N)
    T3(Resp=Y%DF=Y%W=8000%ACK=S++%Flags=AS%Ops=MNNTNW)
    T4(Resp=Y%DF=Y%W=0%ACK=O%Flags=R%Ops=)
    T5(Resp=Y%DF=Y%W=0%ACK=S++%Flags=AR%Ops=)
    T6(Resp=Y%DF=Y%W=0%ACK=O%Flags=R%Ops=)
    T7(Resp=Y%DF=Y%W=0%ACK=S++%Flags=AR%Ops=)
    PU(Resp=Y%DF=N%TOS=C0%IPLEN=164%RIPTL=148%RID=E%RIPCK=EK=E%ULEN=134%DAT=E)
    
    
    Uptime 0.047 days (since Mon Dec  5 12:56:13 2011)
    
    Nmap finished: 1 IP address (1 host up) scanned in 9.693 seconds
    [root@cent54 ~]#

    Machine B ====== 192.168.13.45 ========= Second informix server
    Code:
    ====================== /etc/service
    DB2_db2inst2_1	60004/tcp
    DB2_db2inst2_END	60005/tcp
    db2c_db2inst2	       50001/tcp
    infrem               65000/tcp
    ====================== /opt/ibm/informix/etc/sqlhosts.ol_informix1170
    ol_informix1170 onsoctcp cent54 ol_informix1170 
    dr_informix1170 drsoctcp cent54 dr_informix1170 
    super         onsoctcp      cent54        infrem 
    ====================== /opt/ibm/informix/etc/onconfig.ol_informix1170
    SERVERNUM 0
    DBSERVERNAME ol_informix1170
    DBSERVERALIASES dr_informix1170
    
    ====================== nmap -sT -O localhost
    [root@cent54 ~]# nmap -sT -O localhost
    
    Starting Nmap 4.11 ( Nmap - Free Security Scanner For Network Exploration & Security Audits. ) at 2011-12-05 14:01 EST
    Interesting ports on localhost (127.0.0.1):
    Not shown: 1673 closed ports
    PORT      STATE SERVICE
    22/tcp    open  ssh
    25/tcp    open  smtp
    111/tcp   open  rpcbind
    523/tcp   open  ibm-db2
    631/tcp   open  ipp
    797/tcp   open  unknown
    50000/tcp open  iiimsf
    No exact OS matches for host (If you know what OS is running on it, see Nmap Fingerprint Submitter 2.0).
    TCP/IP fingerprint:
    SInfo(V=4.11%P=x86_64-redhat-linux-gnu%D=12/5%Tm=4EDD14F9%O=22%C=1)
    TSeq(Class=RI%gcd=1%SI=2C4AB3%IPID=Z%TS=1000HZ)
    TSeq(Class=RI%gcd=1%SI=2C4AA4%IPID=Z%TS=1000HZ)
    TSeq(Class=RI%gcd=1%SI=2C4997%IPID=Z%TS=1000HZ)
    T1(Resp=Y%DF=Y%W=8000%ACK=S++%Flags=AS%Ops=MNNTNW)
    T2(Resp=N)
    T3(Resp=Y%DF=Y%W=8000%ACK=S++%Flags=AS%Ops=MNNTNW)
    T4(Resp=Y%DF=Y%W=0%ACK=O%Flags=R%Ops=)
    T5(Resp=Y%DF=Y%W=0%ACK=S++%Flags=AR%Ops=)
    T6(Resp=Y%DF=Y%W=0%ACK=O%Flags=R%Ops=)
    T7(Resp=Y%DF=Y%W=0%ACK=S++%Flags=AR%Ops=)
    PU(Resp=Y%DF=N%TOS=C0%IPLEN=164%RIPTL=148%RID=E%RIPCK=EK=E%ULEN=134%DAT=E)
    
    
    Uptime 0.045 days (since Mon Dec  5 12:56:59 2011)
    
    Nmap finished: 1 IP address (1 host up) scanned in 9.705 seconds
    [root@cent54 ~]#
    ===================================================
    Last edited by DBFinder; 12-06-11 at 06:42.

  9. #9
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Hi,

    I think the root cause is that $ONCONFIG does not understand the $INFORMIXSERVER name "super" contained in your sqlhosts.

    You need to add it on the SERVER's $ONCONFIG file to the DBSERVERALISASES list, separated by a comma, like this:
    DBSERVERALIASES dr_informix1170, super

    I don't think the engine understands alias names separated by a blank space.

    In order to check, you should see the "super" alias server poll and listener "soc" threads when running:
    Code:
    onstat -g ath | grep soc
     10      29654028         0                1    running                12soc*        soctcppoll
     13      296b5028         0                2    sleeping forever        1cpu*        soctcplst
    Run this onstat before changing the $ONCONFIG, check if the "soc" lines are present or not.
    If not, change the $ONCONFIG/DBSERVERALIASES by adding the ",".
    Rebounce your instance, and check again.

    I set my listener awaiting for your test .

    Cheers
    Eric

  10. #10
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    ====== before
    Code:
    [informix@cent54 ~]$ onstat -g ntt | grep soc
    4c6091a8 soctcplst        4 00:16:26                   cent54|dr_informix1170|soctcp
    4b426b80 soctcplst        3 00:16:26                   cent54|ol_informix1170|soctcp
    4b424d68 soctcppoll       2 00:16:26
    [informix@cent54 ~]$
    ====== after
    Code:
    [informix@cent54 ~]$ onstat -g ntt | grep soc
    4c6301a8 soctcplst        5 00:21:29                   cent54|infrem|soctcp
    4c6091a8 soctcplst        4 00:21:29                   cent54|dr_informix1170|soctcp
    4b420c00 soctcplst        3 00:21:29                   cent54|ol_informix1170|soctcp
    4b424d68 soctcppoll       2 00:21:29
    It worked,
    Code:
    [informix@cent54 ~]$  echo "connect to 'sysmaster@super' user 'informix'" | dbaccess -
       ENTER PASSWORD:
    
    Connected.
    
    
    
    Disconnected.
    Note :

    I just added comma, it still did not work because there was a blank after the comma. Then I removed the blank, it worked.

    Thanks Eric for all your time.

    Thanks

  11. #11
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Cool :-)

    Now you can connect from other servers, or Informix ODBC driver installed on PCs...

    Just to give you bad ideas, you can also generate the Perl DBI module ... that you can get from CPAN ( you need Informix CSDK for that )

    Cheers from France
    Eric

  12. #12
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Eric,

    Have you ever used IBM Data Server Client for remote connections.
    I will see if that is possible, if so, I will be able to connect to DB2 and Informix from same client. Just a thinking, never tried.

    BTW, I haven't had hands on perl yet, in my list, may happen soon.

    Regards
    DBFinder

  13. #13
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    I never did :-(

    According to the 11.50 doc, this can be done, see this l ink.

    Not sure whether it works with 9.40, but the protocol is pretty much the same, based apparently on DRDA, which has been used with Informix since 1992 or so, this should work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •