阿里云主机安装RocketMQ 集群支持外网访问

这篇具有很好参考价值的文章主要介绍了阿里云主机安装RocketMQ 集群支持外网访问。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

背景:因公司迁移机房,需要在云主机上部署一套和本地一样的rocketMQ,原本计划直接购买云rocketMQ,云rocketMQ仅支持5.0.0,本地rocketMQ 是3.4.6,公司多个服务都使用本地的3.4.6版本的RocketMQ,所以需要再云上搭建一套简易版RocketMQ集群,并支持外网访问。

准备:两台开通外网的云主机,带宽100M,16G内存,500G硬盘,两台成本1000+

           设置主机名,安装jdk,配置免密等等,前期的准备工作。

           安装包:rocketmq-3.4.6.tar.gz

           下载地址:

因为是只有两台,所以规划是2m-noslave

vi /opt/servers/rocketmq-3.4.6/devenv/conf/2m-noslave/broker-a.properties

# 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=AdpMqCluster
brokerName=broker-a
#0 表示 Master, >0 表示 Slave
brokerId=0
namesrvAddr=hadoop001:9876;hadoop002:9876
#外网ip
brokerIP1=101.200.149.*
#内网ip
brokerIP2=172.17.128.14
deleteWhen=04
#在发送消息时,自动创建服务器不存在的topic,默认创建的队列数
defaultTopicQueueNums=4
#是否允许 Broker 自动创建Topic,建议线下开启,线上关闭
autoCreateTopicEnable=true
#是否允许 Broker 自动创建订阅组,建议线下开启,线上关闭
autoCreateSubscriptionGroup=true
#Broker 对外服务的监听端口
listenPort=10911
#删除文件时间点,默认凌晨 0点
deleteWhen=00
#文件保留时间,默认 48 小时
fileReservedTime=120
#commitLog每个文件的大小默认1G
mapedFileSizeCommitLog=1073741824
#ConsumeQueue每个文件默认存30W条,根据业务情况调整
mapedFileSizeConsumeQueue=50000000
destroyMapedFileIntervalForcibly=120000
redeleteHangedFileInterval=120000
#检测物理文件磁盘空间
diskMaxUsedSpaceRatio=88
#存储路径
storePathRootDir=/opt/servers/rocketmq/data
#commitLog 存储路径
storePathCommitLog=/opt/servers/rocketmq/data/commitlog
#消费队列存储路径存储路径
storePathConsumeQueue=/opt/servers/rocketmq/data/consumequeue
#消息索引存储路径
storePathIndex=/opt/servers/rocketmq/data/index
#checkpoint 文件存储路径
storeCheckpoint=/opt/servers/rocketmq/data/checkpoint
#abort 文件存储路径
abortFile=/opt/servers/rocketmq/data/abort
#限制的消息大小
#maxMessageSize=65536
maxMessageSize=5242880

#flushCommitLogLeastPages=4
#flushConsumeQueueLeastPages=2
#flushCommitLogThoroughInterval=10000
#flushConsumeQueueThoroughInterval=60000
#Broker 的角色
#- ASYNC_MASTER 异步复制Master
#- SYNC_MASTER 同步双写Master
#- SLAVE
brokerRole=ASYNC_MASTER
#刷盘方式
#- ASYNC_FLUSH 异步刷盘
#- SYNC_FLUSH 同步刷盘
flushDiskType=ASYNC_FLUSH
#checkTransactionMessageEnable=false
#发消息线程池数量
sendMessageThreadPoolNums=128
#拉消息线程池数量
pullMessageThreadPoolNums=128

vi /opt/servers/rocketmq-3.4.6/devenv/conf/2m-noslave/broker-b.properties

