Install a worker as a service

You can configure a Deploy worker to run as a daemon (Unix) or service (Windows) so that it can run as a background process without requiring user control or intervention.

Running a worker as a daemon or service applies only to local and external workers, and not to the default in-process worker. See High availability with master-worker setup for details on worker types.

Customizing worker and service

To customize a worker before starting please follow the steps mentioned below.

Add the following properties for a worker in the xl-worker.conf file in the conf folder.

Note: Setting the values for these fields is optional, if you do not specify a value, the service will start using the default values for the properties.

  • xl.server.hostname - the hostname on which worker will be run, the default value is localhost
  • xl.server.port - port on which worker will start . The default port is 8180
  • xl.server.ssl.enabled - if set to true akka.ssl.tcp will be used, else the default value akka.tcp will be used
  • xl.worker.name - worker name (its an optional field)

The logs for a worker running as service can be found in the wrapper.log in the log folder.

Important: If you want to configure multiple workers as services, they need to be started as external workers with a separate folder for each worker.

See External worker setup for more information on setting up multiple workers as service.

For configuring multiple workers, you must also update the following attributes in the xld-wrapper-worker.conf under the conf folder with a unique worker service name.

wrapper.console.title=Deploy Worker
wrapper.ntservice.name=xl-deploy-worker
wrapper.ntservice.displayname=Deploy Worker

For example:

wrapper.console.title=Deploy Worker-2
wrapper.ntservice.name=xl-deploy-worker-2
wrapper.ntservice.displayname=Deploy Worker-2

Configure Deploy as a daemon on Unix

To install a Deploy worker to run as a daemon:

  1. Ensure that the worker is configured so that it can start without input from the user; for example, if a repository keystore password is required, then it should be provided in XL_DEPLOY_SERVER_HOME/conf/deployit.conf.
  2. Ensure that the JAVA_HOME environment variable is set correctly for the user or daemon that will be used to run the Deploy service. You can explicitly set the location of the Java executable by updating the XL_DEPLOY_HOME/bin/.wrapper-env.sh script.
  3. As root, execute XL_DEPLOY_WORKER_HOME/bin/install-service.sh worker.
  4. You are prompted for:

    • Connection details for the Deploy master (HOST:PORT)
    • The URL for the Deploy REST API

This command will install and start the daemon.

Configure Deploy as a service on Microsoft Windows

To configure Deploy worker to run as a service:

  1. Ensure that the worker is configured so that it can start without input from the user; for example, if a repository keystore password is required, then it should be provided in XL_DEPLOY_SERVER_HOME\conf\deployit.conf.
  2. Ensure that the JAVA_HOME environment variable is set correctly for the user or service that will be used to run the Deploy service and include the location of Java/bin in the Windows Path environment variable. You can explicitly set the location of the Java executable by updating the XL_DEPLOY_HOME/bin/.wrapper-env.cmd script.
  3. As an administrator, execute XL_DEPLOY_SERVER_HOME\bin\install-service.cmd worker.
  4. You are prompted for:

    • Connection details for the Deploy master (HOST:PORT)
    • The URL for the Deploy REST API

This command will install and start the service.

Uninstall the Deploy daemon or service

To remove the installed daemon or service from the system, execute XL_DEPLOY_SERVER_HOME/bin/uninstall-service.sh worker (on Unix) or XL_DEPLOY_SERVER_HOME\bin\uninstall-service.cmd worker (on Windows).