有没有一种简单的方法来创建一个新的 Wildfly 服务器实例 [英] Is there an easy way to create a new Wildfly server instance

查看:15
本文介绍了有没有一种简单的方法来创建一个新的 Wildfly 服务器实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种简单的方法来创建一个新的 Wildfly 服务器实例.

Is there an easy way to create a new Wildfly server instance.

在 JBoss AS5 中,您所要做的就是创建一个 default 或 all 的副本,然后使用以下命令启动 jboss:

In JBoss AS5 all you had to do is create a copy of default or all and start jboss with:

run.sh -c [New instance name]

standalone.sh

推荐答案

从 JBoss AS7 开始并在 WildFly 中继续的变化是,整个服务器配置保存在单个文件中.准备了大约 4 个默认配置(或配置文件):

The change which started with the JBoss AS7 and continues in WildFly is, the whole server configuration is hold in a single file. There are prepared some 4 default configurations (or profiles):

  • 默认(standalone.xml - 默认使用 - 没有集群和消息传递)
  • HA (standalone-ha.xml - 支持集群)
  • 完整(standalone-full.xml - 支持消息传递)
  • 完整的 HA(standalone-full-ha.xml - 支持消息传递和集群)
  • default (standalone.xml - used by default - without clustering and messaging)
  • HA (standalone-ha.xml - supports clustering)
  • Full (standalone-full.xml - supports messaging)
  • Full HA (standalone-full-ha.xml - supports both messaging and clustering)

要使用自定义配置文件,请使用 -c 开关启动服务器

To use the custom profile start the server with using -c switch

./standalone.sh -c standalone-full-ha.xml

如果只需要改变服务器配置,可以直接编辑配置文件的XML文件,使用CLI工具(jboss-cli.sh/bat)或管理控制台.

If you only need to change the server configuration, you can edit the profile XML files directly, use CLI tool (jboss-cli.sh/bat) or management console.

如果您想进行更大的更改(例如,standalone/deployments 目录中的不同应用程序),您可以复制整个 standalone 目录并根据需要编辑每个副本.我使用以下方式启动两个集群服务器:

If you want to do bigger changes (e.g. different applications in standalone/deployments directory), you can copy the whole standalone directory and edit each copy as necessary. I use following way for starting two clustered server:

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 上运行的网络).

This example creates 2 copies from a clean standalone configuration and starts a server for each copy. The second server have port offset 200 (e.g. web running on port 8280).

这篇关于有没有一种简单的方法来创建一个新的 Wildfly 服务器实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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