Versions Compared

Key

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

...

Code Block
languagetext
titleUsage on Unix
Usage: controller.sh command [options] [switches]
  command:
    start           [options]
    start-container [options]
    stop            [options]
    restart         [options]
    status          [options]
    cancel   |    kill   [options]
    switch-over     [options]
    revert          [options] 
    cert            [cert-options]                    | see https://kb.sos-berlin.com/x/jLbAAw
  options:
    --id=<identifier>                                 | Controller ID, default: controller
    --http-port=<[interface:]port>                    | http network interface and port, default: 4444
    --https-port=<[interface:]port>                   | https network interface and port, default:
    --data-directory=<directory>                      | default: /var/sos-berlin.com/js7/controller/var
    --config-directory=<directory>         |           | default: /var/sosdefault: /var/sos-berlin.com/js7/controller/var/config
    --timeout=<seconds>                               | timeout for terminating Controller instance
    --java-options=<java options>                     | default: -Xmx500m -Dfile.encoding=UTF-8; see https://kb.sos-berlin.com/x/aIC9uYo7B
  switches:      
    -cf | --curlfail-over                       | fail-over active role on stop and restart
    -c | --curl   | use curl instead of Java http client
    -f | --force            | use curl instead of Java                     | force termination on stop and restarthttp client
    
  
see https://kb.sos-berlin.com/x/CKrAAw for more information.

...

Code Block
languagetext
titleUsage on Windows
Usage: controller.cmd command [options] [switches]
  command:
    start           [options]
    start-container [options]
    stop            [options]
    restart         [options]
    status          [options]
    cancel     |  kill   [options]
    switch-over     [options]
    revert          [options]
    certstart-service   [options]
     install-service [options]
    remove-service  [cert-options]
    cert            [cert-options]         | see https://kb.sos-berlin.com/x/jLbAAw
  options:
    --id=<identifier>                                 | Controller ID, default: controller
    --http-port=<[interface:]port>                    | http network interface and port, default: 4444
    --https-port=<[interface:]port>                   | https network interface and port, default:
    --data-directory=<directory>                      | default: C:\ProgramData\sos-berlin.com\js7\controller\controller
    --config-directory=<directory>         |           | default: C:default: C:\ProgramData\sos-berlin.com\js7\controller\controller\config
    --timeout=<seconds>                               | timeout for terminating Controller instance
    --java-options=<java options>                     | default: -Xmx500m -Dfile.encoding=UTF-8; see https://kb.sos-berlin.com/x/aIC9uYo7B
  switches switches: 
    -f | --fail-forceover                       | fail-over active role on stop and restart
    -c | --curl     | force termination on stop and restart
  
see                | use curl instead of Java http client

see https://kb.sos-berlin.com/x/CKrAAw for more information.

...

  • --id
    • Specifies a unique identifier for a Controller.  Identifiers Identifiers such as "controller-test", "controller-production" etc. can be used. Upper case and lower case characters are considered, the characters a-z, A-Z, 0-9, underscore and hyphen are allowed. Spaces are not allowed in a Controller ID. Default: controller.
    • If users intend to operate a Controller Cluster with two Controller instances for the active and for the standby cluster member, then the same Controller ID must be specified for both Controller instances as otherwise the instances will not be considered to be members of the same cluster.
  • --http-port
    • Specifies the HTTP port which the Controller instance is listening to in order to receive requests from JOC Cockpit or a partnering Controller instance in a cluster.
      • The option can be used to indicate which network interface the JS7 Controller should listen to if a hostname or IP address is specified - for example with --http-port=myhost:4444.

      • When the option is not used the port defaults to 4444 and the Controller listens to all available network interfaces.
    • If a port is specified then the following order of precedence applies:
      • First precedence: command line option
      • Second precedence: environment variable JS7_CONTROLLER_HTTP_PORT (see below)
      • Third precedence: use of default value
  • --https-port
    • Specifies the HTTPS port that the Controller is listening to in order to receive requests from JOC Cockpit or a pairing Controller instance in a cluster:
      • The option can be used to indicate which network interface the Controller should listen to if a hostname or IP address is specified - for example with --https-port=myhost:4443.

      • When using the HTTPS protocol for connections from JOC Cockpit and from a pairing Controller instance the the HTTP protocol has to be allowed for local connections such as --http-port=localhost:4444. As the Controller Start Script uses a an HTTP connection this the protocol has to be in place to allow the Controller instance to be started, stopped etc. by its Start Script.
    • If a port is specified then the following order of precedence applies:
      • First precedence: command line option
      • Second precedence: environment variable JS7_CONTROLLER_HTTPS_PORT (see below)
      • Third precedence: use of default value
  • --data-directory
    • Specifies the location of the data directory that usually includes the config, logs and state sub-directories.
    • If a data directory is specified then the following order of precedence applies:
      • First precedence: command line option
      • Second precedence: environment variable JS7_CONTROLLER_DATA (see below)
      • Third precedence: use of default value JS7_CONTROLLER_HOME\var
  • --config-directory
    • Specifies the location of the config directory for configuration data.
    • If a configuration directory is specified then the following order of precedence applies:
      • First precedence: command line option
      • Second precedence: environment variable JS7_CONTROLLER_CONFIG_DIR (see below)
      • Third precedence: use of default value JS7_CONTROLLER_DATA/config
  • --timeout
    • With the stop command this option waits for the indicated number of seconds and terminates the Controller if the timeout is exceeded.

    • When using JS7 - systemd Service Files for automated Startup and Shutdown with Unix Systems users should consider that the --timeout value will count towards the systemd service file's  TimeoutStopSec setting. Users must ensure that the Controller is terminated when the systemd timeout is exceeded.
  • --java-options
    • This option can be
    -java-options
    • This option can be used to apply Java options for the Controller, e.g. for memory settings, see JS7 - FAQ - Which Java Options are recommended.
    • Without this option being used Java options default to -Xms500m.

    • In order to specify a number of Java options quotes have to be used like this:
      • --java-options="-Xms500m -Xmx1g"
    • When specifying Java options then the following order of precedence applies:

      • First precedence: command line option
      • Second precedence: environment variable JAVA_OPTIONS (see below)
      • Third precedence: use of default value

