Geneos


The end of life (EOL) date for this module is on 31 January, 2020.

Running as a service

CentOS/RHEL

The cluster node can be managed using the service script template provided:

#!/bin/bash
#
# /etc/init.d/oacluster
#
# Geneos OA cluster daemon
#
# chkconfig: 2345 20 80
# description: Geneos OA cluster daemon
# processname: oa-node
# pidfile: /var/run/oa-node.pid

# Source function library.
. /etc/init.d/functions

export JAVA_HOME=/opt/java/6u45-x64
export OAC_HOME=/opt/geneos/node/1.2
USERNAME=fred
NUM_NODES=2

start() {
  echo -n "Starting OA cluster with $NUM_NODES nodes..."
  daemon --user=$USERNAME $OAC_HOME/oacluster.sh --start all $NUM_NODES &>/dev/null
  RETVAL=$?
  if [ $RETVAL = 0 ]; then success; else failure; fi
  echo
  return $RETVAL
}

stop() {
  echo -n "Stopping OA cluster..."
  $OAC_HOME/oacluster.sh --kill all &>/dev/null
  RETVAL=$?
  if [ $RETVAL = 0 ]; then success; else failure; fi
  echo
  return $RETVAL
}

status() {
  $OAC_HOME/oacluster.sh --process-status all
  return $?
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  status)
    status
    ;;
  restart|reload)
    stop
    start
    ;;
  *)
    echo "Usage: oacluster {start|stop|status|restart|reload}"
    exit 1
    ;;
esac
exit $?

Before use some variables must be populated with details about your setup:

JAVA_HOME=<path to java>
OAC_HOME=<path to node binary dir>
USERNAME=<node process owner username>
NUM_NODES=<number of nodes in the cluster>

Other *nix like OSs

The oacluster.sh--start<number> script will run <number> nodes as a background process and can be used as the basis of a system specific service script. See see oacluster.sh for more details.