mycat读写分离配置

Linux下安装mycat

1下载mycat

2解压mycat

   tar –zxvf 解压包名 

3mycat 移动

mv mycat /usr/local

4配置环境变量

命令终端:gedit~/.bashrc

添加

export MYCAT_HOME=/usr/local/ mycat

export JAVA_HOME=/usr/lib/jvm /java-8-oracle
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH

配置生效:source~/.bashrc

5 配置schema.xml

selectuser()

 

 

 

6 配置server.xml

        

         0  

        

                   2

                   0

                   0

                   1

                   1m

                   1k

                   0

                   384m

        

        

                   suroot

                   mycat            

        

7 开启mycat

/usr/local/mycat/bin/mycat start

8 连接mycat

mysql -uroot -psuroot -h127.0.0.1 -P8066–DTESTDB

 

你可能感兴趣的:(mycat读写分离配置)