11.4.2. Running EKM as a Service

Recall from Components of a Cluster Setup that the following components make up an EKM server cluster:

Startup Order:

Cluster components can be set up in different combinations, and on different hosts, so multiple configurations are possible. For any EKM cluster, these requirements apply with respect to service startup order:

If a cluster node is started before the cluster file server or cluster database server are available, the cluster node must be shut down, and restarted once all missing components are running and available.

Service Registration Scripts:

The following EKM cluster components are registered as services using scripts supplied with EKM:

EKM does not include scripts to register the following cluster components as services:

The ANSYS EKM Server product installation is used to set up the cluster database server and cluster nodes. On Windows, service registration scripts are created by the product installation. On Linux, example init scripts are provided for the cluster database server and cluster nodes.

11.4.2.1. Windows

Cluster Database Server:

A cluster database server includes scripts that can be used to register the cluster database server as a Windows service. These scripts are located in EKMDB_ROOT/bin:

  • register_ekmdb_service.cmd: Register cluster database server Windows service.

  • unregister_ekmdb_service.cmd: Unregister cluster database server Windows service.

The service registration script for the cluster database server creates the following service:

  • ANSYS EKM Database 18.2 <CLUSTERNAME>: This service corresponds to the cluster database server (MySQL) that contains the EKM database.

Cluster Node:

A cluster node includes scripts that can be used for registration of the cluster node as a Windows service. These scripts are located in EKM_NODE_ROOT182/bin:

  • register_ekm_service.cmd: Register cluster node Windows service.

  • unregister_ekm_service.cmd: Unregister cluster node Windows service.

The service registration script for the cluster node creates the following service:

  • ANSYS EKM 18.2 <CLUSTERNAME> <NODENAME>: This service corresponds to the cluster node, and controls the JBoss application server which hosts the EKM server application.

KEY:

<CLUSTERNAME>: The EKM cluster name.

<NODENAME>: The node name (node ID) of the cluster node.

11.4.2.2. Linux

The init scripts for the cluster database server and cluster nodes must be manually installed after setup of these components. Instructions for installing, registering and using these scripts follow.


Important:  Recall from the discussion of Service Names that services on a host must have unique names. Follow the instructions in Service Names to create unique service names for each cluster component.


Cluster Database Server:

To register the cluster database server as a service, use the init script for the cluster database server: EKMDB_ROOT/bin/init.d/ekmdb182

  1. Rename the script, following the naming suggestions in Renaming a Service. For example, we will use ekmdb182_EKMSERVER as the new service name:

    mv EKMDB_ROOT/bin/init.d/ekmdb182 EKMDB_ROOT/bin/init.d/ekmdb182_EKMSERVER

  2. Copy the init script to the /etc/init.d directory:

    cp EKMDB_ROOT/bin/init.d/ekmdb182_EKMSERVER /etc/init.d

  3. Edit the init script and set the EKMDB_ROOT environment variable to the base directory of the cluster database server. For example:

    EKMDB_ROOT=/home/ekmdb
  4. Edit the init script and set the EKM_USER environment variable to the user name of the EKM server account. For example:

    EKM_USER=ekm
  5. Register and enable the service:

    /sbin/chkconfig -–add ekmdb182_EKMSERVER

  6. Verify that the service is registered and enabled:

    /sbin/chkconfig -–list ekmdb182_EKMSERVER

Cluster Node:

To register a cluster node as a service, use the init script for the cluster node: EKM_NODE_ROOT182/bin/init.d/ekm182

  1. Rename the script, following the naming suggestions in Renaming a Service. For example, we’ll use ekm182_EKMSERVER_NODE1 as the new service name:

    mv EKM_NODE_ROOT182/bin/init.d/ekm182 EKM_NODE_ROOT182/bin/init.d/ekm182_EKMSERVER_NODE1

  2. Copy the init script to the /etc/init.d directory:

    cp EKM_NODE_ROOT182/bin/init.d/ekm182_EKMSERVER_NODE1 /etc/init.d

  3. Edit the init script and set the EKM_BASE environment variable to the base directory of the cluster node. For example:

    EKM_NODE_ROOT=/home/ekm/node1
  4. Edit the init script and set the EKM_USER environment variable to the user name of the EKM server account. For example:

    EKM_USER=ekm
  5. Register and enable the service:

    /sbin/chkconfig -–add ekm182_EKMSERVER_NODE1

  6. Verify that the service is registered and enabled:

    /sbin/chkconfig -–list ekm182_EKMSERVER_NODE1

The EKM init scripts accept the following command-line arguments:

  • start: starts the service

  • stop: stops the service

  • restart: restarts the service

When a cluster component is registered as a service, the service starts at system startup, and stops at system shutdown. The init script can also be run directly from the command-line to stop, start, and restart the service.


Release 18.2 - © ANSYS, Inc. All rights reserved.