activemq安装

环境准备

1. 单机版安装

1. 上传安装包至服务器并解压

1
tar -zxvf apache-activemq-5.16.3-bin.tar.gz

2. 开放端口

1
2
3
4
5
6
7
8
9
# 修改配置文件
vi /usr/local/apache-activemq-5.16.3/conf/jetty.xml

# 修改前
<property name="host" value="127.0.0.1"/>
# 修改后
<property name="host" value="0.0.0.0"/>

# 保存退出

3. 设置成系统服务

  • 编辑文件
1
vi /etc/init.d/activemq
  • 拷贝以下内容,并保存退出
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
#
# /etc/init.d/activemq
# chkconfig: 345 63 37
# description: activemq servlet container.
# processname: activemq 5.14.1

# Source function library.
#. /etc/init.d/functions
# source networking configuration.
#. /etc/sysconfig/network

export JAVA_HOME=/usr/java/
export CATALINA_HOME=/usr/local/apache-activemq-5.16.3/

case $1 in
start)
sh $CATALINA_HOME/bin/activemq start
;;
stop)
sh $CATALINA_HOME/bin/activemq stop
;;
restart)
sh $CATALINA_HOME/bin/activemq stop
sleep 1
sh $CATALINA_HOME/bin/activemq start
;;

esac
exit 0
  • 给文件赋权
1
chmod a+x /etc/init.d/activemq
  • 添加开机启动
1
chkconfig --add activemq
  • 常用命令
1
2
3
service activemq start
service activemq stop
service activemq status

2.2 集群版安装(Master-Slave)

2.2 集群版安装(Broker Cluster)

文章目录
  1. 1. 1. 单机版安装
    1. 1.1. 1. 上传安装包至服务器并解压
    2. 1.2. 2. 开放端口
    3. 1.3. 3. 设置成系统服务
    4. 1.4. 2.2 集群版安装(Master-Slave)
    5. 1.5. 2.2 集群版安装(Broker Cluster)
|