I want to run JBoss 4.2.3 and JBoss 5.1 on the same server, but not simultaneously. I just need to be able to switch back and forth between the two for testing, so I don't need to change ports or anything like that. My problem is the JBOSS_HOME environment variable. When I set up a /soft/JBoss-4.2.3.GA directory and a /soft/JBoss-5.1.0.GA directory I can run the respective bin run.sh commands, however, both try to use the $JBOSS_HOME and $PATH environment variables which are set to the first installation (JBoss-4.2.3). So, how can I set separate environment variables? Or tell my new JBoss 5.1 installation to use another environment variable for JBOSS_HOME? How would I go about getting these two running together? Thanks!
我想在同一台服务器上运行JBoss 4.2.3和JBoss 5.1,但不能同时运行。我只需要能够在两者之间来回切换进行测试,所以我不需要更改端口或类似的东西。我的问题是JBOSS_HOME环境变量。当我设置/soft/JBoss-4.2.3.GA目录和/soft/JBoss-5.1.0.GA目录时,我可以运行相应的bin run.sh命令,但是,两者都尝试使用$ JBOSS_HOME和$ PATH环境变量,设置为第一次安装(JBoss-4.2.3)。那么,我该如何设置单独的环境变量?或者告诉我的新JBoss 5.1安装为JBOSS_HOME使用另一个环境变量?我怎样才能让这两个一起跑?谢谢!
3 个解决方案
#1
A fast solution would be to set the $JBOSS_HOME and $PATH variable within the run.sh to the appropiate directory of each JBoss instance.
一个快速的解决方案是将run.sh中的$ JBOSS_HOME和$ PATH变量设置为每个JBoss实例的适当目录。
#2
The best solution in this case is use virtual ip interface, you will keep the default ports and will just change de IP address.
在这种情况下,最好的解决方案是使用虚拟IP接口,您将保留默认端口,并且只会更改de IP地址。
to start jboss doing binding to another IP just add this parameter in the run.sh (or persistent in run.conf):
要启动jboss绑定到另一个IP,只需在run.sh中添加此参数(或在run.conf中持久化):
sh run.sh -b 192.168.0.1
and the other instance just start point to another IP
而另一个实例只是开始指向另一个IP
sh run.sh -b 192.168.0.2
#3
I had a similar problem recently and my workaround is a pair of wrapper scripts for each version of JBoss AS.
我最近遇到了类似的问题,我的解决方法是为每个JBoss AS版本提供一对包装脚本。
#1
A fast solution would be to set the $JBOSS_HOME and $PATH variable within the run.sh to the appropiate directory of each JBoss instance.
一个快速的解决方案是将run.sh中的$ JBOSS_HOME和$ PATH变量设置为每个JBoss实例的适当目录。
#2
The best solution in this case is use virtual ip interface, you will keep the default ports and will just change de IP address.
在这种情况下,最好的解决方案是使用虚拟IP接口,您将保留默认端口,并且只会更改de IP地址。
to start jboss doing binding to another IP just add this parameter in the run.sh (or persistent in run.conf):
要启动jboss绑定到另一个IP,只需在run.sh中添加此参数(或在run.conf中持久化):
sh run.sh -b 192.168.0.1
and the other instance just start point to another IP
而另一个实例只是开始指向另一个IP
sh run.sh -b 192.168.0.2
#3
I had a similar problem recently and my workaround is a pair of wrapper scripts for each version of JBoss AS.
我最近遇到了类似的问题,我的解决方法是为每个JBoss AS版本提供一对包装脚本。