If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Remote Server Access Via Client

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-11, 23:00
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
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
Reply With Quote
  #2 (permalink)  
Old 12-03-11, 15:19
begooden-it begooden-it is offline
Registered User
 
Join Date: Sep 2011
Location: Pont l'Abbé, Brittany, France
Posts: 183
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 15:22.
Reply With Quote
  #3 (permalink)  
Old 12-03-11, 15:30
begooden-it begooden-it is offline
Registered User
 
Join Date: Sep 2011
Location: Pont l'Abbé, Brittany, France
Posts: 183
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
Reply With Quote
  #4 (permalink)  
Old 12-03-11, 15:49
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Super, you are a rockstar.

Complete.

Best Regards
Reply With Quote
  #5 (permalink)  
Old 12-05-11, 16:25
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
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
Reply With Quote
  #6 (permalink)  
Old 12-05-11, 16:47
begooden-it begooden-it is offline
Registered User
 
Join Date: Sep 2011
Location: Pont l'Abbé, Brittany, France
Posts: 183
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
Reply With Quote
  #7 (permalink)  
Old 12-05-11, 16:47
begooden-it begooden-it is offline
Registered User
 
Join Date: Sep 2011
Location: Pont l'Abbé, Brittany, France
Posts: 183
I'll check tomorrow morning :-)
Reply With Quote
  #8 (permalink)  
Old 12-05-11, 19:04
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
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 05:42.
Reply With Quote
  #9 (permalink)  
Old 12-06-11, 02:15
begooden-it begooden-it is offline
Registered User
 
Join Date: Sep 2011
Location: Pont l'Abbé, Brittany, France
Posts: 183
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
Reply With Quote
  #10 (permalink)  
Old 12-06-11, 05:38
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
====== 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
Reply With Quote
  #11 (permalink)  
Old 12-06-11, 05:48
begooden-it begooden-it is offline
Registered User
 
Join Date: Sep 2011
Location: Pont l'Abbé, Brittany, France
Posts: 183
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
Reply With Quote
  #12 (permalink)  
Old 12-06-11, 06:04
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
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
Reply With Quote
  #13 (permalink)  
Old 12-06-11, 07:05
begooden-it begooden-it is offline
Registered User
 
Join Date: Sep 2011
Location: Pont l'Abbé, Brittany, France
Posts: 183
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On