部署ActiveMQ

1.安装jdk8

1
2
[admin@xfyun-bj-tools1 admin]$ tar xf downloads/jdk-8u192-linux-x64.tar.gz
[admin@xfyun-bj-tools1 admin]$ mv jdk1.8.0_192 jdk1.8.0

2.安装activemq

1
2
3
4
5
6
7
8
9
[admin@xfyun-bj-tools1 admin]$ tar xf apache-activemq-5.11.1-bin.tar.gz
[admin@xfyun-bj-tools1 admin]$ sudo vim /etc/profile
export JAVA_HOME=/work/admin/jdk1.8.0
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export ACTIVEMQ_HOME=/work/admin/apache-activemq-5.11.1
export PATH=${JAVA_HOME}/bin:$PATH:$ACTIVEMQ_HOME/bin

[admin@xfyun-bj-tools1 admin]$ source /etc/profile

3.配置开机启动

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
31
32
33
34
35
36
37
38
39
40
[admin@xfyun-bj-tools1 admin]$ cat /etc/init.d/activemq
#!/bin/sh
#

# /etc/init.d/activemq

# chkconfig: 345 63 37

# description: activemq servlet container.

# processname: activemq 5.15.2

# Source function library.

#. /etc/init.d/functions

# source networking configuration.

#. /etc/sysconfig/network

export JAVA_HOME=/work/admin/jdk1.8.0
export ACTIVEMQ_HOME=/work/admin/apache-activemq-5.11.1

case $1 in
start)
sh $ACTIVEMQ_HOME/bin/activemq start
;;
stop)
sh $ACTIVEMQ_HOME/bin/activemq stop
;;
status)
sh $ACTIVEMQ_HOME/bin/activemq status
;;
restart)
sh $ACTIVEMQ_HOME/bin/activemq stop
sleep 1
sh $ACTIVEMQ_HOME/bin/activemq start
;;
esac
exit 0

4.添加执行权限

1
[admin@xfyun-bj-tools1 admin]$ sudo chmod +x /etc/init.d/activemq

5.开机启动

1
2
3
4
5
[admin@xfyun-bj-tools1 admin]$ sudo systemctl enable activemq
[admin@xfyun-bj-tools1 admin]$ systemctl is-enabled activemq
activemq.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig activemq --level=5
enabled
-------------本文结束感谢您的阅读-------------