apache-activemq的安装配置
今天公司同事要我帮忙装个activemq,activemq是Apache出品,最流行的,能力强劲的开源消息总线.activemq是一个完全支持JMS1.1和J2EE 1.4规范的 JMS Provider实现,尽管JMS规范出台已经是很久的事情了,但是JMS在当今的J2EE应用中间仍然扮演着特殊的地位.
环境:centos 5.x
需要的软件包:apache-activemq-5.9.0-bin.tar.gz
1.下载
wget http://archive.apache.org/dist/activemq/apache-activemq/5.9.0/apache-activemq-5.9.0-bin.tar.gz
2.安装准备
在安装apache-activemq之前,必需要安装得有jdk环境,大家可以去看我这篇centos安装jdk 1.6文章.
3.安装activemq
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
更改ACTIVEMQ_OPTS_MEMORY的配置为ACTIVEMQ_OPTS_MEMORY="-Xms256M -Xmx384M -XX:PermSize=256M -XX:MaxPermSize=384M"
vi /etc/profile
export PATH=/usr/local/activemq/bin:$PATH
保存后,执行:
source /etc/profile
配置自启动:
vi /etc/init.d/activemq
保存并给与执行权限:
环境:centos 5.x
需要的软件包:apache-activemq-5.9.0-bin.tar.gz
1.下载
wget http://archive.apache.org/dist/activemq/apache-activemq/5.9.0/apache-activemq-5.9.0-bin.tar.gz
2.安装准备
在安装apache-activemq之前,必需要安装得有jdk环境,大家可以去看我这篇centos安装jdk 1.6文章.
3.安装activemq
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
更改ACTIVEMQ_OPTS_MEMORY的配置为ACTIVEMQ_OPTS_MEMORY="-Xms256M -Xmx384M -XX:PermSize=256M -XX:MaxPermSize=384M"
vi /etc/profile
export PATH=/usr/local/activemq/bin:$PATH
保存后,执行:
source /etc/profile
配置自启动:
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 "$1" in start) echo "Starting ActiveMQ " /bin/su – $AMQ_USER -c "$CMD $1 >/dev/null 2>&1 &" ;; stop) echo "Shutting down ActiveMQ" /bin/su – $AMQ_USER -c "kill -9 `ps -u activemq -o pid=`" ;; restart) $0 stop $0 start ;; status) echo "you wish – not yet implemented" ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac
保存并给与执行权限:
chmod +x /etc/init.d/activemq
service activemq start
chkconfig activemq on
评论: