如何在同一台计算机上运行2个(或更多)Wildfly实例? [英] How to run 2 (or more) Wildfly instances on the same machine?

查看:410
本文介绍了如何在同一台计算机上运行2个(或更多)Wildfly实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过运行2个Wildfly独立实例来模拟2个服务器.当您不想在同一实例上部署所有WAR,然后只能将它们关闭并一起启动时,这很有用.

I want to simulate 2 servers by running 2 independent instances of Wildfly. 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.

我正在使用带有JBoss插件的Eclipse,在服务器"视图中,我想拥有2个Wildfly服务器,可以分别停止并同时运行它们.我该怎么办?

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. How do I do that?

推荐答案

可以复制Wildfly安装文件夹,但这会占用更多空间,并且每次更改都需要更新两者.相反,可以共享根文件夹并仅创建2个独立文件夹:

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. Instead it's possible to share the root folder and just create 2 standalones:

  1. 在安装文件夹中,从默认文件夹创建新的standalone1standalone2文件夹(或使用默认文件夹作为其中之一).
  2. 在那里,您可以在deployments文件夹中选择所需的任何部署.
  3. 为避免端口冲突,必须更改其中一个独立服务器的configuration/standalone.xml,如此处:将数字从0更改为200之类的

  1. In the installation folder, create new standalone1 and standalone2 folders from the default (or use the default as one of them).
  2. In there, in the deployments folder you can choose whichever deployments you need.
  3. 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

port-offset="${jboss.socket.binding.port-offset:200}

  • 现在转到Eclipse,然后在服务器"视图中创建一个新的服务器.给它起一个合适的名称,然后单击下一步.

  • Now go to Eclipse and in the Servers view create a new Server. Give it some suitable name and click next.

    对其他具有不同偏移量的实例执行相同的操作(在上面的1个实例中为8080,另一个在8280).

    Do the same for other instances with different offsets (in the above 1 instance will be at 8080 and the other at 8280).

    这篇关于如何在同一台计算机上运行2个(或更多)Wildfly实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