安装前提条件(推荐) 64bit OS, Linux/Unix/Mac (Windows不兼容)64bit JDK 1.8+;

快速开始

http://rocketmq.apache.org/docs/quick-start/

下载安装包

https://www.apache.org/dyn/closer.cgi?path=rocketmq/4.9.4/rocketmq-all-4.9.4-source-release.zip

解压安装包

   unzip rocketmq-all-4.9.4-source-release.zip

进入目录

  cd rocketmq-all-4.9.4-source-release/

构建环境

   mvn -Prelease-all -DskipTests clean install -U

最终路径

   cd distribution/target/rocketmq-4.9.4/rocketmq-4.9.4

最新版本部署存在问题

Please set the JAVA_HOME variable in your environment, We need java(x64)

解决:本地需要配置 JAVA_HOME 使用命令 vim ~/.bash_profile

JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home"
export JAVA_HOME
CLASS_PATH="$JAVA_HOME/lib"
PATH=".$PATH:$JAVA_HOME/bin"

使用 source /etc/profile 让配置立刻生效

启动nameServer

nohup sh bin/mqnamesrv &

查看日志

tail -f nohup.out

(结尾:The Name Server boot success. serializeType=JSON 表示启动成功)

启动broker

(-n指定nameserver地址,nameserver服务端口为9876, broker默认端口 10911)

nohup sh bin/mqbroker -n localhost:9876 &

验证是否成功

  1. 设置名称服务地址

export NAMESRV_ADDR=localhost:9876

  1. 投递消息

sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer

SendResult [sendStatus=SEND_OK, msgId= ...

  1. 消费消息

sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer

ConsumeMessageThread_%d Receive New Messages: [MessageExt...

关闭服务器

关闭broker

 sh bin/mqshutdown broker

The mqbroker(36695) is running...

Send shutdown request to mqbroker(36695) OK

关闭 namesrv

 sh bin/mqshutdown namesrv

The mqnamesrv(36664) is running...

Send shutdown request to mqnamesrv(36664) OK

问题

Liunx 解压安装

yum install unzip

NameServer内存不足

报错问题如下

[root@iZwz94sw188z3yfl7lpmmsZ apache-rocketmq]# sh bin/mqnamesrv

Java HotSpot(TM) 64-Bit Server VM warning: Using the DefNew young collector with the CMS collector is deprecated and will likely be removed in a future release

Java HotSpot(TM) 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.

Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006ec800000, 2147483648, 0) failed; error='Cannot allocate memory' (errno=12)

There is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (mmap) failed to map 2147483648 bytes for committing reserved memory.

An error report file with more information is saved as:

/usr/local/software/rocketmq-all-4.4.0/distribution/target/apache-rocketmq/hs_err_pid8993.log

解决

 bin/runserver.sh

修改内存

JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"

Broker内存不足

runbroker.sh

修改内存

JAVA_OPT="${JAVA_OPT} -server -Xms528m -Xmx528m -Xmn256m"

最新文章

  1. [Sass]扩展/继承
  2. 编译安装 Zend Opcache 缓存Opcache,加速 PHP
  3. linux 脚本小试系列
  4. C语言程序设计第四次作业
  5. C# Graphics类详解
  6. 网页加载图片原理<转>
  7. explain mysql的type字段,索引的类型
  8. select框内容的编辑、修改、添加、删除操作
  9. 16.3.1-sp_getapplock
  10. Servlet之Cookie操作
  11. SAR命令
  12. POJ 1410 Intersection(判断线段交和点在矩形内)
  13. 获取属性名:PropertyNameHelper
  14. 解决图片元素下多余空白的BUG
  15. zb的生日(暴搜dfs)
  16. Android定位功能
  17. 使用OTP动态口令(每分钟变一次)进行登录认证
  18. DOCKER 从入门到放弃(二)
  19. C#无限分级实现,前端WEB页面接收,后台提供层级Json数据
  20. vscode调试适配器已意外终止

热门文章

  1. 随机数Random和SecureRandom
  2. CDO学习2 CDO 入门教程Tutorial
  3. 【小记】如果 golang 内存不够了怎么办
  4. SparkRDD所有算子操作,建议全部手敲一遍
  5. 转载安卓或苹果手机获取URL scheme方法
  6. editorconfig配置
  7. 微信小程序学习记录
  8. IDEA常用的快捷键(win版)
  9. Es6中模块引入的相关内容
  10. docker介绍、安装及镜像管理