...

  • -c ,  --curl
    • Specifies that the curl utility should be used instead of the built-in HTTP client when sending commands to the Controller.
  • -f, --forcefail-over
    • With the stop and restart commands this option forcibly terminates the will fail-over the active role to the Standby Controller instance.

    • The switch is available starting from release 2.7.2.

Watchdog Script: controller_watchdog.sh, controller_watchdog.cmd

...

When used for Container operation using Unix OS then the following command is used:

Code Block
languagebash
controller_instance.sh|.cmd start-container [options]

This The command is used to start the JS7 Controller in a container:

  • The command will keep the start script running as PID 1 in order to receive later stop/kill signals (SIGTERM, SIGKILL) from the container management software.
  • The command start-docker is an alias for start-container.
  • Jira
    serverSOS JIRA
    columnIdsissuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution
    columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
    serverId6dc67751-9d67-34cd-985b-194a8cdc9602
    keySET-223

Anchor
#stopping_controller
#stopping_controller
Stopping the Controller Instance

Code Block
languagebash
# terminate Controller instance
controller_instance.sh|.cmd stop [options]

This command will safely terminate the Controller (recommended).

  • If a Controller Cluster is operated then fail-over will not occur.
  • Using the --timeout command line option will terminate the Controller when the number of seconds specified for the timeout is exceeded.
Code Block
languagebash


# wait up to 60s to stop Controller instance
controller_instance.sh|.cmd stop --timeout=60

# stop Controller instance and fail-over active role
controller_instance.sh|.cmd abort [options]stop --fail-over

The command will terminate the ControllerThe Controller process is aborted immediately.

  • If a Controller

...

  • instance will take time to terminate, then the command will wait accordingly. If a Controller Cluster is operated, then fail-over will not occur. 
  • Using the --fail-over switch will fail-over the active role to the Standby Controller instance in a Controller Cluster.
  • Using the --timeout option will terminate the Controller instance when the number of seconds specified is exceeded.
    • No fail-over will occur if the Controller terminates within the given timeout.
    • Fail-over will occur if the Controller does not terminate within the given timeout.
  • If the  --fail-over switch is used then the --timeout option will be ignored.


Code Block
languagebash
controller_instance.sh|.cmd cancel | killabort [options]

The Controller process is aborted immediately.

If a Controller Cluster is operated then the command will cause fail-over.

Starting from release 2.7.2 the command is deprecated and is replaced by the stop command using the --fail-over switch.


Code Block
languagebash
controller_instance.sh|.cmd cancel | kill [options]

The Controller process is forcibly terminated. The command kill can forcibly terminated. The command kill can be used as an alternative alias to cancel.

The behavior command corresponds to sending a SIGKILL signal with a an OS command such as kill -9 (Unix) or taskkill (Windows).

If a Controller Cluster is being operated then the command will cause fail-over.

Restarting the Controller Instancethe Controller Instance

Code Block
languagebash
# restart Controller instance
controller_instance.sh|.cmd restart [options]

# wait up to 60s and restart Controller instance
controller_instance.sh|.cmd restart --timeout=60

# fail-over active role and restart Controller instance
Code Block
languagebash
controller_instance.sh|.cmd restart [options]--fail-over

The Controller process is stopped and is started:

  • The Controller is stopped as explained in chapter Stopping the Controller Instance. This includes handling of fail-over in a Controller Cluster.
  • The Controller is started similar to use of the start command using the same options as for initial start.

If a Controller Cluster is operated then the command will not cause switch-overthe  --fail-over switch is used then the --timeout option will be ignored.

Checking the Controller Instance Status

...

Code Block
ERROR: java.nio.file.NoSuchFileException: C:\ProgramData\sos-berlin.com\js7\controller\controller\state\session-token
...JS7 Controller(controller) not started!

Switching-over

...

the

...

Active Controller Instance

...

Code Block
languagebash
controller_instance.sh|.cmd switch-over [options]

If a Controller Cluster is operated then this the command will switch -over the active role in the Controller Cluster, more precisely the currently Active Controller Instance takes the standby role and the previous Standby Controller Instance takes the active role.

This command is applicable from the Active Controller Instance only.

from the Active Controller instance to the Standby Controller instance. The command can be executed for the Active Controller instance only.

After switch-over the Controller instance is restarted.

Reverting a Controller Cluster to a Standalone Controller

...

If a Controller Cluster is operated then this the command can be executed after the Controller is stopped. The command will revert the Controller Cluster to a Standalone Controller instance.

...