Table 3.2 describes the environment variables recognized by the administration tool on *NIX (UNIX and LINUX) platforms.
Table 3.2. Admin Tool Environment Variables on *NIX
| Variable | Description |
|---|---|
ACTIVEMQ_HOME | Directory where Fuse Message Broker is installed. |
ACTIVEMQ_CLASSPATH | Specifies the classpath used by the current broker instance. |
ACTIVEMQ_SSL_OPTS | Defines Java properties required to support SSL/TLS protocols. See Security Guide for details. |
ACTIVEMQ_CONFIG_DIR | Specifies the location of the broker's configuration directory.
Default value is $ACTIVEMQ_HOME/conf. |
ACTIVEMQ_DATA_DIR | Specifies the location of the broker's data directory. Default
value is $ACTIVEMQ_HOME/data. |
ACTIVEMQ_PIDFILE | Specifies the location of the file that hold's the broker's process ID (PID). |
ACTIVEMQ_USER | Run the broker daemon as the specified user, which should be a user with non-root privileges. Default value is a blank string, which implies that the broker does not change user. |
ACTIVEMQ_OPTS_MEMORY | Specifies the JVM memory configuration. Default value is
-Xms256M -Xmx256M. |
ACTIVEMQ_QUEUEMANAGERURL | Specifies the default connection URL that is used with the admin
tool's browse task. Default value is
--amqurl tcp://localhost:61616. |
ACTIVEMQ_KILL_MAXSECONDS | When shutting down the broker using the stop
task, specifies how many seconds to wait for an orderly shutdown to
complete (initiated by JMX). After this limit is reached, the admin
tool kills the broker using signal -9. |
You must set the JAVA_HOME environment variable to the location of
your Java installation directory. It is usually convenient to set this environment
variable at the same time as the other Fuse Message Broker environment variables.
On *NIX platforms, the admin tool has the capability to find and source a startup script, immediately before it executes whatever task you have specified. The startup script is a shell script, which is normally used to set some environment variables.
When the admin tool (activemq or activemq-admin) starts
up, it looks for startup scripts in the following locations:
/etc/default/activemq
/home/User/.activemqrc
If both of these scripts exist, they will both be sourced by the admin tool, in the order shown.
To create your own startup script, perform the following steps:
Check for existing startup scripts—before
creating a new startup script, check that you are not about to overwrite an
existing script at either of the standard locations,
/etc/default/activemq and
/home/.User/.activemqrc
Create a default startup script—he admin tool
has a task to create a default startup script for you. For example, to
create a default startup script at
/home/,
enter the following command:User/.activemqrc
./activemq setup /home/User/.activemqrcModify the default startup script—generally,
you will need to customize the default startup script, setting the
environment variables to appropriate values for your broker instance. In
particular, you will generally need to customize at least the
JAVA_HOME, ACTIVEMQ_HOME, and the
ACTIVEMQ_USER environment variables.
![]() | Note |
|---|---|
If you are running Fuse Message Broker on the IBM JVM platform, some additional
settings are needed. Because IBM's JVM does not support the
|
By default, the activemq script can launch only one broker at a time,
because the startup scripts specify the environment for one
particular broker instance only.
If you need to administer multiple broker instances, you can create a symlink of
the activemq script and associate it with a specific broker instance,
as follows:
Given the broker named BrokerName, create a
symbolic link to the activemq script, as follows:
ln -sActiveMQInstallDir/bin/activemq activemq-instance-BrokerName
Now, when the script is invoked using the symbolic copy,
activemq-instance-,
the script changes the algorithm it uses to find the startup scripts.BrokerName
Save the broker's startup script either in the file
/etc/default/activemq-instance-
or in the file
BrokerName/home/.User/.activemqrc-instance-BrokerName
When you run the launch script as
activemq-instance-,
the script extracts the broker name, BrokerNameBrokerName,
from the command name and uses the broker name to locate one (or both) of
the startup scripts created in the preceding step.