Author: buildbot
Date: Tue Apr 14 07:21:42 2015
New Revision: 947503
Log:
Production update by buildbot for activemq
Modified:
websites/production/activemq/content/cache/main.pageCache
websites/production/activemq/content/unix-shell-script.html
Modified: websites/production/activemq/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/activemq/content/unix-shell-script.html
==============================================================================
--- websites/production/activemq/content/unix-shell-script.html (original)
+++ websites/production/activemq/content/unix-shell-script.html Tue Apr 14
07:21:42 2015
@@ -83,33 +83,36 @@
<tr>
<td valign="top" width="100%">
<div class="wiki-content maincontent"><h2
id="UnixShellScript-Functionaloverview">Functional overview</h2><p>From version
<strong>5.4.0</strong> onwards, ActiveMQ comes with a enhanced shell script for
starting, stopping and managing the broker in Unix environment. For basic <a
shape="rect"
href="activemq-command-line-tools-reference.html#ActiveMQCommandLineToolsReference-activemq">activemq</a>
and <a shape="rect"
href="activemq-command-line-tools-reference.html#ActiveMQCommandLineToolsReference-activemq-admin">activemq-admin</a>
scripts functionality take a look at <a shape="rect"
href="activemq-command-line-tools-reference.html">ActiveMQ Command Line Tools
Reference</a>.</p><p>This <code>activemq</code> script incorporate these two
scripts into one and adds some new functionalities. On top of regular
<code>activemq</code> and <code>activemq-admin</code> scripts, it adds the
following features:</p><ul><li><p><strong>start</strong> - starts the broker in
background. It saves process
id in the <code>${ACTIVEMQ_DATA_DIR}/activemq.pid</code> for future
reference. It accepts the same command line arguments like the original
<code>activemq</code> script, so you can do something like</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[$ bin/activemq start
xbean:conf/activemq-stomp.xml]]></script>
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[bin/activemq start
xbean:conf/activemq-stomp.xml]]></script>
</div></div></li><li><p><strong>console</strong> - starts the broker in
foreground. It is basically the replacement for the old <code>activemq</code>
script<br clear="none">(you can interrupt the
)</p></li></ul><ul><li><strong>stop</strong> - stops the broker that is running
in the background. It tries first to stop the broker using <a shape="rect"
href="activemq-command-line-tools-reference.html#ActiveMQCommandLineToolsReference-shutdown">shutdown</a>
task. If that task doesn't return in 30 seconds (configurable), it will kill
the process.</li></ul><ul><li><strong>restart</strong> - stops the running
instance (if there's one) and starts the new
one</li></ul><ul><li><strong>status</strong> - checks if activemq process is
running<br clear="none">(exitcode: 1 = broker is down, 0 = broker is
up)</li></ul><ul><li><p><strong>create</strong> - create an ACTIVEMQ_BASE
directory that separates a broker instance from its binaries, i.e., it creates
copies of the ActiveMQ configuration files i
nto the command-line specified directory and points to the binaries. You can
start the broker with the <code>/bin</code> scripts in the newly created
instance.</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[$ bin/activemq create
/path/to/brokers/mybroker ]]></script>
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[bin/activemq create /path/to/brokers/mybroker
]]></script>
</div></div></li><li><p><strong>browse</strong> - Display selected messages in
a specified destination</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[$ bin/activemq browse FOO.BAR # use broker
connection from configuration
-$ bin/activemq browse --amqurl tcp://localhost:61616 FOO.BAR]]></script>
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[bin/activemq browse FOO.BAR # use broker
connection from configuration
+bin/activemq browse --amqurl tcp://localhost:61616 FOO.BAR]]></script>
</div></div></li><li><p><strong>bstat</strong> - Performs a predefined query
that displays useful statistics regarding the specified
broker</p></li><li><p><strong>dstat</strong> - Performs a predefined query that
displays useful tabular statistics regarding the specified destination
type</p></li><li><p><strong>decrypt</strong> - Decrypts given text</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[$ bin/activemq decrypt --input
'BkiT42A0CZfL1SanJIgxvQ==' --password asdasdasdasd]]></script>
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[bin/activemq decrypt --input
'BkiT42A0CZfL1SanJIgxvQ==' --password asdasdasdasd]]></script>
</div></div></li><li><p><strong>encrypt</strong> - Encrypts given text</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[$ bin/activemq encrypt --password
TESTPASSWORD --input FOOBAR]]></script>
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[bin/activemq encrypt --password TESTPASSWORD
--input FOOBAR]]></script>
</div></div></li><li><p><strong>export</strong> - Exports a stopped brokers
data files to an archive file</p></li><li><p><strong>list</strong> - Lists all
available brokers in the specified JMX
context</p></li><li><p><strong>purge</strong> - Delete selected destination's
messages that matches the message selector</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[$ bin/activemq purge FOO.BAR # use jmx access
data from configuration
-$ bin/activemq purge --jmxurl
service:jmx:rmi:///jndi/rmi://127.0.0.1:11098/jmxrmi --jmxuser controlRole
--jmxpassword abcd1234 FOO.BAR]]></script>
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[bin/activemq purge FOO.BAR # use jmx access
data from configuration
+bin/activemq purge --jmxurl
service:jmx:rmi:///jndi/rmi://127.0.0.1:11098/jmxrmi --jmxuser controlRole
--jmxpassword abcd1234 FOO.BAR]]></script>
</div></div></li><li><p><strong>query</strong> - Display selected broker
component's attributes and statistics</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[$ bin/activemq query # use jmx access data
from configuration
-$ bin/activemq query --jmxurl
service:jmx:rmi:///jndi/rmi://127.0.0.1:11098/jmxrmi --jmxuser controlRole
--jmxpassword abcd1234]]></script>
-</div></div></li></ul><h2
id="UnixShellScript-DaemonInstallation/ScriptInstallation">Daemon Installation
/ Script Installation</h2><ul><li><p>Install activemq broker as "root" to be
run as "activemq"</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[$ useradd -m activemq -d /srv/activemq
-$ cd /srv/activemq
-$ tar zxvf apache-activemq-<version>-bin.tar.gz$ ln -snf
apache-activemq-<version> current
-$ chown -R activemq:users apache-activemq-<version>
-
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[bin/activemq query # use jmx access data from
configuration
+bin/activemq query --jmxurl
service:jmx:rmi:///jndi/rmi://127.0.0.1:11098/jmxrmi --jmxuser controlRole
--jmxpassword abcd1234]]></script>
+</div></div></li></ul><h2
id="UnixShellScript-Configuringtheinit-script">Configuring the
init-script</h2><p>For ActiveMQ server to run properly some basic system
variables must be set. These variables define how much memory broker will have,
SSL, logging, JAAS options and similar.</p><h3
id="UnixShellScript-Version5.11.0andhigher">Version 5.11.0 and higher</h3><h4
id="UnixShellScript-Configurationfileoftheinit-script">Configuration file of
the init-script</h4><p>Since version 5.11.0, all default configuration
variables are moved to the new <code>env</code> script file, so that they can
be easily inspected and configured in a easy way. <br clear="none">There are
also other configuration locations</p><p>The script scans the following
locations for configurations in the following
order:</p><ol><li>/etc/default/activemq</li><li>$HOME/.activemqrc</li><li>$INSTALLDIR/apache-activemq-<version>/bin/env</li></ol><p>The
first existing file is read exclusively - all other files are ignor
ed. <br clear="none">Undefined values are discovered in a automated
way.</p><h4 id="UnixShellScript-Runningmultipleinstances">Running multiple
instances</h4><p>To use addtional configurations for running multiple instances
on the same operating system rename or symlink script to a name matching to
<code>activemq-instance-<INSTANCENAME></code>.<br clear="none">This
changes the configuration location to
<code>/etc/default/activemq-instance-<INSTANCENAME></code> and
<code>$HOME/.activemqrc-instance-<INSTANCENAME></code>. Configuration
files in /etc have higher precedence.</p><h3
id="UnixShellScript-Versionsprior5.11.0">Versions prior 5.11.0</h3><p>These
parameters were configurable in <code>activemq</code> script itself. <br
clear="none"><br clear="none">You could use <code>setup</code> command to
create additional system wide defaults file to configure the broker.<br
clear="none">(modify the settings in this file if neccessary - the default
entries look a bit garbled
due to an accidentally applied bugfix in this release)</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: bash; gutter: false"
type="syntaxhighlighter"><![CDATA[./activemq setup
/etc/default/activemq]]></script>
+</div></div><p>The configuration of the script can be placed at
<code>/etc/default/activemq</code> or <code>$HOME/.activemqrc</code>. Note,
this is the configuration for the <em>script</em> not for configuring
ActiveMQ.</p><p>To use addtional configurations for running multiple instances
on the same operating system rename or symlink script to a name matching to
<code>activemq-instance-<INSTANCENAME></code>. This changes the
configuration location to
<code>/etc/default/activemq-instance-<INSTANCENAME></code> and
<code>$HOME/.activemqrc-instance-<INSTANCENAME></code>. Configuration
files in /etc have higher precedence.</p><h2
id="UnixShellScript-Runningactivemqasaunixdaemon">Running activemq as a unix
daemon</h2><ul><li><p>Install activemq broker as "root" to be run as
"activemq"</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[useradd -m activemq -d /srv/activemq
+cd /srv/activemq
+tar zxvf apache-activemq-<version>-bin.tar.gz$ ln -snf
apache-activemq-<version> current
+chown -R activemq:users apache-activemq-<version>
]]></script>
</div></div></li><li><p>Create a global default configuration and edit the
configuration</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[$ cp apache-activemq-<version>/bin/env
/etc/default/activemq
-$ vim /etc/default/activemq]]></script>
-</div></div></li><li><p>Install the init script</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[cp apache-activemq-<version>/bin/env
/etc/default/activemq
+sed -i
'~s/^ACTIVEMQ_USER=""/ACTIVEMQ_USER="activemq"/'
/etc/default/activemq
+vim /etc/default/activemq
+chmod 644 /etc/default/activemq]]></script>
+</div></div><ul><li>Configure the java heap to a size suitable to your system
environment and usage</li><li>Consider to move the folders "data", "tmp" and
"conf" out of the installation path</li></ul></li><li><p>Install the init
script</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[ln -snf /srv/activemq/current/bin/activemq
/etc/init.d/activemq]]></script>
</div></div></li><li><p>Activate the init script at system startup<br
clear="none">(TODO: uncomplete)</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[# RHEL
@@ -118,9 +121,7 @@ chkconfig activemq on
# Debian/Ubuntu
update-rc.d defaults activemq]]></script>
-</div></div></li></ul><h2
id="UnixShellScript-Configuringthescript">Configuring the script</h2><p>For
ActiveMQ server to run properly some basic system variables must be set. These
variables define how much memory broker will have, SSL, logging, JAAS options
and similar.</p><h3 id="UnixShellScript-Version5.11.0andhigher">Version 5.11.0
and higher</h3><p>Since version 5.11.0, all configuration variables are moved
to the new <code>env</code> script file, so that they can be easily configured
at one place.</p><p>The script scans the following locations for configurations
in the following
order:</p><ol><li>/etc/default/activemq</li><li>$HOME/.activemqrc</li><li>$INSTALLDIR/apache-activemq-<version>/bin/env</li></ol><p>The
first existing file is read exclusively - all other files are irgnored. <br
clear="none">Undefined values are discovered in a automated way.</p><p>To use
addtional configurations for running multiple instances on the same operating
system rename or symlink script
to a name matching to <code>activemq-instance-<INSTANCENAME></code>.<br
clear="none">This changes the configuration location to
<code>/etc/default/activemq-instance-<INSTANCENAME></code> and
<code>$HOME/.activemqrc-instance-<INSTANCENAME></code>. Configuration
files in /etc have higher precedence.</p><h3
id="UnixShellScript-Versionsprior5.11.0">Versions prior 5.11.0</h3><p>These
parameters were configurable in <code>activemq</code> script itself. <br
clear="none"><br clear="none">You could use <code>setup</code> command to
create additional system wide defaults file to configure the broker.<br
clear="none">(modify the settings in this file if neccessary - the default
entries look a bit garbled due to an accidentally applied bugfix in this
release)</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<script class="theme: Default; brush: bash; gutter: false"
type="syntaxhighlighter"><![CDATA[./activemq setup
/etc/default/activemq]]></script>
-</div></div><p>The configuration of the script can be placed at
<code>/etc/default/activemq</code> or <code>$HOME/.activemqrc</code>. Note,
this is the configuration for the <em>script</em> not for configuring
ActiveMQ.</p><p>To use addtional configurations for running multiple instances
on the same operating system rename or symlink script to a name matching to
<code>activemq-instance-<INSTANCENAME></code>. This changes the
configuration location to
<code>/etc/default/activemq-instance-<INSTANCENAME></code> and
<code>$HOME/.activemqrc-instance-<INSTANCENAME></code>. Configuration
files in /etc have higher precedence.</p><p> </p></div>
+</div></div></li></ul></div>
</td>
<td valign="top">
<div class="navigation">