ActiveMQ 安装

ActiveMQASF

Using ActiveMQ 5 > Version 5 Getting Started
Download | JavaDocs More... | Source | Forums | Support

Introduction
This document describes how to install and configure ActiveMQ for both Unix and Windows' platforms.
Document Organization
The Getting Started Guide for ActiveMQ contains the following sections:

Introduction
Document Organization
Pre-Installation Requirements
Installation Procedure for WindowsWindows Binary Installation
Windows Source Installation
Windows Developer's Release

Installation Procedure for UnixUnix Binary Installation
Unix Source Installation
Unix Developer's Release

Starting ActiveMQOn Windows
On Unix
More help

Testing the Installation
Monitoring ActiveMQ
Stopping ActiveMQ
Starting ActiveMQ with a different configuration fileActiveMQ 5.8 or older
ActiveMQ 5.9 onwards

Configuring ActiveMQ
Additional Resources

Pre-Installation Requirements
Hardware:
60 MB of free disk space for the ActiveMQ binary distribution.
200 MB of free disk space for the ActiveMQ source or developer's distributions.

Operating Systems:
Windows: Windows XP SP2, Windows 2000.
Unix: Ubuntu Linux, Powerdog Linux, MacOS, AIX, HP-UX, Solaris, or any Unix platform that supports Java.

