Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

Some users wish to perform maintenance on servers used in a JS7 - Agent Cluster without shutting down the related Subagent(s).

  • One option is to disable a given Subagent. The related operation is available from the Manage Controllers/Agents view for each Subagent.
    • In an active-passive Subagent Cluster the next Subagent will become active.
    • In an active-active Subagent Cluster the remaining Subagents will share the load.
    • Disabling a Subagent is an operation applied to all Subagent Clusters that include the given Subagent. The operation might not be applicable in a situation when an active Subagent should be switched disabled in a specific Subagent Cluster only.
  • To switch a Subagent in a specific Subagent Cluster users can run a script that will access use the JS7 - REST Web Service API to perform the following actions:
    • In an active-passive Subagent Cluster the next standby Subagent or a specific standby Subagent will become active.
    • For an active-active Subagent Cluster the operation makes no sense as all Subagents will be used independently of their precedence.

...

  • --url
  • --controller-id
    • Specifies the identification of the Controller that holds related orders.
  • --user
    • Specifies the user account for login to JOC Cockpit. If JS7 - Identity Services are available for Client authentication certificates that are specified with the --client-cert and --client-key options then their common name (CN) attribute has to match the user account.
    • If a user account is specified then a password can be specified using the --password option or interactive keyboard input can be prompted using the -p switch.
  • --password
    • Specifies the password used for the account specified with the --user option to login to JOC Cockpit.
    • Consider use of the -p switch offering a secure option for interactive keyboard input.
  • --cacert
    • Specifies the path to a .pem file that holds the Root CA Certificate and optionally Intermediate CA Certificates to verify HTTPS connections to JOC Cockpit.
  • --client-cert
    • Specifies the path to a .pem file that holds the Client Certificate if HTTPS mutual authentication is used..
  • --client-key
    • Specifies the path to a .pem file that holds the Client Privae Key if HTTPS mutual authentication is used..
  • --agent-cluster-id
    • Specifies the Identifier of an existing Agent Cluster.
  • --subagent-cluster-id
    • Specifies the identifier of an existing Subagent Cluster.
  • --active
    • Specifies the Subagent ID of a specific Subagent that should take be assigned the active role.
    • The Subagent will be assigned the highest priority in the Subagent Cluster.
    • The option cannot be used with the --switch and --check switches.
  • --log-dir
    • If a log directory is specified then the script will log information about processing steps to a log file in this directory.
    • File names are created according to the pattern: set_job_resource.<yyyy>-<MM>-<dd>T<hh>-<mm>-<ss>.log
    • For example: set_job_resource.2022-03-19T20-50-45.log

...

  • -h | --help
    • Displays usage.
  • -p | --password
    • Asks the user for interactive keyboard input of the password used for the account specified with the --user option..
    • The switch is used to secure interactive input as an alternative to use of the option --password=<password>.
  • -c | --check
    • Displays the list of Subagents in the given Subagent Cluster without modifying the Subagent Cluster.
    • The switch cannot be used with the --switch switch and not with the --active option..
  • -s | --switch
    • Specifies that the Subagent with highest priority and the next Subagent should switch the active role.
    • The switch cannot be used with the --check switch and with the --active option..
  • -v | --verbose
    • Displays verbose log output.
  • --show-logs
    • Displays the log output created by the script if the --log-dir option is used.
  • --make-dirs
    • If directories are missing that are indicated with the --log-dir option then they will be created.

...

The following examples illustrate typical use cases.

...

Display the list of Subagents and

...

priorities in a given Subagent Cluster

Code Block
titleExample for Cancelling OrdersSwitching Subagents
linenumberstrue
./switch-subagent-cluster.sh \
    --url=http://joc-2-0-primary:7446 \
    --user=root \
    --password=root \
    --controller-id=controller \
    --agent-cluster-id=agent_cluster_001 \
    --subagent-cluster-id=active-passive-all-agents \
    --check

# displays the list of Subagents und priorities in the given Subagent Cluster
# does not modify the Subagent Cluster

...

Code Block
titleExample for Cancelling OrdersSwitching Subagents
linenumberstrue
./switch-subagent-cluster.sh \
    --url=http://joc-2-0-primary:7446 \
    --user=root \
    --password=root \
    --controller-id=controller \
    --agent-cluster-id=agent_cluster_001 \
    --subagent-cluster-id=active-passive-all-agents \
    --switch

# switches the active role from the Subagent with the highest priority in the given Subagent Cluster to the Subagent with the next priority

...

Switch the active role to a specific Subagent in an active-passive Subagent Cluster

Code Block
titleExample for Cancelling OrdersSwitching Subagents
linenumberstrue
./switch-subagent-cluster.sh \
    --url=http://joc-2-0-primary:7446 \
    --user=root \
    --password=root \
    --controller-id=controller \
    --agent-cluster-id=agent_cluster_001 \
    --subagent-cluster-id=active-passive-all-agents \
    --active=secondary_director_001

# makes the Subagent with ID "secondary_director_001" the active Subagent in the given Subagent Cluster

...