Mycat
[root@localhost3 ~]# vi /etc/profile
[root@localhost3 ~]# vi /etc/hosts
[root@localhost3 ~]# cd /data/program/mycat/bin
[root@localhost3 bin]# ./mycat start
Starting Mycat-server...
[root@localhost3 bin]# ./mycat console
Running Mycat-server...
Mycat-server is already running.
[root@localhost2 ~]# mysql -u root -p123456 -P8066 -h192.168.10.116
重启:
service mysqld restart
注意版本:1.6.6;低版本不支持分表
连接mycat数据库使用端口8066
[root@localhost local]# tar -zxvf Mycat-server-1.6.6.1-release-20181031195535-linux.tar.gz [root@localhost mycat]# useradd mycat [root@localhost mycat]# chown -R mycat.mycat /usr/local/mycat [root@localhost mycat]# passwd mycat [root@localhost mycat]# vim /etc/my.cnf [root@localhost mycat]# vim /etc/profile [root@localhost mycat]# source /etc/profile [root@localhost mycat]# ./mycat start [root@localhost bin]# ./mycat console Running Mycat-server... Mycat-server is already running. [root@localhost bin]# ./mycat restart [root@localhost bin]# ./mycat status
<?xml version="1.0"?> <!DOCTYPE mycat:schema SYSTEM "schema.dtd"> <mycat:schema xmlns:mycat="http://io.mycat/"> <schema name="TESTDB" checkSQLschema="false" sqlMaxLimit="100"> <table name="back_config_params" primaryKey="id" type="global" dataNode="dn1" /> <table name="risk_orders" primaryKey="id" subTables="risk_orders_mg,risk_orders_mmd" dataNode="dn1" /> </schema> <dataNode name="dn1" dataHost="localhost1" database="szqb_wh" /> <dataHost name="localhost1" maxCon="1000" minCon="10" balance="0" writeType="0" dbType="mysql" dbDriver="native" switchType="1" slaveThreshold="100"> <heartbeat>select user()</heartbeat> <writeHost host="hostS1" url="10.31.1.182:3306" user="risk_user" password="risk_user" /> </dataHost> </mycat:schema>
浙公网安备 33010602011771号