需要有JDK环境
jdk下载oracle官网或者其他,官网有时需要登录,可以使用华为的镜像,或者清华镜像站openjdk,随便选一个镜像,下载后配置
wget https://repo.huaweicloud.com/java/jdk/8u171-b11/jdk-8u171-
tar -zxvf jdk-8u171-linux-x64.tar.gz
vim /etc/profile
#configuue the java home
export JAVA_HOME=/home/zs/jdk/jdk1.8.0_171
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
source /etc/profile
java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
下载解压rocketmq
可以下载源码编译或直接下载编译好的发行版,如下是下载官网链接
wget https://mirror.bit.edu.cn/apache/rocketmq/4.7.0/rocketmq-all-4.7.0-bin-release.zip
unzip rocketmq-all-4.7.0-bin-release.zip
rocketmq的文件目录
进入bin目录修改 和namserver 和broker文件中默认的的内存大小
启动namerserve和broker
[root@localhost bin]# vim runserver.sh
[root@localhost bin]# nohup sh mqnamesrv &
[1] 3145
nohup: ignoring input and appending output to 'nohup.out'
[root@localhost bin]# jps
3172 Jps
3158 NamesrvStartup
[root@localhost bin]# vim runbroker.sh
[root@localhost bin]# ./mqbroker -n localhost:9876 &
[2] 3254
[root@localhost bin]# jps
3298 Jps
3268 BrokerStartup
3158 NamesrvStartup
[root@localhost bin]# The broker[localhost.localdomain, 192.168.0.111:10911] boot success. serializeType=JSON and name server is localhost:9876