You need to install two servers need to be installed on each server mysql and jdk, jdk is 1.8 or above and can be, mysql 5.5 or more, to avoid a lot of unnecessary questions
-
linux system installation:
安装系统:https://blog.csdn.net/qq_15006743/article/details/90782875 网络配置:https://blog.csdn.net/qq_15006743/article/details/91039399
-
mysql5.7.28 installation:
https://blog.csdn.net/qq_15006743/article/details/91387298
-
mycat installation and testing:
安装之前,我已经搭建了192.168.0.135和192.168.0.153这两台服务器,且都安装了mysql,这个mycat我是在192.168.0.135服务器上安装的 1、下载安装包: 链接:https://pan.baidu.com/s/13jk5WWTFm8SioBxk88GBtA 提取码:072h 2、解压到/usr/local目录下面 通过xftp将安装包移动到/opt目录下面 在/opt目录下面解压到/usr/local下:unzip mycat-linux.zip -d /usr/local 3、配置服务器和分片表 为什么要配置分片和服务器? https://blog.csdn.net/qq_15006743/article/details/104093195 修改schema.xml,修改如下,各个参数含义都已经写明:
Wherein the segmentation rules are: mod-long, this operation is defined in the /usr/local/mycat/conf/rule.xml:
somehow database, table, fragmentation rules, then you need to set the port number of the link to the database, the user name and password, modify /usr/local/mycat/con/server.xml file
4、启动,并且测试是否成功
/usr/local/mycat/bin/mycat console start &------->这个表示后台运行,并且打印出日志(这样可以看启动不成功是因为什么)
启动成功后,通过mysql -uroot -proot -P3310 -h192.168.0.135测试,看能不能进去mysql服务,成功如下:
5、开放3310端口,并且用navicat测试是否能够连接
vi /etc/sysconfig/iptables
复制22端口的开放方式,将22改成3310即可,然后保存退出:wq!
service iptables restart
然后用Navicat连接