7.3.2. Deploy the EKM Server Application

The EKM Server application is deployed to the domain by default during ANSYS EKM Server product installation. It is not necessary to deploy the EKM Server application again except in specific circumstances. This task is documented here for reference.

The EKM Server application can be deployed to the domain either through the JBoss Web Management Interface, or through the JBoss CLI (command-line interface). The JBoss CLI may be executed in either interactive or scripted mode.


Note:  The EKM .WAR file is found at the following location: EKM_HOME/ekm-18.2.war


JBoss Web Management Interface:

Follow these steps to deploy the EKM Server application to the JBoss domain using the JBoss Web Management Interface:

  1. Start EKM on each EKM cluster node. This will start the host controller and process controller on each JBoss instance.

  2. Log into the JBoss Web Management Interface on the JBoss domain controller[9].

    http://node1.mycompany.com:9990

    Log in using the credentials of the management user you configured for accessing the JBoss Web Management Interface.

  3. Select the Deployments tab.

  4. Under Server Groups > Server Group, select the server group ekm-server-group.

  5. Under Deployments, click Add to add the EKM .WAR file as a deployment. You will need to access a copy of the EKM .WAR file that is installed with the EKM server, from the system running the browser you are using to access the JBoss Web Management Interface.

    1. A dialog box titled Add deployment to server group 'ekm-server-group' opens.

    2. Choose Upload a new deployment, then click Next.

    3. In the Upload Deployment step, click Browse and browse to the EKM .WAR file, then click Next.

    4. In the Verify Upload step, verify the deployment names (no changes are required) and enable the deployment by checking the Enable check box. Click Finish to add and enable the deployment.

The EKM Server application will now start on all EKM cluster nodes. Watch the JBoss logs on each EKM cluster node to make sure that the EKM Server application starts correctly.

JBoss CLI (Interactive):

The JBoss CLI (command-line interface) can be used in online or offline mode. Online mode is used when the JBoss host controller and process controller are running. Offline mode is used when no JBoss processes are running.

In either mode, the JBoss CLI can be used interactively, or can be automated by executing a script.

The JBoss CLI launch script is located at the following path on each EKM cluster node:

JBOSS_HOME/bin/jboss-cli.(bat|sh)

Follow these steps to deploy the EKM server application to the JBoss domain using the JBoss CLI (command-line interface) interactively:

  1. Launch the JBoss CLI using the JBoss CLI launch script. The process for launching the JBoss CLI differs for online and offline mode, as shown below:

    Online mode:

    In online mode, the JBoss CLI connects to the management network interface and port on the JBoss domain controller (marked in bold), for example[10]:

    ./jboss-cli.sh –c –controller=192.168.1.3:9999

    Once the JBoss CLI is launched, you will see a prompt where you can enter CLI commands:

    [domain@192.168.1.3:9999 /]

    Offline mode:

    In offline mode, the JBoss CLI uses an “embedded host controller” which provides access to the domain and host configuration. Launch the JBoss CLI as follows:

    ./jboss-cli.sh

    Once the JBoss CLI is launched, you will see a prompt where you can enter CLI commands:

    [disconnected /]

    Start the embedded host controller as follows:

    [disconnected /] embed-host-controller --domain-config=ekm.xml

    Once the embedded host controller is started, the prompt will change to:

    [domain@embedded /]
  2. To deploy the EKM .WAR file to the server group: ekm-server-group, enter the command below, substituting the full path to the EKM .WAR file (marked in bold):

    [domain@address /] deploy EKM_HOME/ekm-18.2.war --server-groups=ekm-server-group

    If the command is executed in online mode, the EKM Server application will start on all EKM cluster nodes.

    If the command is executed in offline mode, the EKM Server application will start when the EKM cluster nodes are started.

    Watch the JBoss logs on each EKM cluster node to make sure that the EKM Server application starts correctly.

  3. To undeploy the EKM .WAR file, enter the command below:

    [domain@address /] undeploy --name=ekm-18.2.war --server-groups=ekm-server-group
  4. To exit the JBoss CLI, enter the following commands:

    Online mode:

    [domain@address /] quit

    Offline mode:

    Stop the embedded host controller before quitting, as shown:

    [domain@address /] stop-embedded-host-controller
    [domain@address /] quit

JBoss CLI (Script):

In addition to interactive use, JBoss CLI can execute CLI commands from a script. The steps above could be accomplished equivalently by running a script that executes JBoss CLI commands, as shown in the following examples.

In these examples, values marked in bold must be modified to match your EKM server installation. Create and execute the script on the primary EKM cluster node. These examples demonstrate scripting the deployment or undeployment of the EKM .WAR file.

These examples can be used in either online or offline mode.

Linux:

ekm_deployment_manager.sh:

#!/bin/sh

#Set these variables to match your EKM server 
EKM_ROOT=/server/share/ekm
EKM_NODE_ROOT=/server/share/ekm/node1
JBOSS_MANAGEMENT_IP=192.168.1.3
JBOSS_PORT_OFFSET=0

