Ingres Community Forums Login Register Ingres.com  

Ingres Community Forum


Go Back   Ingres Community Forums > Ingres Forums > DBA Forum
 

Reply
 
LinkBack Thread Tools Display Modes
Old 2009-03-17   #1 (permalink)
Ingres Community
 
Join Date: Mar 2007
Location: Cheshire, UK
Posts: 43
Default iigcc PID to port mappings

I have had an issue where I wanted to quiesce an individual comms server, but could find nothing within Ingres to map the Unix process ID back to the internal communications server ID required by netutil/iinamu. Ingres makes this available for processes using shared memory via csreport, but not any of the other processes.
Attached is a script that uses lsof to report this information along these lines:

PID: 727648 IINAMU: 4788 TCP: 21064 GCC: II0
PID: 727118 IINAMU: 4784 TCP: 21065 GCC: II1

That will let you use netutil to quiesce an individual comms server, and so close it down neatly.

Note: The pathname for lsof is hard coded in the script, so it may need altering.
This has only been tested on 2.6 for axp.osf, but hopefully it is relatively portable.
Attached Files
File Type: txt list_gcc_ports.txt (2.8 KB, 10 views)

Last edited by nick.bolton@barclays.com; 2009-03-17 at 09:26 AM.
nick.bolton@barclays.com is offline   Reply With Quote
Old 2009-03-17   #2 (permalink)
Ingres Community
 
Join Date: Mar 2007
Location: Brazil
Posts: 51
Default

Hi Nick,

I'm not sure which Ingres version are you, but at least on Ingres 2006 you can run iimonitor <gcf_address of the gcc> and run show server. For example:
ingres@uksl-centos45-64> iinamu
Ingres 2006 Release 2 NAME SERVICE MANAGEMENT UTILITY --
-- Copyright (c) 2004 Ingres Corporation
IINAMU> show comsvr
COMSVR * 59190
quit


ingres@uksl-centos45-64> iimonitor 59190
IIMONITOR> show server
Server: 59190
Class: COMSVR
Object: *

Connected Sessions ( includes system and admin sessions )
Current: 3

Active Sessions ( includes user sessions only )
Inbound sessions:
Current: 0
Limit: 64
Outbound sessions:
Current: 0
Limit: 64

Protocols
TCP_IP host:uksl-centos45-64 addr:kk port:22104
Registry Protocols
Not Enabled


Then you have the port of this server (in this case 22104).

I hope it can help you,

Luiz
daslu01 is offline   Reply With Quote
Old 2009-03-17   #3 (permalink)
Ingres Staff
 
grant's Avatar
 
Join Date: Mar 2007
Location: Valladolid, EspaƱa
Posts: 381
Blog Entries: 1
Send a message via MSN to grant
Default

Quote:
Originally Posted by nick.bolton@barclays.com View Post
I have had an issue where I wanted to quiesce an individual comms server, but could find nothing within Ingres to map the Unix process ID back to the internal communications server ID required by netutil/iinamu. Ingres makes this available for processes using shared memory via csreport, but not any of the other processes.
Attached is a script that uses lsof to report this information along these lines:

PID: 727648 IINAMU: 4788 TCP: 21064 GCC: II0
PID: 727118 IINAMU: 4784 TCP: 21065 GCC: II1

That will let you use netutil to quiesce an individual comms server, and so close it down neatly.

Note: The pathname for lsof is hard coded in the script, so it may need altering.
This has only been tested on 2.6 for axp.osf, but hopefully it is relatively portable.

Nice work - this is something I wish I had those times I was trying to track down GCC problems. Is there any chance you can write up a wiki page so it becomes easier to find in future?

regards

grant
__________________
Ingres PHP and Ruby Maintainer
http://blogs.planetingres.org/grant
grant is offline   Reply With Quote
Old 2009-03-17   #4 (permalink)
Ingres Corp
 
Join Date: Mar 2007
Location: Australia
Posts: 330
Blog Entries: 1
Default

But I though Nick wanted to map the process ID to the port. I'm assuming he's running a "ps" or similar, finding a gcc process with a specific PID, and now wants to find the listen port for the GCC with that pid (assuming there could be many gcc's running on the system).

If this is the case, one way wold be to run

Code:
netstat -p -a | grep <pid>
This would show the socket listen address of the gcc with the given process ID. Of course we're working backwards so we can't use the iimonitor trick. The only way I can see is to run:

Code:
grep <tcp_socket_number> $II_SYSTEM/ingres/files/errlog.log
This would display the network open line from the log, you could grep also for E_GC2815 to narrow it down. This line will give you the GCC port ID (the first number after the square braces).

with the right grep, awk, or sed tricks you could create a script that gave you one number from the other.

Last edited by stephenb; 2009-03-17 at 06:49 PM.
stephenb is offline   Reply With Quote
Old 2009-03-18   #5 (permalink)
Ingres Corp
 
pickr01's Avatar
 
Join Date: Mar 2007
Posts: 114
Default

Quote:
Originally Posted by stephenb View Post
...
If this is the case, one way wold be to run

Code:
netstat -p -a | grep <pid>
This would show the socket listen address of the gcc with the given process ID. ..
netstat -a -p does not work on most Unixes

But where it works(Linux) it gives you both listen addresses, the one for incoming connections defined by the listen address and the one for outgoing connections seen in iinamu

Kristoff
pickr01 is offline   Reply With Quote
Old 2009-03-18   #6 (permalink)
Ingres Community
 
Join Date: Mar 2007
Location: Cheshire, UK
Posts: 43
Default

The support of GCF servers in iimonitor was a new feature for Ingres 2006R2, and it doesn't report the Process ID of the GCC.
Unusual resource usage is easiest to see from the Unix level, so mapping back the Process ID to an individual comms server is sometimes useful.
nick.bolton@barclays.com is offline   Reply With Quote
Old 2009-03-18   #7 (permalink)
Ingres Community
 
daryl.monge@ingres.com's Avatar
 
Join Date: Mar 2007
Posts: 75
Default

On machines where netstat will not produce PIDs, you can grab the 'lsof' command and use
Code:
lsof|grep gcc|grep LISTEN
or some variation thereof. The port number is in hex by default.
daryl.monge@ingres.com is offline   Reply With Quote

Reply


Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© 2009 Ingres Corporation. All Rights Reserved