-
1. Re: Do I need to restart JBoss??
jaikiran Feb 18, 2010 9:07 AM (in response to skewbie)Steve, welcome to the forums.
JBoss AS user forum is a better place for this question. I'll move this thread there.
-
2. Re: Do I need to restart JBoss??
peterj Feb 19, 2010 1:26 PM (in response to jaikiran)1 of 1 people found this helpfulIn a way, you are both correct. Let me explain. When you overwrite an app with a new version, JBoss AS will automatically undeploy the old version and deploy the new version. From that point on all of the users of the app will be using the new version. So a restart is not necessary from the user's point of view.
However, there are often problems with deallocating all of the data structures used by the older version of the app. Which means that they will stay around using up both heap and permgen space. The only guaranteed way of getting this old stuff cleaned out is to restart the server.
In general, in a production environment, redeploying an application is a rare event happening maybe once a month or less. In that case, there is no real need to restart the app server immediately. Instead, you can wait until a quite time (evening or weekend) to schedule a restart. If, however, you udpate the app several times a day (I sure hope not!) then you will want to reboot more often (daily or twice a day).
-
3. Re: Do I need to restart JBoss??
skewbie Feb 22, 2010 9:37 AM (in response to peterj)Thanks for your response Peter.
That's both good and bad news as we tend to have updates to our production servers between1-2 times a week and have multiple applications under many of our jboss servers.
Is it possible to restart a particular instance rather than having to restart the whole jboss server? I found this code in a script which seem to use jnp and the port number but I do not really understand what jnp is. I tried reading/understanding this document (http://community.jboss.org/wiki/namingcontextfactory) but it did not really make a lot of sense to me. Where are those ports defined? What are they for?
stop)
echo -n "Gracefully Stopping instances$2: "
case "$2" in
1)
$JBOSS_HOME/bin/shutdown.sh -s jnp://1.2.3.4:1099
;;
2)
$JBOSS_HOME/bin/shutdown.sh -s jnp://1.2.3.4:1199
;;
3)
$JBOSS_HOME/bin/shutdown.sh -s jnp://1.2.3.4:1299
;;
4)
$JBOSS_HOME/bin/shutdown.sh -s jnp://1.2.3.4:1399
;;
5)
$JBOSS_HOME/bin/shutdown.sh -s jnp://1.2.3.4:1499
;;
6)
$JBOSS_HOME/bin/shutdown.sh -s jnp://1.2.3.4:1599Thanks
Steve.
-
4. Re: Do I need to restart JBoss??
peterj Feb 22, 2010 11:59 AM (in response to skewbie)"jnp" is the protocol used by the JNDI service within JBoss AS. The URL is passed to shutdown.sh so that it knows which server to communicate with.
Are the various AS instancs running within a cluster? If so, you should be able to reboot them one at a time. It might be best to wait a few minutes between shutdown and startup to let the cluster adjust itself after loosing a node (instance), and then wait for it to reestablish the rebooted node before cylcing the next node. -
5. Re: Do I need to restart JBoss??
skewbie Mar 3, 2010 4:27 AM (in response to peterj)Thanks Peter
However, where are these jnp ports configured? Are they assigned at runtime? If so how can they be predefined in a shutdown script?
One of the developers has said you can find it in the bindings.xml file. However, I cannot for the life of me work out how the ports are defined. I have even tried to do a 'find' from the jboss directory and it returns nothing.
Thanks.
Steve.
-
-
7. Re: Do I need to restart JBoss??
peterj Mar 3, 2010 1:54 PM (in response to jaikiran)What version of JBoss AS are you using? I would hate to spend a lot of time explaining what is done in JBoss AS 5.x just to find out you are using 4.2.3! -
8. Re: Do I need to restart JBoss??
skewbie Mar 3, 2010 2:50 PM (in response to peterj)We are using a combination of versions from 3.2.5 up to 4.2.3.
The script that I took the extract from above is on a system using 3.2.5.
-
9. Re: Do I need to restart JBoss??
peterj Mar 3, 2010 3:06 PM (in response to skewbie)I don't have any 3.2.x version sitting around any more, so I would not know about them. But for 4.0.x and 4.2.x there is a sample bindings file at docs/examples/binding-manager/sample-bindings.xml. Within that file, this entry is for the JNDI port (used by the jnp: protocol):
delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
>
<delegate-config portName="Port" hostName="BindAddress">
<attribute name="RmiPort">1098</attribute>
</delegate-config>
<binding port="1099" host="${jboss.bind.address}"/>
</service-config> -
10. Re: Do I need to restart JBoss??
peterj Mar 3, 2010 3:12 PM (in response to peterj)I found an AS 3.2.7 in a backup folder, looks like is has hte same file with the same entry. -
11. Re: Do I need to restart JBoss??
rasa Mar 4, 2010 12:54 AM (in response to peterj)Hi Peter ,
I don't know i am correct or not jnp port we can give in jboss-service.xml also rt ???. If i am wrong please correct it.In one of our jboss configuration i found the following entry
<mbean code="org.jboss.naming.NamingService"
name="jboss:service=Naming">
<!-- The listening port for the bootstrap JNP service. Set this to -1
to run the NamingService without the JNP invoker listening port.
-->
<attribute name="Port">11099</attribute>
<!-- The bootstrap JNP server bind address. This also sets the default
RMI service bind address. Empty == all addresses
-->
<attribute name="BindAddress">${jboss.bind.address}</attribute>
<!-- The port of the RMI naming service, 0 == anonymous -->
<attribute name="RmiPort">11098</attribute>
<!-- The RMI service bind address. Empty == all addresses
-->
<attribute name="RmiBindAddress">${jboss.bind.address}</attribute>
</mbean>Thanks and Regards
Rasa
-
12. Re: Do I need to restart JBoss??
peterj Mar 4, 2010 11:54 AM (in response to rasa)Yes, the JNDI ports are defined in jboss-service.xml but it is recommended that you do not modify them there. The preferred mechansim is to use the port bindings service, which uses the bindings.xml file that Steve mentioned.
In addition, while in AS 3.x and 4.x the binding service was optional (and not used by default), in 5.x, the binding service is used by default and thus you should always edit the binding file (whose name and location varies depending on the exact version of 5.x).