RocketMQ 4.5.1 环境搭建
一、RocketMQ环境搭建
1.1 环境要求
| 软件名称 | 版本 | 下载地址 |
|---|---|---|
| JDK | 11.0.5 | 下载 提取码:6ksb |
| Linux64位系统 | (CentOS Linux release 7.1503) | 下载 提取码:8a9u |
| 安装Maven(使用源码安装rocketmq才需要) | 3.2.x | 下载 提取码:ymli |
| RocketMQ | 4.5.1 | 下载 提取码:vhye |
注意:
磁盘空间要求:4G+ free , 向磁盘进行持久化消息操作
1.2 安装及启动
1. 在线下载rocketmq(如果不想使用wget下载,可以直接使用上述提供的软件包)
# 下载
wget https://archive.apache.org/dist/rocketmq/4.5.1/rocketmq-all-4.5.1-bin-release.zip

2. 解压缩
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
unzip rocketmq-all-4.5.1-bin-release.zip -d /opt/



3. 配置环境变量

验证搭建结果

4. JDK搭建


5. 注意:修改脚本(使用jdk8没有问题,使用jdk8以上的版本需要修改脚本,否则虚拟机调优等相关的参数无法使用)
修改如下几个文件:
| 脚本名称 | 作用 |
|---|---|
| /opt/rocketmq/bin/runserver.sh | 保证正常使用nameserver |
| /opt/rocketmq/bin/runbroker.sh | 保证正常使用broker |
| /opt/rocketmq/bin/tools.sh | 保证正常使用系统的测试工具 |
步骤一:启动nameserver 出错

解决:修改nameserver启动脚本(vi /opt/rocketmq/bin/runserver.sh 修改配置文件)
#!/bin/sh
# 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.
#===========================================================================================
# Java Environment Setting
#===========================================================================================
error_exit ()
{
echo "ERROR: $1 !!"
exit

最低0.47元/天 解锁文章
570

被折叠的 条评论
为什么被折叠?