# 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=AdpMqCluster
brokerName=broker-b
#0 表示 Master, >0 表示 Slave
brokerId=0
namesrvAddr=hadoop001:9876;hadoop002:9876
#外网ip
brokerIP1=123.57.61.*
#内网ip
brokerIP2=172.17.128.15
deleteWhen=04
#在发送消息时,自动创建服务器不存在的topic,默认创建的队列数
defaultTopicQueueNums=4
#是否允许 Broker 自动创建Topic,建议线下开启,线上关闭
autoCreateTopicEnable=true
#是否允许 Broker 自动创建订阅组,建议线下开启,线上关闭
autoCreateSubscriptionGroup=true
#Broker 对外服务的监听端口
listenPort=10911
#删除文件时间点,默认凌晨 0点
deleteWhen=00
#文件保留时间,默认 48 小时
fileReservedTime=120
#commitLog每个文件的大小默认1G
mapedFileSizeCommitLog=1073741824
#ConsumeQueue每个文件默认存30W条,根据业务情况调整
mapedFileSizeConsumeQueue=50000000
destroyMapedFileIntervalForcibly=120000
redeleteHangedFileInterval=120000
#检测物理文件磁盘空间
diskMaxUsedSpaceRatio=88
#存储路径
storePathRootDir=/opt/servers/rocketmq/data
#commitLog 存储路径
storePathCommitLog=/opt/servers/rocketmq/data/commitlog
#消费队列存储路径存储路径
storePathConsumeQueue=/opt/servers/rocketmq/data/consumequeue
#消息索引存储路径
storePathIndex=/opt/servers/rocketmq/data/index
#checkpoint 文件存储路径
storeCheckpoint=/opt/servers/rocketmq/data/checkpoint
#abort 文件存储路径
abortFile=/opt/servers/rocketmq/data/abort
#限制的消息大小
#maxMessageSize=65536
maxMessageSize=5242880

#flushCommitLogLeastPages=4
#flushConsumeQueueLeastPages=2
#flushCommitLogThoroughInterval=10000
#flushConsumeQueueThoroughInterval=60000
#Broker 的角色
#- ASYNC_MASTER 异步复制Master
#- SYNC_MASTER 同步双写Master
#- SLAVE
brokerRole=ASYNC_MASTER
#刷盘方式
#- ASYNC_FLUSH 异步刷盘
#- SYNC_FLUSH 同步刷盘
flushDiskType=ASYNC_FLUSH
#checkTransactionMessageEnable=false
#发消息线程池数量
sendMessageThreadPoolNums=128
#拉消息线程池数量
pullMessageThreadPoolNums=128

同步目录 /opt/servers/rocketmq-3.4.6  到hadoop002;

在hadoop001上启动NamesrvStartup:

nohup sh runserver.sh com.alibaba.rocketmq.namesrv.NamesrvStartup &

在hadoop001上启动BrokerStartup:

nohup sh mqbroker autoCreateTopicEnable=true -c /opt/servers/rocketmq/devenv/conf/2m-noslave/broker-a.properties &

在hadoop002上启动NamesrvStartup:

nohup sh runserver.sh com.alibaba.rocketmq.namesrv.NamesrvStartup &

在hadoop002上启动BrokerStartup:

nohup sh mqbroker autoCreateTopicEnable=true -c /opt/servers/rocketmq/devenv/conf/2m-noslave/broker-b.properties &

在hadoop002上启动console:
vi  /opt/servers/rocketmq/rocketmq-externals-master/rocketmq-console/target/runconsole.sh
 

java -jar rocketmq-console-ng-1.0.0.jar --server.port=12581 --rocketmq.config.namesrvAddr=hadoop001:9876;hadoop002:9876

sh runconsole.sh

使用外网ip:12581 打开console界面

其他找运维人员设置相应的网络访问策略。

阿里消息队列rocketmq对外访问,大数据,消息中间件,阿里云,rocketmq,云计算

安装完成。文章来源地址https://www.toymoban.com/news/detail-812629.html

