-
15. Re: JBoss 5.1.0 GA random ports issue !
rajeshharan Feb 17, 2012 9:27 AM (in response to wdfink)Hello,
thanks for your reply.
we use the default profile. How do I restrict the JGroups to use the ports within the specified range. ?
Main reason for this is, we are going to have several default instance of Jboss running on the same linux server and don't want the random ports to start receving packets from other instances.
we have to stick to the port range for each instances.
Thanks,
Rajesh
-
16. Re: JBoss 5.1.0 GA random ports issue !
wdfink Feb 17, 2012 9:46 AM (in response to rajeshharan)the default profile is without clustering, so JGroups is not active.
I'm not sure what ranges are used by the different parts.
Maybe you deactivate what you nor use, see https://community.jboss.org/wiki/JBoss5xTuningSlimming, step by step and see which ports are not used any longer.
On the other hand, if you do not have a cluster, check whether your clients are working if this 5xxxx ports are blocked. If yes there is no real problem and I think there are many installations where nobody look what ports are used.
-
17. Re: JBoss 5.1.0 GA random ports issue !
rajeshharan Feb 21, 2012 2:17 PM (in response to wdfink)thanks for your kind reply.
How do I set the environment variable Jboss_home for mulitple instance on the same box? Is it better to have one instance with Multiple Nodes Vs Multiple Instances on the same box. Either way, I still have the random port issue.
Thanks In Advance,
Rajesh
-
18. Re: JBoss 5.1.0 GA random ports issue !
wdfink Feb 21, 2012 2:23 PM (in response to rajeshharan)I prefere not set JBOSS_HOME, if unset it is set by the run script to the current directory.
What you meant by multiple nodes/instances. If you mean a copy of the complete JBoss directory or only copy server/XXX to different server profiles.
It doesn't matter for both you start a new JVM, only difference is (using JBoss 5) that the common directory is shared.
You might have an issue if you update the JBoss version, in a shared case you might/should stop all instances.
-
19. Re: JBoss 5.1.0 GA random ports issue !
rajeshharan Feb 21, 2012 2:47 PM (in response to wdfink)Thanks a lot for you quick reply.
For what I understood is, Is it better to change the service binding.xml file for the all the ports for all my nodes to avoid the port conflict? My setup will be one instance with 3 nodes.
Thanks,
Rajesh
-
20. Re: JBoss 5.1.0 GA random ports issue !
chaudharygaurav Feb 23, 2012 11:27 PM (in response to rajeshharan)Hi Rajesh, Saw your posts today only....
Yes, I did a workaround for this by editing the remoting jar.....though I do not remember the exact change now, but can tell you if you send me the exact stack trace of the error.....the file which is mentioned in the stack trace has to be changed for this....after that change, we were able to specify the port range for the JBoss to use...and this functionality was there in the earlier version of the remoting jar which was removed later on due to some reasons....
Thanks
-
21. Re: JBoss 5.1.0 GA random ports issue !
rajeshharan Feb 27, 2012 4:14 PM (in response to chaudharygaurav)Hello All,
Finally we started using the service-binding.xml. (basically took the copy of sample-bindings.xml and modified to fit our goal.) but the HTTP port is not working from the bindings configuration file. So I'm modifiy the server.xml file for the HTTP settings. Is there anyway I can use the port-bindings.xml for all my port configurations? including HTTP. Pl. let me know.
Thanks,
Rajesh
-
22. Re: JBoss 5.1.0 GA random ports issue !
chaudharygaurav Feb 28, 2012 2:06 AM (in response to rajeshharan)Hi Rajesh, From my experience, you wont be able to control all the ports.....even if you change the full binding file, JBoss still opens some random ports within a specified range only which can always be duplicate. Though it retries to get the next available port if the current port is not free, those retries are not large in number and then it fails. Please let me know if you are able to achieve this without changing the remoting jar....
Thanks
-
23. Re: JBoss 5.1.0 GA random ports issue !
sughosh Sep 18, 2012 5:58 AM (in response to chaudharygaurav)Hi Everyone,
After patching the jboss-remoting.jar as suggested by Gaurav, we found that almost all of the random port reservations are stopped. Instead, now we can provide a portrange of 10 ports, and JBoss takes up ports only in that range.
But even after that, ONE random port is still reserved. We do have port reservations in the specified range, but one (and it remains restricted to ONE port only, never more than that) random port continues to be in the list of used ports. A sample snapshot is provided below -
Cmd Jobname ASID Subtask Port ____ DUMMYJOB
01A8 007CCE88 31516 ____ . 0364 007BC328 31500 ____ . . . 31501 ____ . . . 31502 ____ . . . 31503 ____ . . . 31504 ____ . . . 31505 ____ . . . 31508 ____ . . . 31509 ____ . . . 31510 ____ . . . 31512 ____ . . . 31514 ____ . . . 31515 ____ . . 007B00B8 31518 <--\ ____ . . . 31519 <---In user-specified range (jboss-remoting.jar patched) ____ . . . 31520 <--/ ____ . . 007BC328 44731 <-- Random port allocated outside user specified range Can anybody share an insight on why this random port is still being reserved by JBoss?
Additionally, we found out that that particular port had the "Local Socket" to 127.0.0.1 (localhost) -
MVS TCP/IP NETSTAT CS V1R13 TCPIP Name: TCPIP11 08:59:59
User Id Conn State
------- ---- -----
DUMMYJOB 0023D021 Listen
Local Socket: ::ffff:127.0.0.1..48830
Foreign Socket: ::ffff:0.0.0.0..0
***
whereas, the other reserved ports had "Local Socket" to our exact IP address -
MVS TCP/IP NETSTAT CS V1R13 TCPIP Name: TCPIP11 09:00:32
User Id Conn State
------- ---- -----
DUMMYJOB 0023D1FA Listen
Local Socket: 1xx.2xx.x5.11..31516
Foreign Socket: 0.0.0.0..0
***
MVS TCP/IP NETSTAT CS V1R13 TCPIP Name: TCPIP11 09:00:48
User Id Conn State
------- ---- -----
DUMMYJOB 0023D080 Listen
Local Socket: ::ffff:1xx.2xx.x5.11..31500
Foreign Socket: ::ffff:0.0.0.0..0
***
-
24. Re: JBoss 5.1.0 GA random ports issue !
chaudharygaurav Sep 18, 2012 11:16 AM (in response to sughosh)Suman,
2 things....
1. Try removing the components one by one and try identifying which component is opening these ports...
2. May be this port, even if it does not get opened, will not have any adverse effect....
Thanks
-
25. Re: JBoss 5.1.0 GA random ports issue !
sughosh Sep 19, 2012 3:07 AM (in response to chaudharygaurav)Hi Gaurav,
Thanks for the prompt response. As per the code that you had patched (in PortUtil.java) - you had modified the inititialization of portCounter variable in the static block (which earlier used the getRandomStartingPort() method) - and changed it to read from a system property "jboss.remoting.start.portrange", defaulting to 5000 when the property is not found.
I was just wondering, whether there might be any other jboss class which directly uses getRandomStartingPort() directly - hence causing the said random port reservation?
Tomorrow I will modify the getRandomStartingPort() method too, and change it to return a constant value - so that we can verify this theory.
Do let me know of your thoughts on this!
Thanks,
Suman.
-
26. Re: JBoss 5.1.0 GA random ports issue !
sughosh Sep 19, 2012 4:07 PM (in response to chaudharygaurav)Hi Gaurav,
One more thing - can you let me know how did you zero-in to PortUtil.java in jboss-remoting.jar among the entire pool of Jboss jars and classes? If I know that, then even I will follow the same process to find out which method in which class is opening that random port.
I am almost certain that port is not being opened by any of our own services. I have also removed all redundant services of Jboss which are known to open random ports (as listed out in the application server slimming & tuning guide page).
Thanks & Regards,
Suman.
-
27. Re: JBoss 5.1.0 GA random ports issue !
chaudharygaurav Sep 20, 2012 9:49 AM (in response to sughosh)H Suman,
If I remember correctly, PortUtil was the main class that was throwing the exception. Try seing the stacktrace...you should get the clues....
Thanks