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.claz.org/rocketmq/4.3.2/rocketmq-all-4.3.2-bin-release.zipand unzip the package to /opt/rocketmq |
2 Prerequsite
JDK installed.
3 Create service account for Jetty
useradd -m rocketmqecho "umask 002" >> /home/rocketmq/.bash_profile |
4 Modify PATH system variable4
run /opt/rocketmq/bin/os.shchange JVM parameters in /opt/rocketmq/bin/runserver.sh |
5 Configure RocketMQ
run /opt/rocketmq/bin/os.shchange JVM parameters in /opt/rocketmq/bin/runserver.shchange 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.dvi rocketmq and add#!/usr/bin/env bash## rocketmq - this script starts and stops the rocketmq daemon## chkconfig: - 85 15ROCKETMQ_HOME=/opt/rocketmqROCKETMQ_BIN=${ROCKETMQ_HOME}/binADDR=`hostname -i`:9876LOG_DIR=${ROCKETMQ_HOME}/logsNAMESERVER_LOG=${LOG_DIR}/namesrv.logBROKER_LOG=${LOG_DIR}/broker.logstart() { 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 2esac#################################################chmod a+x rocketmqchkconfig --add rocketmqchown -R rocketmq:rocketmq /opt/rocketmq |
9 add a boot script to setup Rocketmq JVM(below script is only for standalone mode)
#!/bin/bash#set -x#this script is only going to set Rocketmq standalone installation(nameserver and broker server in a same host)RQ_HOME_BIN=/opt/rocketmq/bin#RQ_HOME_BIN=/home/dc-user/rq/rocketmq-all-4.3.2-bin-release/bin#$RQ_HOME_BIN/runserver.sh to modify the #39 JAVA_OPT="${JAVA_OPT} -server -Xms4g -Xmx4g -Xmn2g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"#$RQ_HOME_BIN/runbroker.sh to modify the #39 JAVA_OPT="${JAVA_OPT} -server -Xms8g -Xmx8g -Xmn4g"#get current physical memory settingmem_size=`free -m | grep Mem | awk '{print $2}'`#set jetty JVM xmx to 50% of memjmem=$(($mem_size/4))jmemn=$(($jmem/2))jmem=$jmem"m"jmemn=$jmemn"m"sed -i "s/-Xmn[0-9]\+[g|m]/-Xmn$jmemn/g" $RQ_HOME_BIN/runserver.shsed -i "s/-Xms[0-9]\+[g|m]/-Xms$jmem/g" $RQ_HOME_BIN/runserver.shsed -i "s/-Xmx[0-9]\+[g|m]/-Xmx$jmem/g" $RQ_HOME_BIN/runserver.shsed -i "s/-Xmn[0-9]\+[g|m]/-Xmn$jmemn/g" $RQ_HOME_BIN/runbroker.shsed -i "s/-Xms[0-9]\+[g|m]/-Xms$jmem/g" $RQ_HOME_BIN/runbroker.shsed -i "s/-Xmx[0-9]\+[g|m]/-Xmx$jmem/g" $RQ_HOME_BIN/runbroker.sh |
RocketMQ 4.3.2 standalone Installation and Configuration的更多相关文章
- CentOS -- 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 ...
- 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 ...
- P6 EPPM Installation and Configuration Guide 16 R1 April 2016
P6 EPPM Installation and Configuration Guide 16 R1 April 2016 Contents About Installing and ...
- installation and configuration of OpenCV4Android SDK
http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html#running-opencv ...
- !! 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 ...
- HHVM Installation and Configuration(HHVM 安装及配置)
Installation and Configuration¶ General Installation Considerations Installation on Linux systems Ub ...
- SharePoint 2013 Installation and Configuration Issues
# Issue 1: During Installing SharePoint 2013 Prerequisites there was an error in installing Applicat ...
- 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 ...
- 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 ...
随机推荐
- C#编程.函数.委托
注:委托最重要的用途最讲到事件和事件处理时才能说清,这里先简单介绍一下关于委托的一些内容 委托是一种可以把引用存储为函数的类型.这听起来相当棘手,但其机制是非常简单的. 1)委托的声明非常类似与函数, ...
- Java基础之分支结构循环结构
流程控制语句if(分支结构) 流程控制:流程就是指代码运行过程.控制就是说什么场景可以执行,什么场景不能执行. 1.if语句第一种形式 格式:if(表达式){ 执行的语句: } 2. ...
- MyBatis映射,抛出Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'oid' in 'class java.lang.String'
原因在于: 在MyBatis中使用动态语句的判断时,传入的参数(parameterType)为Java基本数据类型,获取的结果(resultType)为JavaBean对象,此时就会抛出该异常,此时可 ...
- PLSQL连接数据库报监听程序找不到符合协议堆
服务器上某个数据库出现' ORA-12516: TNS: 监听程序找不到符合协议堆栈要求的可用处理程'错误,要解决该问题首先查看一下数据库现有的进程数,是否已经达到参数processes的大小 根 ...
- 洛谷 P5150 题解
题面 因为 n=lcm(a,b)n = lcm(a, b)n=lcm(a,b) ,可以得出: a 和 b 的质因数都是 n 的质因数 对于 n 的每个质因数 x ,在 n 中的次数为 y ,那么 ...
- firewalld防火墙命令规则设置
1.firewalld的基本使用 启动/关闭: systemctl start/stop firewalld 查看状态: systemctl status firewalld 开机启用/禁用 : sy ...
- NYOJ 53 最少步数
题 目 http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=58 思路借鉴 DFS-Deep First Search-深度优先 ...
- maven-assembly-plugin 进行打包
maven-assembly-plugin使用描述(拷自 maven-assembly-plugin 主页) The Assembly Plugin for Maven is primarily in ...
- HTML/CSS:div水平与元素垂直居中(2)
单个div水平居中:设置margin的左右边距为自动 div水平和垂直居中,text-align和vertical-align不起作用,因为标签div没有这两个属性,所以再css中设置这两个值不能居中 ...
- 关于 IntelliJ 的 IDEA PyCharm 等更新 2019.2 后中文乱码 的解决方案
关于IntelliJ 的2019.2 更新后的中文乱码解决方案 设置 备用字体 file -> Setting -> Editor ->Font 由于编程常用英文首选字体font默认 ...