Starting and stopping Petals ESB Hazelcast Registry installed by Debian packages

Introduction

Once Petals ESB Hazelcast Registry is installed through the Debian package, it can be started or stopped with two different ways:

  • at system level: the Petals ESB Hazelcast Registry nodes are running with a dedicated system user 'petals'. To use in production mode,
  • at user level: the Petals ESB Hazelcast Registry nodes are running as a process of the user that launches them. To use in a development mode.

Startup and shutdown operations are realized through the script or command 'petals-registry'. In following chapters we can find use-cases to explain how to use the script, and a reference guide about this script.

Contributors
No contributors found for: authors on selected page(s)

Starting Petals ESB Hazelcast Registry

Starting Petals ESB Hazelcast Registry at system level

Automatic startup

The Petals ESB Hazelcast Registry package comes with an automatic startup script based on System V (initd) to automatically launch Petals ESB Hazelcast Registry nodes as system services when the host boots.
To start the Petals ESB Hazelcast Registry nodes, for example, launch the following command on a Ubuntu box:

cdeneux@sph-latitude-D630:~$ sudo service petals-registry start

Two natures of cluster nodes are identified:

  • the "available members" that are configured. These nodes are to configure into the directory /etc/petals-registry/member-available. One sub-directory by member node.
  • and, the "enable members" that are automatically started. These nodes are to configure into the directory /etc/petals-registry/member-enable. One sub-directory by member node.

As "Enable members" are a subset of "Available members", we recommend to put the configuration of a node into a sub-directory of /etc/petals-registry/member-available, and create a symbolic link on this sub-directory into /etc/petals-registry/member-enable to "enable" it.

It's not possible to automatically start a Petals ESB Hazelcast Registry node in debug mode. Use a manual startup.
The automatic startup starts all Petals ESB Hazelcast Registry nodes declared in the directory /etc/petals-registry/member-enable. So if you add a new Petals ESB Hazelcast Registry node in this directory, and use the command "service petals-registry start", all other Petals ESB Hazelcast Registry nodes will be also started, and as they are already started, errors will occurs.

Manual startup

A Petals ESB Hazelcast Registry node configured at system level (its configuration is located in /etc/petals-registry/member-available, and uses sub-directory /var/log/petals-registry) can be started using a manual startup, for example, to test its configuration. This startup is done using the same mechanism as a Petals ESB Hazelcast Registry node configured at user level, but using the system user 'petals' to be compliant with ACL of the filesystem:

sudo -u petals petals-registry -c <node-configuration>

where <node-configuration> is the URL of the Petals ESB Hazelcast Registry node configuration (ie, URL locating the file member.properties)

For example, to launch the default sample node

sudo -u petals petals-esb -u file:///etc/petals-registry/member-available/default/member.properties
Note 1: When manually starting a Petals ESB Hazelcast Registry node, it will be automatically stopped when closing your shell. Don't use this way to start a Petals ESB Hazelcast Registry node as a system service.
Note 2: The command below uses the default JVM installed on your system. If it is not the right one, you can use a command line as following to specify the right JVM to use:
sudo -u petals JAVA_HOME=${HOME}/jdk1.7.0_80 petals-registry -u file:///etc/petals-registry/member-available/default/member.properties

Starting Petals Petals ESB Hazelcast Registry at user level

A Petals ESB Hazelcast Registry node configured at user level (its full configuration is located under the user's home directory) can be only started using a manual startup:

petals-registry -c <node-configuration>

where <node-configuration> is the URL of the Petals ESB Hazelcast Registry node configuration (ie, URL locating the file member.properties)

For example:

petals-registry -c file:///home/cdeneux/my-petals-esb-registry-node/demo1/member.properties
When manually starting a Petals ESB Hazelcast Registry node, it will be automatically stopped when closing your shell.

Stopping Petals ESB Hazelcast Registry

The process stopping a Petals ESB Hazelcast Registry node reads the contents of its local configuration file (ie. member.properties)to get the JMX credentials required to connect to the Petals ESB Hazelcast Registry node and invoke a shutdown. The security to block a shutdown is based on filesystem ACLs of the configuration files of the node. So, don't forget to set the right ACL on these files.

Example: "me:my-group rw-r-----" for your node to authorize you (me) and all member of the group my-group) to shutdown the Petals ESB Hazelcast Registry.

Stopping Petals ESB Hazelcast Registry at system level

Automatic stop

To stop the Petals ESB Hazelcast Registry nodes started as system services uses the following command on a Ubuntu box, for example:

cdeneux@sph-latitude-D630:~$ sudo service petals-registry stop
The automatic stop stops all Petals ESB Hazelcast Registry nodes declared in the directory /etc/petals-registry/member-enable. So if you have removed a Petals ESB Hazelcast Registry node in this directory since the last automatic startup, it will not be stopped. Use a manual stop to stop it.

Manual stop

Manual stop of a Petals ESB Hazelcast Registry node automatically started

To stop a Petals ESB Hazelcast Registry node started as system service use the following command:

sudo -u petals petals-registry -c <node-configuration> stop

where <node-configuration> is the URL of the node configuration (ie, URL locating the file member.properties)

For example, to stop the default sample node

sudo -u petals petals-registry -c file:///etc/petals-registry/member-available/default/member.properties stop

Manual stop of a Petals ESB Hazelcast Registry node manually started

If you have manually started a Petals ESB Hazelcast Registry node at system level, just kill it with a Ctrl-C on its console, or use the following command from another shell:

sudo -u petals petals-registry -c <node-configuration> stop

where <node-configuration> is the URL of the node configuration (ie, URL locating the file member.properties)

For example, to stop the default sample node

sudo -u petals petals-registry -c file:///etc/petals-registry/member-available/default/member.properties stop

Stopping Petals ESB Hazelcast Registry at user level

To stop your Petals ESB Hazelcast Registry node, just kill it with a Ctrl-C on its console, or use the following command from another shell:

petals-registry -c <node-configuration> stop

where <node-configuration> is the URL of the node configuration (ie, URL locating the file member.properties)

For example

petals-registry -c file:///home/cdeneux/my-petals-esb-registry-nodes/demo1/member.properties stop

Reference guide of script 'petals-registry'

This reference guide is also available as "man" page installed with the Debian package 'petals-registry'.

Synopsis

petals-registry -c node-cfg-url [stop] [-e]
petals-registry -h
petals-registry -V

Description

petals-registry is used to start and stop manually a Petals ESB Hazelcast Registry node.

Options

Short option Long option Description
-H --help Print usage.
-c config-url --config config-url The URL of the Petals ESB Hazelcast Registry node configuration to start or stop.
stop N/A Stop the Petals ESB Hazelcast Registry node.
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.