首页 > 其他分享 >rocketMq 安装与配置

rocketMq 安装与配置

时间:2022-11-14 11:45:40浏览次数:33  
标签:bin app 配置 mqadmin 192.168 cluster rocketMq 安装 rocketmq

下载rocketmq-all-4.7.1-bin-release.zip

上传到服务器 /app/rocketmq

,并且解压

# mkdir -p /app/rocketmq
# tar -zxvf rocketmq-all-4.7.1-bin-release.zip
[root@localhost app]# cd rocketmq
[root@localhost rocketmq]# ls
data  rocketmq-all-4.7.1-bin-release  rocketmq-all-4.7.1-bin-release.zip

 

mq的主要配置文件路径:/app/rocketmq/rocketmq-all-4.7.1-bin-release/conf

找到 broker.conf

 

 这里配置文件,主要修改为如下配置

[root@localhost conf]# vi broker.conf 
#
Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

brokerClusterName = rocketmq-cluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
listenPort=18200
brokerIP1=192.168.1.252 # 这个是因为机器存在多网卡时,对外指定IP
namesrvAddr=192.168.1.252:9876 #访问server的地址
defaultTopicQueueNums=8
autoCreateTopicEnable=false
autoCreateSubscriptionGroup=false
storePathRootDir=/app/rocketmq/data/store-a
storePathCommitLog=/app/rocketmq/data/store-a/commitlog
storePathConsumerQueue=/app/rocketmq/data/store-a/consumequeue
storePathIndex=/app/rocketmq/data/store-a/index
storeCheckpoint=/app/rocketmq/data/store-a/checkpoint
abortFile=/app/rocketmq/data/store-a/abort
mapedFileSizeCommitLog=1073741824
mapedFileSizeConsumeQueue=300000

 

配置命令行

[root@localhost conf]# vi /etc/profile

在末行增加

export ROCKETMQ_HOME=/app/rocketmq/rocketmq-all-4.7.1-bin-release
export PATH=$ROCKETMQ_HOME/bin:$PATH

export NAMESRV_ADDR=192.168.1.252:9876

配置生效

[root@localhost conf]# source /etc/profile

 

启动服务

cd /app/rocketmq/rocketmq-all-4.7.1-bin-release

nohup sh bin/mqnamesrv &
nohup sh bin/mqbroker -c conf/broker.conf &

 

启动查询基本命令

 

创建组group与主题topic

参数:

-n 指定 服务器

-t 指定主题

-g 指定组

本机情况下可不用-n

mqadmin updateTopic -c rocketmq-cluster -t TOPIC-SYS-BUSINESS-OPENAPI-ORDERLY  -n "192.168.3.252:9876;192.168.1.253:9876"
mqadmin updateTopic -c rocketmq-cluster -t TOPIC-SYS-BUSINESS-OPENAPI  -n "192.168.3.252:9876;192.168.1.253:9876"
mqadmin updateSubGroup  -c rocketmq-cluster -g GID-QUEUE-BUSINESS-OPENAPI  -n "192.168.3.252:9876;192.168.1.253:9876"

mqadmin updateTopic -c 集群名称固定(rocketmq-cluster) -t 名称 

mqadmin updateTopic -c rocketmq-cluster -t TOPIC-SYS-BUSINESS-OPENAPI-ORDERLY 
mqadmin updateTopic -c rocketmq-cluster -t TOPIC-SYS-BUSINESS-OPENAPI 
mqadmin updateSubGroup  -c rocketmq-cluster -g GID-QUEUE-BUSINESS-OPENAPI 

 

操作MQ消息队列相关信息

1、查看某个消费组的消息堆积情况, Diff 为消息堆积数, 为0说明没有消息堆积。

mqadmin consumerProgress -g GID-QUEUE-BUSINESS-OPENAPI 
mqadmin consumerProgress -g GID-LOG

2、查看某个topic的状态

mqadmin topicStatus -t TOPIC-SYS-BUSINESS-OPENAPI-ORDERLY 
mqadmin topicStatus -t TOPIC-SYS-MESSAGE

3、topic 列表

mqadmin  topicList 

4、集群列表

mqadmin clusterList

5、删除topic

mqadmin deleteTopic -t mq_demo_topic

6、删除group

mqadmin deleteSubGroup  -c rocketmq-cluster -g mq_demo_group

 

标签:bin,app,配置,mqadmin,192.168,cluster,rocketMq,安装,rocketmq
From: https://www.cnblogs.com/a393060727/p/16888490.html

相关文章

  • Ubuntu下MySQL安装和配置
    1安装sudoaptinstallmysql-server2设置密码2.1打开mysqlsudomysql//使用root账户不需要密码就可进入mysql2.2设置密码//切换到mysql这个数据库mysql>use......
  • logback-spring.xml日志配置
    遇到任何事情,可以放弃,但是永远要有面对的勇气引入对应pom依赖<dependency>    <groupId>org.springframework.boot</groupId>    <artifactId>spr......
  • 配置高+超级省,148元工业级Cortex-A55核心板不限量发售!
    全新高性价比工业级Cortex-A55核心板不限量发售,1G内存+8G存储仅148元。百套开发套件蓄势待发、邀您评测!“礼遇11月”活动已全面开启,参与评测即有机会获得开发板,更有华为智......
  • 由于R版本较旧导致Rstudio安装包出现Error的解决办法
    很久没有使用R了,由于工作需要,想在Rstudio里面安装ggplot2,ggpubr等R包,总是遇到很多ERROR问题,比如"non-zeroexitstatus",依赖包不会自动安装,"rbind(info,getNamespaceInfo(......
  • mac安装nginx
    本文通过brew安装nginx1、通过终端查看brew,如果没有可以参看(homeBrew的安装)brew--version2、安装nginxbrewinstallnginx报错如下:Error:Thefollo......
  • shell脚本测试配置寄存器数值·
    shell脚本测试同一寄存器下配置不同数值配置的测试##!/bin/shreg_value=0check_reg=`devmem0x10081000`while[$reg_value-lt252]do echo"CurrentTx_Reg_Valu......
  • .net core iis 部署时通用的web.config配置
    <?xmlversion="1.0"encoding="utf-8"?><configuration><locationpath="."inheritInChildApplications="false"><system.webServer><handlers><add......
  • 电脑配置
    电脑基本信息我的电脑 清华同方E500台式电脑操作系统 Windows7旗舰版ServicePack164位主显卡 独立显卡(对游戏和电影支持较好)IE浏览器 版本号8.0基本硬......
  • ubuntu安装 MySql5.7.bundle.tar
    1.查询是否有残留软件rpm-qa|grepmysqlrpm-qa|grepmariadb2.上传解压并安装root@kht:/kht#tar-xvfmysql-5.7.40-1.el7.x86_64.rpm-bundle.tarmysql-communi......
  • Linux 下的 Docker 安装与使用
    Linux下的Docker安装与使用一、安装与配置安装依赖包sudoyuminstall-yyum-utilsdevice-mapper-persistent-datalvm2设置阿里云镜像源sudoyum-config-mana......