Today, my company colleagues asked me to help install a ACTIVEMQ,ACTIVEMQ is Apache, the most popular, powerful open source message bus. ACTIVEMQ is a JMS provider implementation that fully supports the JMS1.1 and Java EE 1.4 specifications, Although it has been a long time since the JMS specification was introduced, JMS still plays a special role in today's Java EE applications.
Environment: CentOS 5.x
Required Packages: apache-activemq-5.9.0-bin.tar.gz
1. Download
The code is as follows |
Copy Code |
wget http://archive.apache.org/dist/activemq/apache-activemq/5.9.0/apache-activemq-5.9.0-bin.tar.gz |
2. Installation Preparation
Before installing APACHE-ACTIVEMQ, you will need to install a JDK environment, you can go to see my CentOS install JDK 1.6 article.
3. Install ACTIVEMQ
The code is as follows |
Copy Code |
Tar zxf apache-activemq-5.9.0-bin.tar.gz-c/usr/local/ Mv/usr/local/apache-activemq-5.9.0/usr/local/activemq Useradd ACTIVEMQ Chown-r ACTIVEMQ.ACTIVEMQ/USR/LOCAL/ACTIVEMQ Vi/usr/local/activemq/bin/activemq
|
Change the configuration of activemq_opts_memory to activemq_opts_memory= "-xms256m-xmx384m-xx:permsize=256m-
The code is as follows |
Copy Code |
Xx:maxpermsize=384m " Vi/etc/profile Export Path=/usr/local/activemq/bin: $PATH |
After saving, execute:
The code is as follows |
Copy Code |
Source/etc/profile |
Configure from Start:
The code is as follows |
Copy Code |
Vi/etc/init.d/activemq #!/bin/bash # # ACTIVEMQ starts activemq. # # # chkconfig:345 88 12 # DESCRIPTION:ACTIVEMQ is a JMS messaging Queue Server. ### BEGIN INIT INFO # provides: $ACTIVEMQ ### End INIT INFO
# The Base directory Amq_dir= "/USR/LOCAL/ACTIVEMQ"
# run the instance as user Amq_user=activemq
cmd= "Nohup $AMQ _dir/bin/activemq-admin"
Case "$" in Start echo "Starting ActiveMQ" /bin/su– $AMQ _user-c "$CMD $ >/dev/null 2>&1 &" ;; Stop echo "Shutting down ActiveMQ" /bin/su– $AMQ _user-c "kill-9 ' ps-u activemq-o pid= '" ;; Restart) $ stop $ start ;; Status echo "You wish–not yet implemented" ;; *) echo "Usage: $ {Start|stop|restart|status}" Exit 1 ;; Esac |
Save and give execution permissions:
The code is as follows |
Copy Code |
chmod +X/ETC/INIT.D/ACTIVEMQ Service ACTIVEMQ Start Chkconfig ACTIVEMQ on |
Direct input http://ip:8161/admin/index.jsp can be normal access, on it.