到了这里,关于阿里云主机安装RocketMQ 集群支持外网访问的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 如何将PC电脑变成web服务器:将内网主机映射到外网实现远程访问

    我是艾西,今天跟大家分享内容还是比较多人问的一个问题:如何将PC电脑变成web服务器。内网主机作为web服务器,内容包括本地内网映射、多层内网映射解决方案、绕过电信80端口封锁、DDNS功能的实现(非花生壳)、网站加速等。这也是很多人想知道怎么弄怎么设置的方法

    2024年02月11日
    浏览(32)
  • 阿里云ECS实现内网服务器访问外网

    由于业务需要,需要多台云服务器,但是公有云的带宽价格不菲,所以不可能给所有的云服务器都配上公网IP,一方面是成本的问题,另一方面也是公网安全的问题。 所以通过其它的方式使用无公网的云服务器来来实现对外资源的访问。 至少需要有一台具有公网IP的云服务器

    2024年02月05日
    浏览(44)
  • Cisco Packet Tracer 思科模拟器利用NAT实现外网主机访问内网服务器

    前两篇讲解了动态NAT地址转换,以及静态NAT地址转换,本篇文章主要讲解如何理由NAT实现外网主机访问内网服务器,含有重分布教学 情境分析 公司只申请了一个公网IP地址,基于私有地址与公有地址不能直接通信的原则,公网的计算机是不能直接访问内网服务器,要实现内网

    2024年02月07日
    浏览(55)
  • java实现阿里云rocketMQ消息的发送与消费(tcp协议sdk)

    登录阿里云官网,先申请rocketMQ,再申请Topic、Group ID,然后就是参考阿里云的JAVA SDK进行编程实现。 环境要求: 安装JDK 1.8或以上版本 安装Maven 安装Java SDK 参照 阿里云 官方文档,来一步一步操作。 文档提供的SDK有 TCP 和Http协议,这里使用 TCP协议 来实现rocketMQ消息的发送与消

    2024年02月07日
    浏览(34)
  • 从0到1阿里云部署mysql8数据库(外网可访问)(图文并茂超详细)

    目录 一,下载MYSQL安装和配置  二,外网连接阿里云数据库 1.切换到 /app/soft/ 2.创建mysql文件夹 3.切换到mysql文件夹下 4,下载mysql8.0安装包,等待下载成功 5,解压mysql8.0安装包  6,重命名解压出来的文件夹,这里改成mysql-8.0  7,mysql-8.0文件夹下创建data文件夹 存储文件 8,分别

    2024年02月02日
    浏览(38)
  • K8S Helm安装RocketMQ standalone单机版,配置外网地址注册到nameserver中方便本地开发

    rocketmq 3.0.2 · sir5kong/rocketmq helm repo add rocketmq https://helm-charts.itboon.top/rocketmq helm pull rocketmq/rocketmq tar -xvf rocketmq-3.0.2.tgz 修改这个无效 /root/rocketmq/rocketmq/templates/broker/configmap.yaml 文件头有注释 {{/* 3.0 废弃 */}} 修改外网配置namesrvAddr、brokerIP1、listenPort vi /root/rocketmq/rocketmq/template

    2024年02月03日
    浏览(45)
  • Oracle VM virtual Box 安装虚拟机并网络连接宿主机且能ping通外网

    Oracle VM virtual Box新建虚拟机,按照下图所示新建虚拟机: 1.新建虚拟机 2.配置虚拟机相关信息,如系统名称,存储位置,系统类型,内存大小等 3.配置虚拟机磁盘大小,点击创建,创建虚拟机成功 4.虚拟机初始化设置 5.启动虚拟机,并且设置相关的信息 设置登录root登录密码

    2024年04月28日
    浏览(40)
  • 三.RocketMQ单机安装及集群搭建

    1.软硬件要求 Linux64位系统 JDK1.8(64位) 源码安装需要安装Maven 3.2.x 2.下载RocketMQ 下载:rocketMQ下载 1.上传并解压 解压命令:unzip rocketmq-all-4.5.1-bin-release.zip 2.目录介绍 benchmark:一些demo bin:启动脚本,包括shell脚本和CMD脚本 conf:实例配置文件 ,包括broker配置文件、logback配置文件

    2024年02月06日
    浏览(34)
  • 阿里云轻量服务器--Docker--RocketMq安装

    前言:本文介绍使用docker 部署-RocketMq; 1 RocketMq 介绍: Apache RocketMQ是一款开源的分布式消息中间件,具有高吞吐量、高可用性、高伸缩性和灵活的可靠消息传输机制等特点。RocketMQ支持多种消息模式,包括异步传输、同步传输和单向传输,并支持多种订阅模式,包括广播模式

    2024年02月06日
    浏览(70)
  • Linux系统下消息中间件RocketMQ下载、安装、搭建、配置、控制台rocketmq-dashboard的安装保姆级教程 rocketmq ui

    这里给出我使用的 RocketMQ 版本(5.1.3)、RocketMQ-Dashboard 版本的百度网盘链接: 链接:https://pan.baidu.com/s/1HaKBBDGWZ0WKLGgVwIG9pw 提取码:1234 1、注意:有两种资源下载:Source表示源码、Binary是二进制包(我们下载这个):二进制包是已经编译完成后可以直接运行的,源码包是需要

    2024年02月12日
    浏览(43)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包