Server 5

Using the Sophora Server

Learn how to use the Sophora Server.

The Sophora server can be started by the shell script sophoraServerControl.sh, located at cms-directory/sophora/sophoraServerControl.sh (you can learn more about the directory structure here).

Start Server

To simply start the Server run following lines:

> cd cms-directory/sophora
> ./sophoraServerControl.sh

Script Options

The start script takes following options:

  • -clean: Starts the server with empty server info, all info about known slaves are removed before start.
  • -clusterMode {master|slave|open}: Determines if the server is started as primary (master), replica (slave) or decides this depending on the cluster state (open). The clusterMode option should not be used, if the server is configured to run as a cluster node.
  • -background: Starts the server in background, the script will exit but the server process will keep running.
  • -background_and_wait: Starts the server in background, the script will wait to exit until the started server is ready.
  • -stop: Gracefully stops the sophora server by sending a SIGTERM signal to the server process
  • -kill: Kills the sophora server process by sending a sigkill signal to the server process
  • -pid: Prints the PID of the server process
  • -h: to display help.

Here is an example of starting a server as a background process with empty server info and clusterMode primary:

./sophoraServerControl.sh -clean -clusterMode master -background

Starting the Server as Primary, Replica or Staging server

If the server starts as a replica or staging server, it has to synchronize all missed document changes from the primary, which might take some time if the server has been switched off for a while.

When the synchronization has finished, the following log entry will appear in the Sophora Primary Server's log:

[2018-03-28 11:10:50,744, INFO ] [Sync-www.subshell.com-
5f907edd-7c3e-4630-b372-69ddaeb42f24]
INFO erver.replication.master.ReplicationSync:
109 - syncFinished sent

Followed by the Sophora Replica Server:

[2018-03-28 11:10:51,147, INFO ] 
[SyncFinishedThread] INFO 
ra.server.replication.slave.jms.JmsSlave:699 - 
got syncFinished SLAVE

Stopping the Server

The Server can be stopped by pressing Ctrl+C in the Terminal running the Shell Script. If it was started in the Background, the server process can be stopped with the -stop option or if it cant be stopped gracefully with the -kill option. The log file contains the following entry when the server has been stopped successfully:

[2018-03-28 12:00:46,002, INFO ] [LifeCycle.stop-26-thread-1] INFO om.subshell.sophora.server.SophoraServer:539 - SophoraServer shutdown complete

Miscellaneous

The Throttle Mode

The Sophora server has a throttle mode for handling high load. This is described in detail here.

For detailed information about customized scripts and valid script languages, refer to the section Script controlled Sophora extensions.

Endpoints for container probes

Three endpoints which provide information about the current status of the Sophora Server are available. These endpoints can be used to specify probes in case the Sophora Server runs in a container.

  • http://<host>:<port>/status/started - Whether the Sophora Server is started
  • http://<host>:<port>/status/ready - Whether the Sophora Server is currently ready
  • http://<host>:<port>/status/liveness - Whether the Sophora Server is alive and healthy

Last modified on 10/16/20

The content of this page is licensed under the CC BY 4.0 License. Code samples are licensed under the MIT License.

Icon