...
Code Block | ||
---|---|---|
| ||
set WILDFLY_HOME=%PROGRAMFILES%\wildfly-x.x.x.Final cd /D %WILDFLY_HOME%\bin xcopy /SI ..\docs\contrib\scripts\service service |
Due to a bug in the standard WildFly distribution package, edit the service.bat fileUse service.bat to install WildFly as a Windows Service.
WildFly uses Apache Procrun in order to run the application as a Windows service. If needed, you can verify the current Procrun settings from Windows Registry as advised here: https://commons.apache.org/proper/commons-daemon/procrun.html. (With the current WildFly version the print
command is not available).
Master node
Code Block | ||
---|---|---|
| ||
cd /D "%WILDFLY_HOME%\bin\service"
notepad service.bat |
Find the following line:
Code Block | ||
---|---|---|
| ||
if "%BASE%"=="" set BASE="%JBOSS_HOME%\domain" |
and remove the quotes from the value, like this::
Code Block | ||
---|---|---|
| ||
if "%BASE%"=="" set BASE=%JBOSS_HOME%\domain |
...
Code Block | ||
---|---|---|
| ||
set IS_DOMAIN=true
set CONFIG=domain.xml
set HOSTCONFIG=host.xml |
...
install /host |
Slave node
Code Block | ||
---|---|---|
| ||
cd /D "%WILDFLY_HOME%\bin\service" service.bat install | ||
/host customerid-slave |
Note | |||||||
---|---|---|---|---|---|---|---|
|
Code Block |
---|
StopParams="/c jboss-cli.bat --controller=localhost:9990 --connect --command=/host=master:shutdown" |
When running domain mode you need to change host
on the Slave Node for shutdown to be customerid-slave
instead of master
.
Also you may desire to configure management interface different from the default localhost:9990
.
The command above already specifies the becoming host name for the secondary node: customerid-slave
. The host name will be changed in this step in the CustomerID two node installation:
- Configure WildFly on CustomerID Slave Node. See instructions from Two node slave WildFly configuration on Windows - CustomerID
If you need to shutdown Wildfly service before this step with the default name (master
) you need to use JBoss CLI:
Code Block | ||||
---|---|---|---|---|
| ||||
cd /D "%WILDFLY_HOME%\bin set NOPAUSE=Y C:\Program Files\wildfly-x.x.x.Final\bin>jboss-cli.bat --connect --command=/host=customerid-slavemaster:shutdown { "outcome" => "success", "result" => undefined } C:\Program Files\wildfly-x.x.x.Final\bin>cd service C:\Program Files\wildfly-x.x.x.Final\bin\service>wildfly-service update Wildfly --StopParams="/c jboss-cli.bat --controller=localhost:9990 --connect --command=/host=customerid-slave:shutdown" C:\Program Files\wildfly-x.x.x.Final\bin\service>net start wildfly The Wildfly service is starting. The Wildfly service was started successfully. |
You can
...
You can now start the WildFly service by opening the View Local Services functionality and locating WildFly server, right-clicking and selecting Start, or using the net start command:
...
In case you need to uninstall WildFly here are the instructions for it. To uninstall the service, invoke the service.bat with the uninstall parameter.
If you need to uninstall WildFly on the secondary node, see the note above About slave Windows service configuration and shutdown.
Code Block | ||
---|---|---|
| ||
net stop wildfly cd /D "%WILDFLY_HOME%\bin\service" service.bat uninstall |
...