159 lines
8.2 KiB
XML
159 lines
8.2 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
||
<!-- ============================================================================= -->
|
||
<!-- Copyright © 2009 Red Hat, Inc. and others. -->
|
||
<!-- -->
|
||
<!-- The text of and illustrations in this document are licensed by Red Hat under -->
|
||
<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). -->
|
||
<!-- -->
|
||
<!-- An explanation of CC-BY-SA is available at -->
|
||
<!-- -->
|
||
<!-- http://creativecommons.org/licenses/by-sa/3.0/. -->
|
||
<!-- -->
|
||
<!-- In accordance with CC-BY-SA, if you distribute this document or an adaptation -->
|
||
<!-- of it, you must provide the URL for the original version. -->
|
||
<!-- -->
|
||
<!-- Red Hat, as the licensor of this document, waives the right to enforce, -->
|
||
<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
|
||
<!-- permitted by applicable law. -->
|
||
<!-- ============================================================================= -->
|
||
<chapter id="installation">
|
||
<title>安装</title>
|
||
<para>本章讲述如何安装ActiveMQ。</para>
|
||
<section id="installation.prerequisites">
|
||
<title>准备</title>
|
||
<note>
|
||
<para>ActiveMQ只能在Java 6或以上版本中运行</para>
|
||
</note>
|
||
<para>默认情况下ActiveMQ运行的内存是1GiB。如果你的电脑内存少于1GiB,或者你希望更多的内存给ActiveMQ,你
|
||
可以修改 <literal>bin/run.sh</literal>脚本文件。</para>
|
||
<para>ActiveMQ有自己的快速日志系统,它能够使用libaio(在Linux上它是默认的)或Java的NIO。
|
||
如果要使用libaio,你需要首先在你的Linux上安装它。</para>
|
||
<para>如果你不在使用Linux,则不需要考虑这个问题。</para>
|
||
<para>要安装libaio,你可以使用root用户完成以下步骤:</para>
|
||
<para>使用yum(例如在Fedora 或 Red Hat Enterprise Linux上):</para>
|
||
<programlisting>yum install libaio</programlisting>
|
||
<para>使用aptitude, (例如在Ubuntu或Debian系统上):</para>
|
||
<programlisting>apt-get install libaio</programlisting>
|
||
</section>
|
||
<section id="installation.standalone">
|
||
<title>单独的ActiveMQ服务器</title>
|
||
<para>将软件包下载后,将其解压到你选定的目录下。这里你就可以<link linkend="running.standalone">直接运行了</link>。
|
||
下面给出了它的目录结构: </para>
|
||
<programlisting>
|
||
|___ bin
|
||
|
|
||
|___ config
|
||
| |___ jboss-as-4
|
||
| |___ jboss-as-5
|
||
| |___ stand-alone
|
||
|
|
||
|___ docs
|
||
| |___ api
|
||
| |___ quickstart-guide
|
||
| |___ user-manual
|
||
|
|
||
|___ examples
|
||
| |___ core
|
||
| |___ javaee
|
||
| |___ jms
|
||
|
|
||
|___ lib
|
||
|
|
||
|___ licenses
|
||
|
|
||
|___ schemas
|
||
</programlisting>
|
||
<itemizedlist>
|
||
<listitem>
|
||
<para><literal>bin</literal> -- 运行ActiveMQ的二进制文件和脚本文件。</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>config</literal> -- ActiveMQ的配置文件。它包括了单独模式或者运行在
|
||
JBoss AS 4 或 5中的配置。请参考配置索引来了解配置有详细信息。</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>docs</literal> -- ActiveMQ的文档及Javadoc。 </para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>examples</literal> -- JMS and Java EE例子。有关详细信息请参见
|
||
'running examples'一章。 </para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>lib</literal> -- 运行ActiveMQ所需要的jar文件和库文件 </para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>licenses</literal> -- ActiveMQ的软件协议</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>schemas</literal> -- ActiveMQ配置文件的XML Schema</para>
|
||
</listitem>
|
||
</itemizedlist>
|
||
</section>
|
||
<section id="installation.jboss.as5">
|
||
<title>ActiveMQ运行于JBoss应用服务器5.x</title>
|
||
<para>ActiveMQ可以部署在<ulink url="http://www.jboss.org/jbossas/">JBoss AS
|
||
5</ulink>中。目前默认的应用服务器没有安装ActiveMQ(ActiveMQ将是JBoss 6的默认JMS提供者),因此
|
||
你需要为ActiveMQ创建新的AS 5的配置(profile)。</para>
|
||
<para>创建AS 5新配置的步骤:</para>
|
||
<orderedlist>
|
||
<listitem>
|
||
<para>下载并安装JBoss AS 5</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para>设置环境变量<literal>JBOSS_HOME</literal>指向JBoss AS 5的安装目录。</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para>运行ActiveMQ的<literal>config/jboss-as-5</literal>下的<literal>./build.sh</literal> (或
|
||
者如果在Windows下运行<literal>build.bat</literal>)。</para>
|
||
</listitem>
|
||
</orderedlist>
|
||
<para>这将会在<literal>$JBOSS_HOME/server</literal>创建两个服务器配置:</para>
|
||
<itemizedlist>
|
||
<listitem>
|
||
<para><literal>default-with-activemq</literal> -- 这个相当于AS 5的<literal
|
||
>default</literal>配置但其JMS提供者替换成为ActiveMQ。在这个配置中的ActiveMQ
|
||
是<emphasis>非集群</emphasis>的。</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>all-with-activemq</literal> -- 这个相当于AS 5的<literal
|
||
>all</literal>配置但其JMS提供者替换成为ActiveMQ。这个配置中的ActiveMQ
|
||
是<emphasis>集群</emphasis>的。</para>
|
||
</listitem>
|
||
</itemizedlist>
|
||
<para>这时,你就可以启动上面其中任何一个配置的JBoss AS 5服务器了,例如:</para>
|
||
<programlisting>$JBOSS_HOME/bin/run.sh -c default-with-activemq</programlisting>
|
||
</section>
|
||
<section id="installation.jboss.as4">
|
||
<title>ActiveMQ运行于JBoss应用服务器4.x</title>
|
||
<para>为了在AS 4中安装ActiveMQ,你需要创建新的配置(profile)。</para>
|
||
<para>步骤如下:</para>
|
||
<orderedlist>
|
||
<listitem>
|
||
<para>下载并安装JBoss AS 4</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para>设置环境变量<literal>JBOSS_HOME</literal>指向JBoss AS 4的安装目录。</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para>运行ActiveMQ的<literal>config/jboss-as-4</literal>下的<literal>./build.sh</literal> (或
|
||
者如果在Windows下运行<literal>build.bat</literal>)。</para>
|
||
</listitem>
|
||
</orderedlist>
|
||
<para>这将会在<literal>$JBOSS_HOME/server</literal>创建两个服务器配置:</para>
|
||
<itemizedlist>
|
||
<listitem>
|
||
<para><literal>default-with-activemq</literal> -- 这个相当于AS 4的<literal
|
||
>default</literal>配置但其JMS提供者替换成为ActiveMQ。在这个配置中的ActiveMQ
|
||
是<emphasis>非集群</emphasis>的。</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>all-with-activemq</literal> -- 这个相当于AS 4的<literal
|
||
>all</literal>配置但其JMS提供者替换成为ActiveMQ。这个配置中的ActiveMQ
|
||
是<emphasis>集群</emphasis>的。</para>
|
||
</listitem>
|
||
</itemizedlist>
|
||
<para>这时,你就可以启动上面其中任何一个配置的JBoss AS 4服务器了,例如:</para>
|
||
<programlisting>$JBOSS_HOME/bin/run.sh -c default-with-activemq</programlisting>
|
||
</section>
|
||
</chapter>
|