Environment:
Java Developer Kit (JDK) 1.7.x or greater for deployment and 1.7.x (Java 7) for compiling/building.
The JAVA_HOME environment variable must be set to the directory where the JDK is installed, e.g., c:\Program Files\jdk.1.7.0_xx_xx
.
Maven 3.0 or greater (required when installing source or developer's releases).
JARs that will be used must be added to the classpath.

Installation Procedure for Windows
This section of the Getting Started Guide explains how to install binary and source distributions of ActiveMQ on a Windows system.
Windows Binary Installation
This procedure explains how to download and install the binary distribution on a Windows system.
From a browser, navigate to activemq.apache.org/.
Click the Download link in the navigation pane (the left pane).
Select the latest distribution (for older releases, click the link to the archives).For a binary distribution, the filename will be similar to: activemq-x.x.x.zip
.
Extract the files from the ZIP file into a directory of your choice.
Proceed to the #Starting ActiveMQ section of this document.
Following start-up, go to the #Testing the Installation section of this document.

Windows Source Installation
This procedure explains how to download and install the source distribution on a Windows system.
NOTE: ActiveMQ requires Java 7 to run and to build
From a browser, navigate to activemq.apache.org/.
Click the Download link in the navigation pane (the left pane).
Select the latest distribution (for older releases, click the link to the archives).For a source distribution, the filename will be similar to: activemq-x.x-src.zip
.
Extract ActiveMQ from the ZIP file into a directory of your choice.
Build ActiveMQ using Maven 2.1 or greater and Java 1.7.

The recommended method of building ActiveMQ is the following:
cd [activemq_install_dir]

mvn clean install

where [activemq_install_dir] is the directory in which ActiveMQ was installed.
If the above build fails on some tests, type the following:
cd [activemq_install_dir]

mvn clean install -Dmaven.test.skip=
true

If you prefer to use an IDE, then you can auto-generate the IDE's project file using maven plugins:
mvn eclipse:eclipse

or
mvn idea:idea

Feel free to use any other applicable IDE. Please refer to the plugin reference for more details.

Start ActiveMQ from the target directory, for example:
cd [activemq_install_dir]\assembly\target

unzip activemq-x.x-SNAPSHOT.zip

cd activemq-x.x-SNAPSHOT

bin\activemq

NOTE: Working directories get created relative to the current directory. To create the working directories in the proper place, ActiveMQ must be launched from its home/installation directory.

Proceed to the #Testing the Installation section.

Warning
If you are building ActiveMQ 5.x under Windows using Cygwin there is a path name length limitation. If the path name length is exceeded, you may see build errors. To correct this, move the ActiveMQ source directory higher in the file system tree, e.g., /cygdrive/c/d/sm.

Windows Developer's Release
This procedure explains how to download and install the latest developer's snapshot.
NOTE: ActiveMQ requires Java 7 to run and to build
From a browser, navigate to activemq.apache.org/.
Click the Download link in the navigation pane (the left pane).
Click the Maven ActiveMQ SNAPSHOT link.
Select the version of ActiveMQ to download
Extract the files from the ZIP file into a directory of your choice.
If a binary snapshot was downloaded, proceed to the #Starting ActiveMQ section of this document.If a source snapshot was downloaded, perform step 6 and step 7 of the #Windows Source Installation procedure.
Following start-up, proceed to the #Testing the Installation section.

Installation Procedure for Unix
Unix Binary Installation
This procedure explains how to download and install the binary distribution on a Unix system.NOTE: There are several alternative ways to perform this type of installation.
Download the activemq gzip file to the Unix machine, using either a browser or a tool, i.e., wget, scp, ftp, etc. for example:

wget http:
//activemq.apache.org/path/tofile/apache-activemq-5.8-tar.gz

Extract the files from the gzip file into a directory of your choice. For example:

tar zxvf activemq-x.x.x.tar.gz

If the ActiveMQ
start-up script is not executable, change its permissions. The ActiveMQ
script is located in the bin
directory. For example:

cd [activemq_install_dir]/bin

chmod
755
activemq

Proceed to the #Starting ActiveMQ section of this document.
Following start-up, go to the #Testing the Installation section.

Unix Source Installation
This procedure explains how to download and install the source distribution on a Unix system. This procedure assumes the Unix machine has a browser. Please see the previous #Unix Binary Installation section for details on how to install ActiveMQ without a browser.
NOTE: ActiveMQ requires Java 7 to run and to build
From a browser, navigate to activemq.apache.org/.
Click the Download link in the navigation pane (the left pane).
Click the Maven ActiveMQ SNAPSHOT link.
Select the version of ActiveMQ to downloadFor a source distribution, the filename will be similar to: activemq-x.x-src.tar.gz
.
Extract the files from the ZIP file into a directory of your choice. For example:
tar zxvf activemq.x.x-src.tar.gz

Build ActiveMQ using Maven 3.0 or greater and Java 7:The preferred method of building ActiveMQ is the following:
cd [activemq_install_dir]

mvn clean install

If Maven crashes with a java.lang.OutOfMemoryError, you you need to do this first (assuming a Bourne-like shell):
export MAVEN_OPTS=-Xmx1024M

If the above build fails on some tests, do the following:
cd [activemq_install_dir]

mvn clean install -Dmaven.test.skip=
true

If you prefer to use an IDE then you can auto-generate the IDE's project file using maven plugins:
mvn eclipse:eclipse

or
mvn idea:idea

Feel free to use any other applicable IDE. Please refer to the plugin reference for more details.NOTE: Working directories get created relative to the current directory. To create working directories in the proper place, ActiveMQ must be launched from its home/installation directory.

Proceed to the #Starting ActiveMQ section of this document.
Proceed to #Testing the Installation section.

Unix Developer's Release
This procedure explains how to download and install the latest developer's snapshot.
NOTE: ActiveMQ requires Java 7 to run and to build
From a browser, navigate to activemq.apache.org/.
Click the #Download link in the navigation pane (the left pane).
Click the Maven ActiveMQ SNAPSHOT link.
Select the version of ActiveMQ to download
Extract the files from the gzip file into a directory of your choice. For example:For a binary developer's snapshot:
tar zxvf activemq-x.x.x.tar.gz

For a source developer's snapshot:
tar zxvf activemq-x.x.x-src.tar.gz

If a binary snapshot was downloaded, to make it executable, the ActiveMQ
script may need its permissions changed:
cd [activemq_install_dir]/bin

chmod
755
activemq

For a binary snapshot, proceed to the #Starting ActiveMQ section of this document.
If a source snapshot was downloaded perform steps 6 - 8 of the #Unix Source Installation procedure.
Proceed to the #Testing the Installation section.

Starting ActiveMQ
There now follows instructions on how to run the ActiveMQ Message Broker.
See also Starting ActiveMQ with a different configuration file

On Windows
From a console window, change to the installation directory and run ActiveMQ
:
cd [activemq_install_dir]

where activemq_install_dir
is the directory in which ActiveMQ was installed, e.g., c:\Program Files\ActiveMQ-5.x
.
Then type (depending on ActiveMQ version):
ActiveMQ 5.10 onwards
bin\activemq start

ActiveMQ 5.9 or older
bin\activemq

NOTE: Working directories get created relative to the current directory. To create working directories in the proper place, ActiveMQ must be launched from its home/installation directory.
On Unix
From a command shell, change to the installation directory and run ActiveMQ
:
cd [activemq_install_dir]

where activemq_install_dir
is the directory in which ActiveMQ was installed, e.g., /usr/local/activemq-5.x
. Then type:
bin/activemq start

OR

bin/activemq start > /tmp/smlog
2

&
1
&;

Note: /tmp/smlog may be changed to another file name.

NOTE: Working directories get created relative to the current directory. To create working directories in the proper place, ActiveMQ must be launched from its home/installation directory.
Warning
Do NOT close the console or shell in which ActiveMQ was started, as that will terminate ActiveMQ (unless ActiveMQ was started with nohup).
nohup bin/activemq > /tmp/smlog
2

&
1
&

More help
For other ways of running the broker see Here. For example you can run an embedded broker inside your JMS Connection to avoid starting a separate process.
Testing the Installation
If ActiveMQ is up and running without problems, the Window's console window or the Unix command shell will display information similar to the following log line:
INFO ActiveMQ JMS Message Broker (ID:apple-s-Computer.local-
51222

1140729837569

0
:
0
) has started

ActiveMQ's default port is 61616. From another window run netstat and search for port 61616.
From a Windows console, type:
netstat -an|find
"61616"

OR
From a Unix command shell, type:
netstat -an|grep
61616

Monitoring ActiveMQ
You can monitor ActiveMQ using the Web Console by pointing your browser at
http://localhost:8161/admin
From ActiveMQ 5.8 onwards the web apps is secured out of the box.The default username and password is admin/admin. You can configure this in the conf/jetty-real.properties file.

Or you can use the JMX support to view the running state of ActiveMQ.
For more information see the file docs/WebConsole-README.txt
in the distribution.
Stopping ActiveMQ
For both Windows and Unix installations, terminate ActiveMQ by typing "CTRL-C" in the console or command shell in which it is running.
If ActiveMQ was started in the background on Unix, the process can be killed, with the following:
cd [activemq_install_dir]

where activemq_install_dir
is the directory in which ActiveMQ was installed, e.g., /usr/local/activemq-5.x
. Then type:
bin/activemq stop

Or you can do the following:
ps -ef|grep activemq

kill [PID]

where [PID] is the process id of the ActiveMQ process.

Starting ActiveMQ with a different configuration file
By default ActiveMQ uses the conf/activemq.xml
as the main configuration file when starting. If you want to use a different configuration file you can specify this as a parameter.
ActiveMQ 5.8 or older
For example to use conf/activemq-demo.xml
which includes the web demos, you do as follows:
bin/activemq console xbean:conf/activemq-demo.xml

To start Active in console mode and load the conf/activemq-demo.xml
file. Yes you need the xbean:
as prefix.
And to launch as a background process you can do:
bin/activemq start xbean:conf/activemq-demo.xml

ActiveMQ 5.9 onwards
For example to use examples/conf/activemq-demo.xml
which includes the web demos, you do as follows:
bin/activemq console xbean:examples/conf/activemq-demo.xml

To start Active in console mode and load the examples/conf/activemq-demo.xml
file. Yes you need the xbean:
as prefix.
And to launch as a background process you can do:
bin/activemq start xbean:examples/conf/activemq-demo.xml

Configuring ActiveMQ
The ActiveMQ broker should now run. You can configure the broker by specifying an Xml Configuration file as a parameter to the activemq command. An alternative is to use the Broker Configuration URI to configure things on the command line in a concise format (though the configuration options are not as extensive as if you use Java or XML code). You can also
Also see Configuring Transports to see how you can configure the various connection, transport and broker options using the connection URL in the ActiveMQConnectionFactory.
See the Initial Configuration for details of which jars you need to add to your classpath to start using ActiveMQ in your Java code
If you want to use JNDI to connect to your JMS provider then please view the JNDI Support. If you are a Spring user you should read about Spring Support
After the installation, ActiveMQ is running with a basic configuration. For details on configuring options, please see refer to the Configuration section.
Additional Resources
If you are new to using ActiveMQ, running the Web Samples or the Examples is a good next step to learn more about ActiveMQ.

Overview
Index
News
New Features
Getting Started
FAQ
Articles
Books
Download
License

Search

Sub Projects
Artemis
Apollo
CMS
NMS

Community
Support
Contributing
Discussion Forums
Mailing Lists
IRC
IRC Log
Security Advisories
Site
Sponsorship
Projects Using ActiveMQ
Users
Team
Thanks

Features
Advisory Message
Clustering
Cross Language Clients
Enterprise Integration Patterns
JMX
JMS to JMS Bridge
MasterSlave
Message Groups
Networks of Brokers
Performance
Persistence
Security
Virtual Destinations
Visualisation
More ...

Connectivity
Ajax
AMQP
Axis and CXF Support
C Integration
C++
C# and .Net Integration
CMS
J2EE
JBoss Integration
Jetty
JNDI Support
NMS
REST
RSS and Atom
Spring Support
Stomp
Tomcat
Unix Service
WebLogic Integration
XMPP
More ...

Using ActiveMQ 5
Getting Started
Initial Configuration
Running a Broker
Embedded Brokers
Command Line Tools
Configuring Transports
Examples
Web Samples
Monitoring the Broker
Xml Configuration
Xml Reference
More ...

Tools
Web Console
Maven2 Performance Plugin

Support
Issues
Roadmap
Change log

Developers
Source
Building
Developer Guide
Becoming a committer
Code Overview
Wire Protocol
Release Guide

Tests
Maven2 Performance Plugin
Benchmark Tests
JMeter System Tests
JMeter Performance Tests
Integration Tests

Project Reports
JUnit Reports
Source XRef
Test Source XRef
Xml Reference

Privacy Policy - (edit this page)

© 2004-2011 The Apache Software Foundation. Apache ActiveMQ, ActiveMQ, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners. Graphic Design By Hiram

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 194,491评论 5 459
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,856评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,745评论 0 319
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,196评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 61,073评论 4 355
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,112评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,531评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,215评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,485评论 1 290
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,578评论 2 309
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,356评论 1 326
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,215评论 3 312
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,583评论 3 299
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,898评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,174评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,497评论 2 341
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,697评论 2 335

推荐阅读更多精彩内容