本文记录一下在CentOS 6.7上安装Apache ActiveMQ-5.14.3的过程。
ActiveMQ安装
解压安装
访问Apache ActiveMQ网站,下载ActiveMQ, 本文下载Apache ActiveMQ-5.14.3-bin.tar.gz
在指定目录下(如activemq) , 可以使用tar -zvxf apache-activemq-5.14.3-bin.tar.gz 解压:
[root@dev18 activemq]# tar -zvxf apache-activemq-5.14.3-bin.tar.gz
apache-activemq-5.14.3/
apache-activemq-5.14.3/conf/
apache-activemq-5.14.3/data/
apache-activemq-5.14.3/docs/
apache-activemq-5.14.3/examples/
apache-activemq-5.14.3/examples/amqp/
apache-activemq-5.14.3/examples/amqp/java/
apache-activemq-5.14.3/examples/amqp/java/src/
apache-activemq-5.14.3/examples/amqp/java/src/main/
apache-activemq-5.14.3/examples/amqp/java/src/main/java/
apache-activemq-5.14.3/examples/amqp/java/src/main/java/example/
... ...
apache-activemq-5.14.3/lib/optional/commons-codec-1.9.jar
apache-activemq-5.14.3/lib/optional/xstream-1.4.9.jar
apache-activemq-5.14.3/lib/optional/xpp3-1.1.4c.jar
apache-activemq-5.14.3/lib/optional/activemq-shiro-5.14.3.jar
apache-activemq-5.14.3/lib/optional/shiro-core-1.2.4.jar
apache-activemq-5.14.3/lib/optional/shiro-spring-1.2.4.jar
apache-activemq-5.14.3/lib/optional/commons-dbcp2-2.1.1.jar
apache-activemq-5.14.3/lib/optional/jmdns-3.4.1.jar
apache-activemq-5.14.3/lib/optional/geronimo-j2ee-connector_1.5_spec-2.0.0.jar
apache-activemq-5.14.3/lib/optional/spring-oxm-4.1.9.RELEASE.jar
apache-activemq-5.14.3/lib/optional/jettison-1.3.8.jar
apache-activemq-5.14.3/lib/optional/jasypt-spring31-1.9.2.jar
apache-activemq-5.14.3/lib/optional/insight-log-core-1.2.0.Beta4.jar
apache-activemq-5.14.3/lib/optional/insight-log4j-1.2.0.Beta4.jar
apache-activemq-5.14.3/lib/extra/mqtt-client-1.14.jar
apache-activemq-5.14.3/lib/web/jetty-all-9.2.13.v20150730.jar
apache-activemq-5.14.3/lib/web/rome-1.0.jar
apache-activemq-5.14.3/lib/web/jdom-1.0.jar
apache-activemq-5.14.3/lib/web/spring-webmvc-4.1.9.RELEASE.jar
apache-activemq-5.14.3/lib/web/spring-web-4.1.9.RELEASE.jar
apache-activemq-5.14.3/lib/web/tomcat-servlet-api-8.0.24.jar
apache-activemq-5.14.3/lib/web/tomcat-websocket-api-8.0.24.jar
apache-activemq-5.14.3/lib/web/geronimo-annotation_1.0_spec-1.1.1.jar
apache-activemq-5.14.3/lib/web/asm-5.0.4.jar
apache-activemq-5.14.3/lib/web/apache-jsp-9.2.13.v20150730.jar
apache-activemq-5.14.3/lib/web/apache-jsp-8.0.9.M3.jar
apache-activemq-5.14.3/lib/web/apache-el-8.0.9.M3.jar
apache-activemq-5.14.3/lib/web/org.eclipse.jdt.core-3.8.2.v20130121.jar
apache-activemq-5.14.3/lib/web/apache-jstl-9.2.13.v20150730.jar
apache-activemq-5.14.3/lib/web/taglibs-standard-spec-1.2.5.jar
apache-activemq-5.14.3/lib/web/taglibs-standard-impl-1.2.5.jar
apache-activemq-5.14.3/lib/web/jolokia-core-1.3.3.jar
apache-activemq-5.14.3/lib/web/json-simple-1.1.1.jar
启动ActiveMQ
进入bin目录,
[root@dev18 activemq]# cd apache-activemq-5.14.3/bin
[root@dev18 bin]# ll
total 152
-rwxr-xr-x 1 root root 21446 Dec 19 23:41 activemq
-rwxr-xr-x 1 root root 6189 Dec 19 23:41 activemq-diag
-rw-r--r-- 1 root root 15986 Dec 19 23:39 activemq.jar
-rw-r--r-- 1 root root 4884 Dec 19 23:41 env
drwxr-xr-x 2 root root 4096 Dec 29 10:14 linux-x86-32
drwxr-xr-x 2 root root 4096 Dec 29 10:14 linux-x86-64
drwxr-xr-x 2 root root 4096 Dec 29 10:14 macosx
-rw-r--r-- 1 root root 83820 Dec 19 23:35 wrapper.jar
[root@dev18 bin]#
然后使用./activemq start命令启动ActiveMQ。
[root@dev18 bin]# ./activemq start
INFO: Loading '/srv/activemq/apache-activemq-5.14.3//bin/env'
INFO: Using java '/usr/java/jdk1.7.0_71/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
INFO: pidfile created : '/srv/activemq/apache-activemq-5.14.3//data/activemq.pid' (pid '4308')
验证是否启动
可以使用ps -ef|grep activemq先看一下ActiveMQ的进程信息,查看是否已经成功启动ActiveMQ服务。
[root@dev18 bin]# ps -ef|grep activemq
root 4308 1 10 10:18 pts/2 00:00:10 /usr/java/jdk1.7.0_71/bin/java -Xms64M -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/srv/activemq/apache-activemq-5.14.3//conf/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir=/srv/activemq/apache-activemq-5.14.3//tmp -Dactivemq.classpath=/srv/activemq/apache-activemq-5.14.3//conf:/srv/activemq/apache-activemq-5.14.3//../lib/: -Dactivemq.home=/srv/activemq/apache-activemq-5.14.3/ -Dactivemq.base=/srv/activemq/apache-activemq-5.14.3/ -Dactivemq.conf=/srv/activemq/apache-activemq-5.14.3//conf -Dactivemq.data=/srv/activemq/apache-activemq-5.14.3//data -jar /srv/activemq/apache-activemq-5.14.3//bin/activemq.jar start
root 4376 4165 0 10:20 pts/2 00:00:00 grep activemq
[root@dev18 bin]#
查看管理控制台, 控制台的默认端口是8161,打开管理页面的URL路径为:
http://<YOUR_IP>:8161/admin/
默认账户的名称和密码都是admin, 可以在/ACTIVEMQ_HOME/conf/jetty-realm.properties中配置。
jetty-realm.properties默认情况下的内容如下:
# Defines users that can access the web (console, demo, etc.)
# username: password [,rolename ...]
admin: admin, admin
user: user, user
使用admin/admin登录之后,看到如下页面内容,表示安装成功。