标签:system key dal 数据库配置 maria har running end shard
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mycat:schema SYSTEM "schema.dtd"> <mycat:schema xmlns:mycat="http://io.mycat/"> <schema name="TESTDB" checkSQLschema="true" sqlMaxLimit="100" dataNode="dn1"> <table name="t_user" dataNode="dn1,dn2" rule="auto-sharding-long"/> <table name="ht_jy_login_log" primaryKey="ID" dataNode="dn1,dn2" rule="auto-sharding-long"/> </schema> <dataNode name="dn1" dataHost="localhost1" database="mycat_node1"/> <dataNode name="dn2" dataHost="localhost1" database="mycat_node2"/> <dataHost name="localhost1" writeType="0" switchType="1" slaveThreshold="100" balance="1" dbType="mysql" maxCon="10" minCon="1" dbDriver="native"> <heartbeat>show status like ‘wsrep%‘</heartbeat> <writeHost host="hostM1" url="127.0.0.1:3306" user="root" password="root" > </writeHost> </dataHost> </mycat:schema >
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE mycat:server SYSTEM "server.dtd"> <mycat:server xmlns:mycat="http://io.mycat/"> <user name="mycat"> <property name="password">mycat</property> <property name="schemas">TESTDB</property> </user> </mycat:server>
[root@localhost conf]# mycat start Starting Mycat-server... [root@localhost conf]# mycat status Mycat-server is running (33384).
[root@localhost logs]# mysql -h 127.0.0.1 -umycat -pmycat -P8066 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.29-mycat-1.6.7.3-release-20190927161129 MyCat Server (OpenCloudDB) Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement. MySQL [(none)]> select * from help; ERROR 3000 (HY000): No MyCAT Database selected MySQL [(none)]> show databases; +----------+ | DATABASE | +----------+ | TESTDB | +----------+ 1 row in set (0.03 sec) MySQL [(none)]> use TESTDB Database changed MySQL [TESTDB]> select * from help; ERROR 1184 (HY000): Invalid DataSource:0
标签:system key dal 数据库配置 maria har running end shard
原文地址:https://www.cnblogs.com/plluoye/p/11716585.html