最近工作中突然让搞mycat,特意私下在家先搞一套练个手:
1、先下载一个CentOS7 mini版本就可以(本人机器性能有限);
2、使用VMware创建虚拟机,过程百度下一大堆,这里不做详细介绍。如果不喜欢虚拟机访问方式(我是很讨厌这种,很麻烦,复制粘贴都得安装插件,太麻烦,直接把虚拟机当成一台远程机器使用了);
3、CentOS7查看ip方法:ip addr,如果看不到独立的ip地址,需要修改vi /etc/sysconfig/network-scripts/ifcfg-ens33
重启:sudo service network restart
![](https://upload-images.jianshu.io/upload_images/14031575-90beb7e430c1c9f9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/375/format/webp)
修改onboot为yes即可
![](https://upload-images.jianshu.io/upload_images/14031575-4c4aa106a8ff3da6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/939/format/webp)
可以看到ip了;
4、修改yum内地源:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
刷新:yum makecache
更新:yum -y update
5、安装mysql:
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
sudo yum install mysql-server
service mysqld restart安装成功 重启服务
创建数据库和用户:
![](https://upload-images.jianshu.io/upload_images/14031575-872062475614a034.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/690/format/webp)
6、安装mycat
wget http://dl.mycat.io/1.6-RELEASE/Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz
![](https://upload-images.jianshu.io/upload_images/14031575-7f3b03a69d4f4150.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000/format/webp)
7、jdk安装
yum install java-1.8.0-openjdk.x86_64