Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

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]

There is no such option available in standalone.sh

like image 790
javapenguin Avatar asked Mar 19 '23 04:03

javapenguin


1 Answers

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):

  • 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)

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

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

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.

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 &

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).

like image 113
kwart Avatar answered Mar 20 '23 16:03

kwart