Two node WildFly installation on Windows - CustomerID

Ubisecure SSO service needs to be stopped at this point if SSO is installed on the same server as CID and SSO is using port 8443.

net stop UbiloginServer

First, extract the WildFly distribution package and place it in %PROGRAMFILES%, so that the resulting home folder for WildFly becomes %PROGRAMFILES%\wildfly-x.x.x.Final. This folder will be referred to as %WILDFLY_HOME%.
Copy the docs\contrib\scripts\service folder to  %WILDFLY_HOME%\bin folder, so that the resulting path is %WILDFLY_HOME%\bin\service

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 file

cd /D "%WILDFLY_HOME%\bin\service"
notepad service.bat 

Find the following line: 

  if "%BASE%"=="" set BASE="%JBOSS_HOME%\domain"

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

  if "%BASE%"=="" set BASE=%JBOSS_HOME%\domain


In the same service.bat file, uncomment and set the domain mode configuration parameters:

set IS_DOMAIN=true
set CONFIG=domain.xml
set HOSTCONFIG=host.xml

Having done that, use service.bat to install WildFly as a Windows Service: 

cd /D "%WILDFLY_HOME%\bin\service"
service.bat install

Windows service shutdown parameters

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

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.

Fix Slave Node shutdown parameters
cd /D "%WILDFLY_HOME%\bin
set NOPAUSE=Y
C:\Program Files\wildfly-21.0.2.Final\bin>jboss-cli.bat --connect --command=/host=customerid-slave:shutdown
{
   "outcome" => "success",
   "result" => undefined
}

C:\Program Files\wildfly-21.0.2.Final\bin>cd service
C:\Program Files\wildfly-21.0.2.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-21.0.2.Final\bin\service>net start wildfly
 The Wildfly service is starting.
 The Wildfly service was started successfully.

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)


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:

Starting WildFly
net start wildfly

Uninstalling WildFly

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. 

net stop wildfly
cd /D "%WILDFLY_HOME%\bin\service"
service.bat uninstall

Then either delete the WildFly installation folder or backup it to a different location.