Manage a node under Docker

Start the node

To start the node, execute the docker start command on the container:

$ docker start adi_XXXXXXXX-XX
adi_XXXXXXXX-XX
$ docker ps
CONTAINER ID        IMAGE                               COMMAND                CREATED             STATUS              PORTS                     NAMES
1e6aeed9801d        axway/decisioninsight:XXXXXXXX-XX   "/opt/adi/platform/b   42 minutes ago      Up 1 seconds        0.0.0.0:18080->8080/tcp   adi_XXXXXXXX-XX

Stop the node

To stop the node, execute the docker stop command on the container. The node gracefully stops by creating a shutdown checkpoint before stopping. However, Docker will kill the node if the node stop exceeds a timeout which is 10 seconds by default. This timeout can be overridden on the stop command with the -t parameter (value in seconds).

$ docker stop --time 60 adi_XXXXXXXX-XX
adi_XXXXXXXX-XX

Display logs

View the container output with the docker logs command. This command can be executed even if the container is stopped. By default, the command displays all the logs and exits. This can be changed on the command with the -f parameter to continue to display logs instead of exiting (only when the container is running), and the  --tail parameter to specify the initial number of last log lines to be displayed.

$ docker logs -f --tail=8 adi_XXXXXXXX-XX
Apr 10, 2016 11:29:42 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.19 02/11/2016 03:25 AM'
2016-04-10 11:29:43,453 [PlatformStartMonitor] INFO platform.availabilityMonitor - ###############################################################################
2016-04-10 11:29:43,457 [PlatformStartMonitor] INFO platform.availabilityMonitor - #                                                                             #
2016-04-10 11:29:43,457 [PlatformStartMonitor] INFO platform.availabilityMonitor - #   PLATFORM STARTED                                                          #
2016-04-10 11:29:43,457 [PlatformStartMonitor] INFO platform.availabilityMonitor - #                                                                             #
2016-04-10 11:29:43,458 [PlatformStartMonitor] INFO platform.availabilityMonitor - ###############################################################################
2016-04-10 11:29:43,458 [PlatformStartMonitor] INFO platform.availabilityMonitor - Platform started in 22.408 sec

You can also run a command inside the container while it's still running by executing the docker exec command.

$ docker exec -ti adi_XXXXXXXX-XX tail -f /opt/adi/platform/var/log/node.log
2016-04-10 11:29:38,214 [Domain-calcium-30] INFO calcium.asynchronousWorkflowEngine - Asynchronous workflow engine started in 42 ms
2016-04-10 11:29:40,240 [Domain-calcium-3] INFO calcium.workflowTransactionProcessor - All synchronous interceptors deployed in 2.024 sec
2016-04-10 11:29:40,248 [Domain-calcium-34] INFO calcium.absorptionManagerService - Absorption manager is ready
2016-04-10 11:29:43,453 [PlatformStartMonitor] INFO platform.availabilityMonitor - ###############################################################################
2016-04-10 11:29:43,457 [PlatformStartMonitor] INFO platform.availabilityMonitor - #                                                                             #
2016-04-10 11:29:43,457 [PlatformStartMonitor] INFO platform.availabilityMonitor - #   PLATFORM STARTED                                                          #
2016-04-10 11:29:43,457 [PlatformStartMonitor] INFO platform.availabilityMonitor - #                                                                             #
2016-04-10 11:29:43,458 [PlatformStartMonitor] INFO platform.availabilityMonitor - ###############################################################################
2016-04-10 11:29:43,458 [PlatformStartMonitor] INFO platform.availabilityMonitor - Platform started in 22.408 sec

Generate a thread dump

To generate a JVM thread dump, send a SIGQUIT signal to the process in the container with the docker kill command. Since the thread dump output is done on the standard output and not the log file, the thread dump can be displayed only with the docker logs command:

$ docker kill -s QUIT adi_XXXXXXXX-XX
adi_XXXXXXXX-XX
$ docker logs adi_XXXXXXXX-XX
[... thread dump at the end of the output ...]

Attach to the process standard input and output

You can attach the process to the current console to:  

  • See the logs (as with docker logs).
  • Be able to send input, for  example Gogo commands, to the process.

This can be done with the docker attach command:

$ docker attach adi_XXXXXXXX-XX

Pressing Control+C stops the node and terminates the attach command. To detach without stopping the node, press Control+PQ, that is press and hold the Control key, then press and release P, then press and release Q, then release the Control key.

 

 

Related Links