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. C#编程.异常处理(Exception Handling Statements)

    C#语言包含结构化异常处理(Structured Exception Handling,SEH). throw The throw statement is used to signal the oc ...

  2. 《VR入门系列教程》之5---应用方向

    VR应用方向     面向消费者的虚拟现实才发展了几年,就出现了大量应用程序,虚拟现实抓住了人们对未来的渴望.开发者甚至想要把整个现实世界都做成虚拟现实,这些都是可以理解的.     但是,现在仍然没 ...

  3. .NET领域驱动设计—初尝(一:疑问、模式、原则、工具、过程、框架、实践)

     .NET领域驱动设计—初尝(一:疑问.模式.原则.工具.过程.框架.实践) 2013-04-07 17:35:27 标签:.NET DDD 驱动设计 原创作品,允许转载,转载时请务必以超链接形式标明 ...

  4. java - 多态实现机制

    Java提供了编译时多态和运行时多态两种多态机制.前者是通过方法重载实现的,后者是通过方法的覆盖实现的. 在方法覆盖中,子类可以覆盖父类的方法,因此同类的方法会在父类与子类中有着不同的表现形式. 在J ...

  5. sealos2.0使用教程,最简单kubernetesHA方案

    kubernetes集群三步安装 概述 本文教你如何用一条命令构建k8s高可用集群且不依赖haproxy和keepalived,也无需ansible.通过内核ipvs对apiserver进行负载均衡, ...

  6. sass的核心知识及使用

    sass的官方链接地址:htpp://sass-lang.com 参考链接地址:http://www.haorooms.com/post/sass_css 1. 基础语法 1.1 变量 SASS允许使 ...

  7. 使用Arthas 获取Spring ApplicationContext还原问题现场

    ## 背景 最近来了个实习僧小弟,安排他实现对目标网站 连通性检测的小功能,简单讲就是将下边的shell 脚本换成Java 代码来实现 ``` 1#!/bin/bash 2URL="http ...

  8. main方法中注入Spring bean

    在有些情况下需要使用main使用Spring bean,但是main方法启动并没有托管给Spring管理,会导致bean失败,报空指针异常. 可以使用 ClassPathXmlApplicationC ...

  9. 0R电阻在PCB布线中对布线畅通的一个小妙用

    在PCB布线中,我们都会尽量节约板子空间,将元器件排布的紧密一些,难免会遇到布线不通的时候. 博主下面就来说一个关于0R电阻在PCB布线使之畅通的一个小妙用. 使用0R电阻前 假设我们这个TXD的线周 ...

  10. 解决 Android 中出现依赖多个版本支持库的问题

    在 app 的 build.gradle 中引入依赖时发现如下错误: All com.android.support libraries must use the exact same version ...