Problem description: after startup mycat, log has been at the wrong,
INFO 1 | | JVM 2018/03/19 18:42:52 | 2018-03-19 18:42:52, 586 [INFO] [$_NIOREACTOR - 0 - RW] can 't get the connection for SQL: select the user () (IO) mycat) sqlengine. SQLJob: SQLJob. Java: 114)
INFO | jvm 1 | 2018/03/19 18:42:52 | 2018-03-19 18:42:52,586 [INFO ][$_NIOREACTOR-0-RW] close connection,reason:stream closed ,MySQLConnection [id=3436, lastTime=1521456172570, user=dbwrite, schema=test, old shema=test, borrowed=false, fromSlaveDB=true, threadId=0, charset=utf8, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=192.168.1.131, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false] (io.mycat.net.AbstractConnection:AbstractConnection.java:508)
With a command line login mycat, you can see the logic library, logical table:
Mysql> Show the databases;
+ -- -- -- -- -- -- -- -- -- -- +
| DATABASE |
+ -- -- -- -- -- -- -- -- -- -- +
| TESTDB |
+ -- -- -- -- -- -- -- -- -- -- +
Mysql> Explain the insert into tb1 values (1, 'GHF);
+ -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
SQL | | DATA_NODE |
+ -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| dn1 | insert into tb1 values (1, 'GHF) |
+ -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
But actual operation database:
Mysql> Insert into tb1 values (1, 'GHF);
ERROR 3009: (HY000) Java. Lang. IllegalArgumentException: Invalid DataSource: 0
With navicat even, insert data:
Environment: Linux 6.4
Host a: mycat + mysql main
Host 2: mysql from
Schema. The XML configuration:
Server.xml configuration:
For years, help to have a look at, stuck in this for a few days!
CodePudding user response:
Suggested that do not use this kind of middleware better standalone completely resistant to live hundreds of millions of pressureCan consider to use tidb late
CodePudding user response:
The building must be solved I also encountered this problem, for helpCodePudding user response:
Tried these days mycat separation, master-slave, speaking, reading and writing, master-slave synchronization, there will be a connection interruption, and the risk is not very low, and would have solved?