centos 5.x下apache-activemq的安裝配置

來源:互聯網
上載者:User

今天公司同事要我幫忙裝個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


#!/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

直接輸入http://ip:8161/admin/index.jsp能正常訪問,就可以了.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.