mycat配置
总配置环境变量 位置vi /etc/profile
export JAVA_HOME=/usr/local/jdk/jdk1.8.0_161
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export MYCAT_HOME=/usr/local/mycat/mycat
export ZOOKEEPER_HOME=/usr/local/mycat/zookeeper-3.4.10
下载文件
http://dl.mycat.io/
修改配置文件schema.xml
<?xml version="1.0"?>
<!DOCTYPE mycat:schema SYSTEM "schema.dtd">
<mycat:schema xmlns:mycat="http://io.mycat/">
<schema name="TESTDB" checkSQLschema="false" sqlMaxLimit="100" dataNode="dn1"></schema>
<dataNode name="dn1" dataHost="localhost1" database="db1" />
<dataHost name="localhost1" maxCon="1000" minCon="10" balance="2"
writeType="0" dbType="mysql" dbDriver="native" switchType="1" slaveThreshold="100">
<heartbeat>select user()</heartbeat>
<!-- can have multi write hosts -->
<writeHost host="192.168.232.164" url="192.168.232.164:3306" user="root"
password="#20as3SElksds0ew98">
<!-- can have multi read hosts -->
<readHost host="192.168.232.165" url="192.168.232.165:3306" user="root" password="#20as3SElksds0ew98" />
</writeHost>
<writeHost host="192.168.232.165" url="192.168.232.165:3306" user="root"
password="#20as3SElksds0ew98" />
</dataHost>
</mycat:schema>
启动
mycat start 启动
mycat restart 重启
mycat stop 关闭
配置配置文件zookice
mycat-web下载
https://github.com/MyCATApache/Mycat-download/tree/master/mycat-web-1.0
启动./start.sh &
查看是否启动:netstat -ant | grep 8082