View Source

h1. Introduction

{section}
{column}

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.

{column}
{column:width=35%}
{panel:title=Table of contents}{toc:outline=true}{panel}
{panel:title=Contributors}{contributors:order=name|mode=list|showAnonymous=true|showCount=true|showLastTime=true}{panel}
{column}
{section}

h1. Starting Petals ESB Hazelcast Registry

h2. Starting Petals ESB Hazelcast Registry at system level

h3. 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:
{code}
cdeneux@sph-latitude-D630:~$ sudo service petals-registry start
{code}

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.

{info}
It's not possible to automatically start a Petals ESB Hazelcast Registry node in debug mode. Use a manual startup.
{info}

{note}
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.
{note}

h3. 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:
{code}
sudo -u petals petals-registry -c <node-configuration>
{code}
where {{<node-configuration>}} is the URL of the Petals ESB Hazelcast Registry node configuration (ie, URL locating the file {{member.properties}})
{quote}For example, to launch the default sample node
{code}
sudo -u petals petals-esb -u file:///etc/petals-registry/member-available/default/member.properties
{code}
{quote}

{note}
+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:
{code}
sudo -u petals JAVA_HOME=${HOME}/jdk1.7.0_80 petals-registry -u file:///etc/petals-registry/member-available/default/member.properties
{code}
{note}

h2. 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:
{code}
petals-registry -c <node-configuration>
{code}
where {{<node-configuration>}} is the URL of the Petals ESB Hazelcast Registry node configuration (ie, URL locating the file {{member.properties}})
{quote}For example:
{code}
petals-registry -c file:///home/cdeneux/my-petals-esb-registry-node/demo1/member.properties
{code}
{quote}

{note}
When manually starting a Petals ESB Hazelcast Registry node, it will be automatically stopped when closing your shell.
{note}

h1. 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.

{quote}
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.
{quote}

h2. Stopping Petals ESB Hazelcast Registry at system level

h3. Automatic stop

To stop the Petals ESB Hazelcast Registry nodes started as system services uses the following command on a Ubuntu box, for example:
{code}
cdeneux@sph-latitude-D630:~$ sudo service petals-registry stop
{code}

{note}
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.
{note}

h3. Manual stop

h4. 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:
{code}
sudo -u petals petals-registry -c <node-configuration> stop
{code}
where {{<node-configuration>}} is the URL of the node configuration (ie, URL locating the file {{member.properties}})
{quote}For example, to stop the default sample node
{code}
sudo -u petals petals-registry -c file:///etc/petals-registry/member-available/default/member.properties stop
{code}
{quote}

h4. 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:
{code}
sudo -u petals petals-registry -c <node-configuration> stop
{code}
where {{<node-configuration>}} is the URL of the node configuration (ie, URL locating the file {{member.properties}})
{quote}For example, to stop the default sample node
{code}
sudo -u petals petals-registry -c file:///etc/petals-registry/member-available/default/member.properties stop
{code}
{quote}

h2. 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:
{code}
petals-registry -c <node-configuration> stop
{code}
where {{<node-configuration>}} is the URL of the node configuration (ie, URL locating the file {{member.properties}})
{quote}For example
{code}
petals-registry -c file:///home/cdeneux/my-petals-esb-registry-nodes/demo1/member.properties stop
{code}
{quote}

h1. Reference guide of script '{{petals-registry}}'

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

h2. Synopsis

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

h2. Description

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

h2. 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. |