Start Server (Groovy)

October 3, 2013

Download

Start Server sample script for Liberty Collectives using Groovy.

Description

In IBM WebSphere Application Server Network Deployment Version 8.5.5, Liberty profile has introduced the Liberty collective feature. Refer to information about collectives in the IBM WebSphere Application Server Version 8.5.5 information center for more specifics.

The startServer.groovy sample demonstrates how to call the ServerCommands MBean from a Groovy script to start a collective member server.

  • The ServerCommands MBean operation used:
    • startServer

startServer.groovy script

The startServer sample script demonstrates how to start a collective member with the given member host name, usr directory and member name. A connection is made to the collective controller located at the given host and https port, and the request to start the server is passed to the ServerCommands MBean.

Note that the server host name and collective controller host name do not need to be the same.

Server commands require remote execution and access (RXA). Before running this sample script, ensure each target system is configured for remote access. For more information on the remote execution and access requirements and setup, refer to Requirements for using Remote Execution and Access (RXA) in the information center.

This sample can be installed onto runtime version 8.5.5.0.

Instructions

Required parameters

--serverName The name of the member server to start.
--serverHost The host name where the collective member is installed.
--serverUsrdir The usr directory where the collective member is installed.
--truststore The path to the truststore to be used when establishing a connection to the collective controller.
--truststorePassword The password for the truststore specified by the --truststore parameter.
--host The host name where the collective controller is running.
--port The https port where the collective controller is listening.
--user The user name to use when connecting to the collective controller.
--password The password to use when connecting to the collective controller.

Optional parameters

--help Displays help text.

Sample use and resulting messages

groovy startServer.groovy –serverName=member1 –serverHost=host.com –serverUsrdir=C:\wlp\usr –truststore=C:\wlp\usr\servers\controller1\resources\security\trust.jks –truststorePassword=tsPassword –host=host.com –port=9443 –user=admin –password=password

Connecting to the server…
Successfully connected to the server “host.com:9443″
Server started successfully

Example usage

>> groovy startServer.groovy --serverName=member1
  --serverHost=host.com --serverUsrdir=C:\wlp\usr
  --truststore=C:\wlp\usr\servers\controller1\resources\security\trust.jks
  --truststorePassword=tsPassword --host=host.com --port=9443
  --user=admin --password=password Connecting to the server...

  Successfully connected to the server "host.com:9443" Server started successfully

Notes

The following additional sample scripts provide shared code which is used by this sample:

  • MBeanArgsParser.groovy
  • ServerCommand.groovy

Sample Structure

  • Copyright.txt
  • lib
    • MBeanArgsParser.groovy
    • ServerCommand.groovy
  • readme.html
  • startServer.groovy