Running the TIBCO Cloud™ Integration - Hybrid Agent as a Windows Service
Improve TIBCO Cloud Integration - Hybrid Agent reliability by registering the Hybrid Agent as a Windows Service. If the Windows server hosting the Hybrid Agent is shut down for any reason, Windows restarts the Hybrid Agent service when the server is restarted.
Note: Only a Hybrid Agent used for Hybrid Connectivity can be configured as a Windows Service. Hybrid Agents used to manage remote apps must be installed in a Kubernetes environment.
Considerations
- Before you configure the Hybrid Agent as a Windows Service, configure the Agent for Hybrid Connectivity using the information in Downloading, Configuring, and Running the Hybrid Agent.
- After downloading the Agent, make note of the directory where you have stored the agent executable, such as C:\TIBCO\agent. That information is necessary when setting environment variables.
- If you plan to run multiple Hybrid Agents as Windows Services, configure the agent with a unique agent name and port. The Windows Service name must also be unique for each instance that is running.
- See the official Microsoft documentation on the usage of the sc command. See sc.exe create.
Procedure
- Open a Windows Command Prompt as an Administrator. Administrator access is required to create Windows services.
- Set up the following environment variables. Be sure to set the values for TIBAGENT_CONFIG_DIR, TIBAGENT_EXECUTABLE, and TIBAGENT_LOG_FILE to match your environment. The TIBAGENT_SERVICE_NAME variable must be unique for each Agent running on the same machine.
set TIBAGENT_CONFIG_DIR=C:\TIBCO\Agent\.tibagent
set TIBAGENT_EXECUTABLE=C:\TIBCO\Agent\tibagent.exe
set TIBAGENT_LOG_FILE=C:\TIBCO\Agent\logs\.tibagent\log-file.log
set TIBAGENT_SERVICE_NAME=tibagent
set TIBAGENT_SERVICE_DESCRIPTION="TIBCO Cloud Integration - Hybrid Agent" - Configure the Hybrid Agent.
%TIBAGENT_EXECUTABLE% configure agent --port 7816 --config-dir %TIBAGENT_CONFIG_DIR% yourAgentName
- Create the Windows Service for the Hybrid Agent.Important: The Windows Service must be created with an administrator user account and password.
sc create %TIBAGENT_SERVICE_NAME% binpath= "%TIBAGENT_EXECUTABLE% start agent --log-file %TIBAGENT_LOG_FILE% yourAgentName" obj= adserver\administrator password= yourPassword
- Configure the Service Description. This step is optional.
sc description %TIBAGENT_SERVICE_NAME% %TIBAGENT_SERVICE_DESCRIPTION%
- Run the tibagent Windows Service from the command line.
sc start %TIBAGENT_SERVICE_NAME%
- To stop the tibagent Windows Service, enter the following on the command line.
sc stop %TIBAGENT_SERVICE_NAME%
- To delete the tibagent Windows Service, enter the following on the command line.
sc delete %TIBAGENT_SERVICE_NAME%