有没有一种简单的方法来创建一个新的 Wildfly 服务器实例。
在 JBoss AS5 中,您所要做的就是创建一个 default 或 all 的副本并使用以下命令启动 jboss:
run.sh -c [New instance name]
standalone.sh
中没有这样的选项可用
最佳答案
从 JBoss AS7 开始并在 WildFly 中继续的变化是,整个服务器配置保存在一个文件中。准备了一些 4 个默认配置(或配置文件):
standalone.xml
- 默认使用 - 没有集群和消息传递)standalone-ha.xml
- 支持集群) standalone-full.xml
- 支持消息传递)standalone-full-ha.xml
- 支持消息传递和集群)要使用自定义配置文件,请使用
-c
启动服务器转变./standalone.sh -c standalone-full-ha.xml
如果您只需要更改服务器配置,您可以直接编辑配置文件 XML 文件,使用 CLI 工具 (
jboss-cli.sh/bat
) 或管理控制台。如果你想做更大的改变(例如
standalone/deployments
目录中的不同应用程序),你可以复制整个 standalone
目录并根据需要编辑每个副本。我使用以下方式启动两个集群服务器:cd $JBOSS_HOME
cp -r standalone standalone1; cp -r standalone standalone2
# edit the configs here if necessary ...
bin/standalone.sh -c standalone-ha.xml \
-Djboss.server.base.dir=`pwd`/standalone1 \
-Djboss.node.name=host1 &
bin/standalone.sh -c standalone-ha.xml \
-Djboss.server.base.dir=`pwd`/standalone2 \
-Djboss.node.name=host2 \
-Djboss.socket.binding.port-offset=200 &
此示例从干净的
standalone
创建 2 个副本配置并为每个副本启动一个服务器。第二个服务器的端口偏移量为 200(例如,在端口 8280 上运行的 Web)。
关于jboss5.x - 有没有一种简单的方法来创建一个新的 Wildfly 服务器实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26400059/