#Do not modify below this line
EKM_ROOTVN=$EKM_ROOT/v182
EKM_NODE_ROOTVN=$EKM_NODE_ROOT/v182
EKM_WAR_NAME=ekm-18.2.war
JBOSS_MANAGEMENT_NATIVE_PORT=9999
JBOSS_MANAGEMENT_NATIVE_PORT=$(expr $JBOSS_MANAGEMENT_NATIVE_PORT + $JBOSS_PORT_OFFSET)
export JBOSS_HOME=$EKM_NODE_ROOTVN/programs/wildfly-10.0.0.Final
export JAVA_HOME=$EKM_ROOTVN/programs/jdk1.8.0_121

showUsage() {
  echo
  echo "Usage: $0 <command> <mode>"
  echo
  echo "Where command: deploy or undeploy"
  echo "Where mode: online or offline"
  echo
  exit 1
}

if [ -z "$1" ] || [ -z "$2" ]; then
    showUsage
fi

#Set JBoss CLI command
COMMAND=$1
if [ "$COMMAND" != "deploy" ] && [ "$COMMAND" != "undeploy" ]; then
    showUsage
fi

#Set JBoss CLI mode
CLI_MODE=$2
if [ "$CLI_MODE" != "online" ] && [ "$CLI_MODE" != "offline" ]; then
    showUsage
fi

#Set EKM WAR
if [ "$COMMAND" == "deploy" ] ; then
    EKM_WAR=$EKM_ROOTVN/ekm-server/$EKM_WAR_NAME
else
    EKM_WAR=$EKM_WAR_NAME
fi

#Set JBoss CLI arguments
if [ "$CLI_MODE" == "online" ] ; then
    CLI_ARGS="--connect
        --controller=remoting://$JBOSS_MANAGEMENT_IP:$JBOSS_MANAGEMENT_NATIVE_PORT
        --commands='$COMMAND $EKM_WAR --server-groups=ekm-server-group'"
else
    CLI_ARGS="--commands='embed-host-controller --domain-config=ekm.xml,$COMMAND 
    $EKM_WAR --server-groups=ekm-server-group, stop-embedded-host-controller'"
fi

#Execute JBoss CLI
echo $JBOSS_HOME/bin/jboss-cli.sh $CLI_ARGS
$JBOSS_HOME/bin/jboss-cli.sh $CLI_ARGS

Windows:

ekm_deployment_manager.cmd:

@echo off

rem Set these variables to match your EKM server
set EKM_ROOT=c:\ekm
set EKM_NODE_ROOT=c:\ekm\node1
set JBOSS_MANAGEMENT_IP=192.168.1.3
set JBOSS_PORT_OFFSET=0

rem Do not modify below this line
set EKM_ROOTVN=%EKM_ROOT%\v182
set EKM_NODE_ROOTVN=%EKM_NODE_ROOT%\v182
set EKM_WAR_NAME=ekm-18.2.war
set JBOSS_MANAGEMENT_NATIVE_PORT=9999
set /a JBOSS_MANAGEMENT_NATIVE_PORT=%JBOSS_MANAGEMENT_NATIVE_PORT% + %JBOSS_PORT_OFFSET%
set JBOSS_HOME=%EKM_NODE_ROOTVN%\programs\wildfly-10.0.0.Final
set JAVA_HOME=%EKM_ROOTVN%\programs\jdk1.8.0_121

if "%~1"=="" goto :SHOW_USAGE
if "%~2"=="" goto :SHOW_USAGE

rem Set JBoss CLI command
set COMMAND=%1
if /i not %COMMAND%==deploy (if /i not %COMMAND%==undeploy goto :SHOW_USAGE)

rem Set JBoss CLI mode
set CLI_MODE=%2
if /i not %CLI_MODE%==online (if /i not %CLI_MODE%==offline goto :SHOW_USAGE)

rem Set EKM WAR
if /i %COMMAND%==deploy (
    set EKM_WAR=%EKM_ROOTVN%\ekm-server\%EKM_WAR_NAME%
) else (
    set EKM_WAR=%EKM_WAR_NAME%
)

rem Set JBoss CLI arguments
if /i %CLI_MODE%==online (
    set CLI_ARGS=--connect
      --controller=remoting://%JBOSS_MANAGEMENT_IP%:%JBOSS_MANAGEMENT_NATIVE_PORT%
      --commands="%COMMAND% %EKM_WAR% --server-groups=ekm-server-group"
) else (
    set CLI_ARGS=--commands="embed-host-controller --domain-config=ekm.xml, %COMMAND% 
    %EKM_WAR% --server-groups=ekm-server-group, stop-embedded-host-controller"    
)

rem Execute JBoss CLI
set NOPAUSE=true
echo %JBOSS_HOME%\bin\jboss-cli.bat %CLI_ARGS%
call %JBOSS_HOME%\bin\jboss-cli.bat %CLI_ARGS%
goto :EOF

:SHOW_USAGE
echo/
echo Usage: %~nx0 ^<command^> ^<mode^>
echo/
echo Where command: deploy or undeploy
echo Where mode: online or offline
echo/
goto :EOF

Note:  The JBoss CLI “deploy” command does not currently support Windows UNC paths. You must provide a local file system path for the EKM .WAR file.




[9] The port number used to connect to the JBoss Web Management Interface is subject to change according to the JBoss port offset used. See Appendix D: Resolving Network Port Conflicts.

[10] The port number used to connect to the JBoss CLI is subject to change according to the JBoss port offset used. See Appendix D: Resolving Network Port Conflicts.


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