写点什么

rocketmq4 docker 安装 阿里云 linux2(centos7)

作者:folo
  • 2023-06-02
    湖北
  • 本文字数:1038 字

    阅读完需:约 3 分钟

创建用户与组

# 创建组$ groupadd rocketmq# 增加用户并加入组$ useradd -g rocketmq rocketmq# 设置用户密码 $PWD_XXX$ passwd rocketmq# 更改组的 gid$ groupmod -g 3000 rocketmq# 更改用户的 uid$ usermod -u 3000 rocketmq# 查看是否更改成功$ id rocketmq
复制代码

创建目录与授权(/data/bo/rocket_mq 是自己设置的宿主机存放位置)

# 创建相关目录mkdir -p /data/bo/rocket_mq/namesrv/logsmkdir -p /data/bo/rocket_mq/namesrv/storemkdir -p /data/bo/rocket_mq/broker/logsmkdir -p /data/bo/rocket_mq/broker/storemkdir -p /data/bo/rocket_mq/broker/conf# 给所有目录进行授权 chown -R rocketmq:rocketmq /data/bo/rocket_mq
复制代码

配置 broker.conf

# 配置broker.conf vi /data/bo/rocket_mq/broker/conf/broker.conf# 文件内容brokerClusterName = DefaultClusterbrokerName=broker-abrokerId=0deleteWhen=04fileReservedTime=48brokerRole=ASYNC_MASTERflushDiskType=ASYNC_FLUSHbrokerIP1=宿主机器ip,应用程序能访问到的ipautoCreateTopicEnable=true
复制代码

启动 namesrv

# 启动namesrvdocker run \-d \-p 9876:9876 \--name rmqnamesrv \-v /data/bo/rocket_mq/namesrv/logs:/home/rocketmq/logs \-v /data/bo/rocket_mq/namesrv/store:/home/rocketmq/store \-e "JAVA_OPT_EXT=-server -Xms512M -Xmx512M -Xmn128m" \apache/rocketmq:4.9.4 \sh mqnamesrv
复制代码

启动 broker

# 启动brokerdocker run \-d \-p 10911:10911 \-p 10909:10909 \--name rmqbroker \-v /data/bo/rocket_mq/broker/logs:/home/rocketmq/logs \-v /data/bo/rocket_mq/broker/store:/home/rocketmq/store \-v /data/bo/rocket_mq/broker/conf/broker.conf:/home/rocketmq/rocketmq-4.9.4/conf/broker.conf \--link rmqnamesrv:namesrv \-e "JAVA_OPT_EXT=-server -Xms1g -Xmx1g -Xmn512m" \-e "NAMESRV_ADDR=namesrv:9876" \apache/rocketmq:4.9.4 \sh mqbroker -c /home/rocketmq/rocketmq-4.9.4/conf/broker.conf
复制代码

启动 web 控制台

# 启动web控制台docker run \-d \--name rocketmq-dashboard \-p 28081:8080 \-t \--link rmqnamesrv:namesrv \-e "JAVA_OPTS=-Drocketmq.namesrv.addr=namesrv:9876 -Xms1024M -Xmx1024M -Xmn512m" \apacherocketmq/rocketmq-dashboard:latest
复制代码


参考资料:

https://rocketmq.apache.org/zh/docs/4.x/

https://github.com/apache/rocketmq-docker

https://github.com/apache/rocketmq-dashboard

发布于: 刚刚阅读数: 5
用户头像

folo

关注

还未添加个人签名 2019-01-11 加入

还未添加个人简介

评论

发布
暂无评论
rocketmq4 docker安装 阿里云linux2(centos7)_Docker_folo_InfoQ写作社区