环境描述,solaris环境,主机上装了好几个jboss一起运行,要单独关闭其中一个jboss,当然也能用kill上进程的方式去把它杀掉,但这样每次要去找相应的进程id才行。
配置如下:
假设我们的应用是部署在jboss_home/server/default下,那么到jboss_home/server/default/conf下找到jboss-service.xml进行修改,把
<mbean code="org.jboss.naming.NamingService"
name="jboss:service=Naming"
xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
<attribute name="CallByValue">false</attribute>
<attribute name="Port">1099</attribute>
<attribute name="BindAddress">127.0.0.1</attribute>
中的1099改成我们要的端口号1299,及把127.0.01改成${jboss.bind.address},如下:
<mbean code="org.jboss.naming.NamingService"
name="jboss:service=Naming"
xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
<attribute name="CallByValue">false</attribute>
<attribute name="Port">1299</attribute>
<attribute name="BindAddress">${jboss.bind.address}</attribute>
我是把文件里所有的127.0.0.1改成${jboss.bind.address},有的版本默认就是${jboss.bind.address}
然后就可以到jboss_home/server/bin目录下,用./shutdown.sh -s jnp://localhost:1299关闭我们jboss了
其中localhost可以替换成主机的hostname