How to clear network socket port 17005? | Unix Linux Forums | Solaris

  Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

How to clear network socket port 17005?

Solaris


Tags
apache-tomcat, solaris 10

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-02-2012
gjackson123 gjackson123 is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 12 June 2014, 4:06 AM EDT
Posts: 59
Thanks: 37
Thanked 0 Times in 0 Posts
How to clear network socket port 17005?

Hi Solaris Experts,

I am wondering whether it is possible to clear a network socket port 17005 left by Apache Tomcat/6.0.20 after having to terminate it forcefully, since it has run away due to remote JDBC resource contention on another server. A normal Tomcat stop / shutdown proves ineffective from then on. This listening port below would hang around for quite some time before disappearing:


Code:
localhost.17005            *.*                0      0 49152      0 LISTEN

This port would prevent Tomcat from starting up successfully again until it is clear, either by waiting for a minimum of 1/2 - 1hr or restarting the server altogether which affect other applications / users on a production server.

I am running jdk1.6.0_11, on SunOS braveheart 5.10 Generic_139556-08 i86pc i386 i86pc.
Thanks a lot,
George
Sponsored Links
    #2  
Old 12-02-2012
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 30 July 2014, 6:29 PM EDT
Location: NM
Posts: 10,160
Thanks: 269
Thanked 781 Times in 731 Posts
The suggestions I have may make it better, however you cannot get rid of some wait states and still have tcp configured correctly. I am assuming it goes to TIME_WAIT.

This is a programming error - which you cannot fix. Most times programs call setsockopt() with SO_REUSEADDR so that if the program is forced to exit then the socket can be reused right away.

What you can do is to check a TCP parameter, especially if you really are waiting one half hour. You should only have to wait 4 minutes or so.
As root:


Code:
ndd -get  /dev/tcp time_wait_interval

You should get a value like 60000 (60 seconds = 60 x 1000 for this parameter).
If it is 60000 the problem lies elsewhere. Or I misunderstood what you asked.
Do NOT go below 60000.

If it is a larger number set it to 60 seconds:

Code:
ndd -set /dev/tcp tcp_time_wait_interval 60000

I am assuming this socket goes into TIME_WAIT, which lasts 2 * MSL (Max segment lifetime), we tune that with the tcp_time_wait_interval. So, I am assuming the TIME_WAIT interval TCP setting is bonked.

If the socket persists in LISTEN (not TIME_WAIT), a thread somewhere still has the socket open. You can find the pid with script below. Issue a kill command (NOT kill -9)
Code:
kill <pid>

, the socket should show TIME_WAIT and be gone in 2 minutes or so.

Run this as root:

Code:
#!/bin/ksh
pids=$(/usr/bin/ps -ef | sed 1d | awk '{print $2}')

if [ $# -eq 0 ]; then
   read ans?"Enter port you would like to know pid for: "
else
   ans=$1
fi

for f in $pids
do
   /usr/proc/bin/pfiles $f 2>/dev/null | /usr/xpg4/bin/grep -q "port: $ans"
   if [ $? -eq 0 ]; then
      echo "Port: $ans is being used by PID:\c $f"      
   fi
done

If this does not work you can consider restarting network services, but this has the almost same effect on users and programs as rebooting.

Get back to us if this doesn't help.
Sponsored Links
    #3  
Old 12-03-2012
gjackson123 gjackson123 is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 12 June 2014, 4:06 AM EDT
Posts: 59
Thanks: 37
Thanked 0 Times in 0 Posts
Hi Jim mcnamara,

Thank you very much for your detail response and suggestion.

I tried the following command but had no luck with it:

root@braveheart # /usr/sbin/ndd -get /dev/tcp time_wait_interval
name is non-existent for this module
for a list of valid names, use name '?'

Is it supported on Solaris 10 (5.10 Generic_139556-08 i86pc i386 i86pc)?

Thanks so much again,

George
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to enable Serial port on ILOM, when Network Port is enabled in parallel bobby320 Solaris 3 08-30-2011 11:56 AM
how to clear particular port laxmikant HP-UX 6 09-23-2009 11:21 PM
Clear Serial Port Buffer Using iclear, iflush sammy-e Programming 1 01-27-2009 05:32 PM
how to clear/clean mbufs (network buffer space)? dipti Programming 7 01-19-2005 04:02 PM
socket on serial port kintoo Programming 2 07-31-2001 03:44 AM



All times are GMT -4. The time now is 09:28 AM.