Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagetext
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
languagetext
cd /D "%WILDFLY_HOME%\bin\service"
notepad service.bat 

Find the following line: 

Code Block
languagetext
  if "%BASE%"=="" set BASE="%JBOSS_HOME%\domain"

and remove the quotes from the value, like this:: 

Code Block
languagetext
  if "%BASE%"=="" set BASE=%JBOSS_HOME%\domain

...

Code Block
languagetext
set IS_DOMAIN=true
set CONFIG=domain.xml
set HOSTCONFIG=host.xml

...

install /host

Slave node

info
Code Block
languagetext
cd /D "%WILDFLY_HOME%\bin\service"
service.bat install
 /host customerid-slave


Wildfly uses Apache Procrun in order to run the application as a Windows service. For shutdown the following stop parameters are configured by default.

Note
titleAbout slave Windows service configuration and shutdown parameters
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.

These changes can be done after all the other Two node installation on Windows steps. The service needs to be restarted in order to put the changes into effect.

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:

If you need to shutdown Wildfly service before this step with the default name (master) you need to use JBoss CLI:

Code Block
languagetext
titleFix Slave Node shutdown parameters
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
languagetext
net stop wildfly
cd /D "%WILDFLY_HOME%\bin\service"
service.bat uninstall

...