1 Download RockeMQ Package:

You need to download it and put it to the OS Image.

wget http://apache.claz.org/rocketmq/4.3.2/rocketmq-all-4.3.2-bin-release.zip
and unzip the package to /opt/rocketmq


2 Prerequsite

JDK installed.

3 Create service account for Jetty

useradd -m rocketmq
echo "umask 002" >> /home/rocketmq/.bash_profile


4 Modify PATH system variable
4

run /opt/rocketmq/bin/os.sh
change JVM parameters in /opt/rocketmq/bin/runserver.sh


5 Configure RocketMQ

run /opt/rocketmq/bin/os.sh
change JVM parameters in /opt/rocketmq/bin/runserver.sh
change JVM parameters in /opt/rocketmq/bin/runbroker.sh
#Note: Usually set the Xmn to 1/8 or Xmx

8 Add RocketMQ to system service

cd /etc/init.d
vi rocketmq  and add
 
 
#!/usr/bin/env bash
#
# rocketmq - this script starts and stops the rocketmq daemon
#
# chkconfig:   - 85 15
ROCKETMQ_HOME=/opt/rocketmq
ROCKETMQ_BIN=${ROCKETMQ_HOME}/bin
ADDR=`hostname -i`:9876
LOG_DIR=${ROCKETMQ_HOME}/logs
NAMESERVER_LOG=${LOG_DIR}/namesrv.log
BROKER_LOG=${LOG_DIR}/broker.log
start() {
    if [ ! -d ${LOG_DIR} ];then
       su - rocketmq -c "mkdir ${LOG_DIR}"
    fi
    cd ${ROCKETMQ_HOME}
    su - rocketmq -c  "nohup sh $ROCKETMQ_HOME/bin/mqnamesrv > ${NAMESERVER_LOG} 2>&1 &"
    echo  "The Name Server boot success..."
    su - rocketmq -c  "nohup  sh $ROCKETMQ_HOME/bin/mqbroker -n ${ADDR} > ${BROKER_LOG} 2>&1 &"
    echo  "The broker[%s, ${ADDR}] boot success..."
}
stop() {
    cd ${ROCKETMQ_HOME}
    su - rocketmq -c "sh $ROCKETMQ_HOME/bin/mqshutdown broker"
    sleep 1
    su - rocketmq -c "sh $ROCKETMQ_HOME/bin/mqshutdown namesrv"
}
restart() {
    stop
    sleep 5
    start
}
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        restart
        ;;
    *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 2
esac
 
 
#################################################
chmod a+x rocketmq
chkconfig --add rocketmq
chown -R rocketmq:rocketmq /opt/rocketmq

CentOS -- RocketMQ 4.3.2 standalone Installation and Configuration的更多相关文章

  1. RocketMQ 4.3.2 standalone Installation and Configuration

    1 Download RockeMQ Package: You need to download it and put it to the OS Image. wget http://apache.c ...

  2. CentOS -- Redis 3.2.12 Standalone Install and Configuration

    1 Tune OS setting  echo never > /sys/kernel/mm/transparent_hugepage/enabled echo "vm.overcom ...

  3. P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1

    P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1       May ...

  4. P6 EPPM Installation and Configuration Guide 16 R1 April 2016

    P6 EPPM Installation and Configuration Guide 16 R1         April 2016 Contents About Installing and ...

  5. installation and configuration of OpenCV4Android SDK

    http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html#running-opencv ...

  6. !! This tutorial was designed to help you with installation and configuration of OpenCV4Android SDK.

    ref: http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html#running-o ...

  7. HHVM Installation and Configuration(HHVM 安装及配置)

    Installation and Configuration¶ General Installation Considerations Installation on Linux systems Ub ...

  8. Installation and Configuration MySQL Cluster 7.2 on CentOS 5 (include MySQL 5.5)

    Architecture Manager Node mysql-mag1   192.168.1.31 mysql-mag2   192.168.1.32 SQL Node mysql-sql1   ...

  9. HAProxy Installation and Configuration on CentOS 6.4 to Mitigate The Effects of Abusive Clients--转

    ref:http://thoughts.z-dev.org/2013/05/07/haproxy-installation-and-configuration-on-centos-6-4-to-mit ...

随机推荐

  1. Linux下gcc编译器的使用

    例:gcc -x -g c helloC -o firstC -x:改变gcc的行为.(注:如果是.c文件则不用加-x) -x c :编译c程序 -x c++ :编译c++程序 -x java :编译 ...

  2. 【未解决】iOS QBImagePickerController访问相册没有取消和确定按钮

    这两天调程序时遇到了这个问题,如图所示: 感觉这问题也是奇葩………… 用系统的 UIImagePickerController 替换后就正常了.看来是 QBImagePickerController ...

  3. DataOps系列丨数据的“资产负债表”与“现状”

    作者:DataPipeline CEO 陈诚 <跨越鸿沟>的作者Geoffrey Moore曾说“没有数据,运营企业就像一个又聋又瞎的人在高速上开车一样”.数据的价值从未像现在这样被企业重 ...

  4. leetcode 29 两数相除

    问题描述 给定两个整数,被除数 dividend 和除数 divisor.将两数相除,要求不使用乘法.除法和 mod 运算符. 返回被除数 dividend 除以除数 divisor 得到的商. 示例 ...

  5. 邻域保持嵌入(NPE)

    传统的线性降维方法,如主成分分析(PCA).因子分析(FA)等,关注的是样本的方差,能学习线性流形的结构,却无法学习非线性流形.而经典的流形学习方法虽然能够学习非线性流形结构,但由于本身属于直推学习, ...

  6. JavaWeb——使用会话维持状态

    1.会话的作用 使用会话是为了维持状态,维持的是请求域请求之间的状态.因为HTTP请求自身是完全无状态的.从服务器的角度来看,当用户发出第一个请求开始,服务器无法将新的请求与之前的请求关联起来,举例说 ...

  7. Romantic HDU - 2669(扩欧)

    #include<bits/stdc++.h> using namespace std; typedef long long LL; void gcd(LL a, LL b, LL &am ...

  8. javaweb基础整理随笔-----上传与下载步骤详解

    这次整理的是上传与下载的原生代码解析: 上传:1.对页面的要求:enctype="multipart/form-data" method="post"      ...

  9. .netcore持续集成测试篇之搭建内存服务器进行集成测试一

    系列目录 在web项目里,我们把每一层的代码的单元测试都通过并不代表程序能正常运行,因为这个过程缺失了http管道,很多时候我们还还需要把项目布在iis环境中或者在vs里启动iis express服务 ...

  10. ajax+JQuery实现类似百度智能搜索框

    最近再学习ajax,上课老师让我们实现一个类似百度首页实现搜索框的功能,刚开始做的时候没有一点头绪,查阅大量网上的资源后,发现之前的与我们现在的有些区别,所以在此写出来,希望能对大家有所帮助. 下面先 ...