[英]How to run 2 (or more) Wildfly instances on the same machine?
I want to simulate 2 servers by running 2 independent instances of Wildfly. 我想通过运行Wildfly的2个独立实例来模拟2台服务器。 This is useful when you don't want to deploy all WARs on the same instance and then only be able to shut them down and start them together.
当您不希望在同一实例上部署所有WAR,然后只能将它们关闭并一起启动时,这非常有用。
I'm using Eclipse with the JBoss plugin where in the Servers view I want to have 2 Wildfly servers that I can stop and run separately and simultaneously. 我正在使用带有JBoss插件的Eclipse,在Servers视图中,我想拥有2台Wildfly服务器,我可以单独和同时停止和运行。 How do I do that?
我怎么做?
It's possible to duplicate your Wildfly installation folder, but that takes up more space and you would need to update both for every change. 可以复制Wildfly安装文件夹,但这会占用更多空间,您需要为每次更改更新两者。 Instead it's possible to share the root folder and just create 2 standalones:
相反,它可以共享根文件夹,只需创建2个独立站:
standalone1
and standalone2
folders from the default (or use the default as one of them). standalone1
和standalone2
文件夹(或使用默认值作为其中之一)。 deployments
folder you can choose whichever deployments you need. deployments
文件夹中选择所需的部署。 For the ports not to conflict, the configuration/standalone.xml
of one of the standalones must be changed as shown here : change the number from 0 to something else like 200 对于不冲突的端口,在
configuration/standalone.xml
的standalones之一必须改变如图所示这里 :从0改号到别的像200
port-offset="${jboss.socket.binding.port-offset:200}
Now go to Eclipse and in the Servers view create a new Server. 现在转到Eclipse并在Servers视图中创建一个新的Server。 Give it some suitable name and click next.
给它一些合适的名字然后点击下一步。
create new runtime
on the bottom dropdown menu and click next. create new runtime
,然后单击下一步。 Server base directory
choose the standalone folder name you want, like standalone1
above. Server base directory
选择所需的独立文件夹名称,如上面的standalone1
。 Do the same for other instances with different offsets (in the above 1 instance will be at 8080 and the other at 8280). 对于具有不同偏移的其他实例执行相同的操作(在上面的1个实例中将是8080而另一个是在8280)。
after doing above Mark suggested method we have to run wildfly 在做了上面马克建议的方法之后我们必须运行wildfly
in Windows 在Windows中
standalone.bat -Djboss.server.base.dir=D:/AppServer/wildfly-10.1.0.Final/standalone1
standalone.bat -Djboss.server.base.dir=D:/AppServer/wildfly-10.1.0.Final/standalone2
in Linux 在Linux中
./standalone.sh -Djboss.server.base.dir=/Users/kyle/servers/wildfly-8.2.0.Final/standalone1
./standalone.sh -Djboss.server.base.dir=/Users/kyle/servers/wildfly-8.2.0.Final/standalone2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.