In this recipe, we will learn how to create a server by invoking a command to the CLI. This applies only to the domain mode.
Remember, I'm running WildFly remotely, bound to 192.168.59.103
as IP. WildFly is already up and running.
Open a new terminal window and execute the following commands:
$ cd $WILDFLY_HOME $ ./bin/jboss-cli.sh -c --controller=192.168.59.103:9990 --user=wildfly --password=cookbook.2015 --command="/host=master/server-config=server-four:add(group=main-server-group, auto-start=true, socket-binding-port-offset=450)" { "outcome" => "success", "result" => undefined, "server-groups" => undefined }
Now the server is ready, you just need to start it manually. This can be achieved by starting the servers of the server group that your new server belongs to, in this case, main-server-group
. Run the following code:
$ ./bin/jboss-cli.sh -c --controller=192.168.59.103:9990 --user=wildfly --password=cookbook.2015 --command...