【Linux】之搭建 ActiveMQ 环境
使用 wget 命令下载压缩包(下载的版本为:apache-activemq-5.15.9-bin.tar.gz):
wget http://archive.apache.org/dist/activemq/5.15.9/apache-activemq-5.15.9-bin.tar.gz
解压缩并复制到 /usr/local/ 目录下
tar -zxvf apache-activemq-5.15.9-bin.tar.gz
cp apache-activemq-5.15.9 /usr/local/activemq
添加环境变量,编辑 /etc/profile 文件,在末尾添加:
EXPORT $PATH:/usr/local/activemq/bin
生效文件
source /etc/profile
启动/关闭/重启 activemq 相关命令:
activemq start/stop/restart
按指定配置文件启动
ActiveMQ 启动时默认加载的配置文件为 conf/activemq.xml,我们也可以指定配置文件启动,比如:
[root@centos conf] activemq start xbean:file:/usr/local/activemq/conf/activemq02.xml
INFO: Loading '/usr/local/activemq//bin/env'
INFO: Using java '/usr/local/jdk1.8/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
INFO: pidfile created : '/usr/local/activemq//data/activemq.pid' (pid '7808')
总结为就是启动的使用使用 xbean 加上配置文件路径即可。
查看启动进程,activemq 的默认进程端口是 61616:
ps -ef | grep activemq | grep -v grep
netstat -anp | grep 61616
lsof -i:61616
访问MQ管理控制台
ActiveMQ 控制台默认使用 8161 端口,所以:
访问地址为:http://ipaddr:8161/admin
默认的用户名和密码是:admin/admin
注意,我们客户端编码连接服务器使用的是 61616 端口,比如:tcp://127.0.0.1:61616,而我们 8161 是访问 MQ 控制台的端口属于 http 协议的,比如:http://127.0.0.1:8161。换句话说,访问控制台走的是 http 协议,而客户端连接 MQ 服务器走的是 tcp 协议。
还没有评论,来说两句吧...