Skip to content

Latest commit

 

History

History
211 lines (148 loc) · 3.37 KB

centos7常用安装.md

File metadata and controls

211 lines (148 loc) · 3.37 KB

一、centos7软件安装

1.1.jdk1.8安装

下载安装包

解压

tar -zxvf jdk-8u212-linux-x64.tar.gz 

配置环境变量

vim /etc/profile
# jdk配置
JAVA_HOME=/opt/soft/jdk/jdk1.8.0_212
JRE_HOME=/opt/soft/jdk/jdk1.8.0_212/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH

配置生效

source /etc/profile

安装成功

java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

1.2.RocketMQ 4.3.2安装

下载安装包

 wget http://mirror.bit.edu.cn/apache/rocketmq/4.3.2/rocketmq-all-4.3.2-bin-release.zip
unzip rocketmq-all-4.3.2-bin-release.zip
mv rocketmq-all-4.3.2-bin-release rocketmq

增加环境配置

# rocketMq配置
ROCKETMQ_HOME=/opt/soft/rocketmq
PATH=$ROCKETMQ_HOME/bin:$PATH
export ROCKETMQ_HOME PATH
source /etc/profile

修改mq启动的内存

root@localhost bin]# vim runbroker.sh 
JAVA_OPT="${JAVA_OPT} -server -Xms4g -Xmx4g -Xmn2g"

启动NameServer

sh mqnamesrv  -n 172.25.8.178:9876 &

修改broker.conf

# 集群名字
brokerClusterName = mj

# 注册中心的IP地址
namesvAddr=172.25.8.178:9876

# 节点的地址
brokerIP1=127.0.0.1
# 节点名字
brokerName = mj-broker-master

# brokerId = 0 表示此broker是master 
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
autoCreateTopicEnable = true

启动Broker

sh mqbroker -c ../conf/broker.conf

docker安装RocketMQ控制台

docker pull styletang/rocketmq-console-ng
docker run -e "JAVA_OPTS=-Drocketmq.namesrv.addr=172.25.8.178:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8083:8080 -t styletang/rocketmq-console-ng
http://172.25.8.178:8083/#/

说明:172.25.8.178是我虚拟机的IP地址

1.3.docker安装

安装GCC

 yum -y install gcc
yum -y install gcc-c++

安装软件包

yum install -y yum-utils device-mapper-persistent-data lvm2

设置stable镜像仓库

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

更新软件包

yum makecache fast

安装docker社区版本

yum -y install docker-ce

启动docker

systemctl start docker

1.4.Maven安装

下载安装包

apache-maven-3.6.0-bin.tar.gz

解压

[root@localhost apache-maven-3.6.0]# tar -zxvf apache-maven-3.6.0-bin.tar.gz

配置环境变量

vim /etc/profile
# maven配置
M2_HOME=/opt/soft/apache-maven-3.6.0
PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
export M2_HOME PATH

配置生效

source /etc/profile