Start and stop a Liberty collective member

The collective controller provides a ServerCommands MBean used to start or stop a collective member. The MBean startServer and stopServer methods start and stop a member. We also can run server start and stop commands from a command line.

For sample Liberty admin scripts, see:


Prerequisites

  • The member server must have the collectiveMember-1.0 feature enabled in its server.xml file.

  • The member must be joined to the collective.

    See Configure a Liberty collective.


Set up

To enable the collective controller to stop and start a member server, it might be necessary to add the <hostAuthInfo> element to the member's server.xml file. By default, each member attempts to use SSH key-based authentication. A pair of RSA keys is generated on server startup under ${server.config.dir}/resources/security/ssh. The public key is added to the user's authorized_keys file automatically. The private key is sent to the controller. By default, the member will attempt to use the collective-wide SSH keys created by the controller. If available, the public key will be sent by the controller to the joining member and added to the user's authorized_keys file. If not available, the joining member will generate its own pair of RSA keys to use. If SSH is not available at all:

    provide an administrator user ID and password in the <hostAuthInfo> element. members, use of SSH key-based authentication is recommended. To use a username and password for authentication, specify them in a <hostAuthInfo> element in the server.xml file.

See Overriding Liberty server host information and Set up RXA for Liberty collective operations for details.

  • Use the ServerCommands MBean startServer and stopServer methods to start and stop a collective member.

    For information on running the ServerCommands MBean from the controller, see the API documentation for the ServerCommands MBean.

  • Run server start and stop commands from a command line.

    See Start and stop a server from the command line.