1.安装JDK1.8
rpm -ivh jdk-8u202-linux-x64.rpm
java -version
#默认安装路径为:/usr/java/
2.下载mycat安装包
wget http://dl.mycat.io/1.6.7.1/Mycat-server-1.6.7.1-release-20190627191042-linux.tar.gz
3.解压安装包
mkdir /usr/local/myapps/
tar -xzvf Mycat-server-1.6.7.1-release-20190627191042-linux.tar.gz -C /usr/local/myapps/
4.创建mycat用户并赋权
useradd -M -s /sbin/nologin mycat
chown -R mycat:mycat /usr/local/myapps/mycat
5.在mycat中配置java路径
sed -i "/wrapper.java.command/cwrapper.java.command=/usr/java/latest/bin/java" /usr/local/myapps/mycat/conf/wrapper.conf
6.将mycat添加到系统服务目录
ln -s /usr/local/myapps/mycat/bin/mycat /etc/init.d/mycat
7.启动mycat
systemctl enable mycat && systemctl restart mycat && systemctl status mycat