Open zhaozw1984 opened 3 years ago
jvm启动参数添加-Dmode=cluster看看
我在 wrapper.conf里这样加,启动失败了。是不是加错地方了?
wrapper.java.additional.10=-Dmode=cluster
INFO | jvm 1 | 2021/04/26 15:28:13 | [WrapperSimpleAppMain] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true INFO | jvm 1 | 2021/04/26 15:28:13 | [WrapperSimpleAppMain] DEBUG io.netty.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable INFO | jvm 1 | 2021/04/26 15:28:13 | java.lang.IllegalAccessException: class io.netty.util.internal.PlatformDependent0$6 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @7a765367
INFO | jvm 1 | 2021/04/26 15:31:57 | WrapperSimpleApp: Encountered an error running main: java.util.concurrent.ExecutionException: java.net.UnknownHostException: 127.0.0.1
INFO | jvm 1 | 2021/04/26 15:31:57 | java.util.concurrent.ExecutionException: java.net.UnknownHostException: 127.0.0.1
INFO | jvm 1 | 2021/04/26 15:31:57 | at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
INFO | jvm 1 | 2021/04/26 15:31:57 | at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2092)
INFO | jvm 1 | 2021/04/26 15:31:57 | at io.mycat.MycatCore.testZkAddressOrStartDefaultZk(MycatCore.java:178)
INFO | jvm 1 | 2021/04/26 15:31:57 | at io.mycat.MycatCore.
hosts文件添加
127.0.0.1 localhost
有的
mycat-web 连接zookeeper 都能成功 就是mycat2.0不行。
连上了
配置数据不能自动同步到zk吗?
只有zk没有数据的时候,mycat启动时候才会把数据导进去zk,一旦zk有了数据,mycat就不会把数据同步到zk,而是zk的配置同步到mycat
zk是没有数据,我清空了。数据也同步了,但只有schemas级别的,schemas下详细配置没有同步。mycat启动后又挂了我看看日志。
另外还有个问题,不启用zookeeper,mycat2启动后,连接8066端口,一切正常。启用zookeeper后,出现上面说的数据同步问题,虽然mycat2启动了,但是用客户端连接mycat8066端口,连不上,连几次后mycat服务退出了。报错是无法创建数据库连接。
贴一下日志
INFO | jvm 1 | 2021/04/27 09:23:10 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms
INFO | jvm 1 | 2021/04/27 09:23:24 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms
INFO | jvm 1 | 2021/04/27 09:23:37 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms
INFO | jvm 1 | 2021/04/27 09:23:50 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms
INFO | jvm 1 | 2021/04/27 09:24:04 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms
INFO | jvm 1 | 2021/04/27 09:24:17 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms
INFO | jvm 1 | 2021/04/27 09:24:30 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 3ms
INFO | jvm 1 | 2021/04/27 09:24:44 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms
INFO | jvm 1 | 2021/04/27 09:24:55 | [WrapperSimpleAppMain] DEBUG io.mycat.datasource.jdbc.datasource.JdbcConnectionManager -
INFO | jvm 1 | 2021/04/27 09:24:55 | com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 60012, active 0, maxActive 1000, creating 1, createElapseMillis 367, createErrorCount 27
INFO | jvm 1 | 2021/04/27 09:24:55 | at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1743)
INFO | jvm 1 | 2021/04/27 09:24:55 | at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:1415)
INFO | jvm 1 | 2021/04/27 09:24:55 | at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1395)
INFO | jvm 1 | 2021/04/27 09:24:55 | at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1385)
INFO | jvm 1 | 2021/04/27 09:24:55 | at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:100)
INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.datasource.jdbc.datasource.JdbcConnectionManager.getConnection(JdbcConnectionManager.java:134)
INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.datasource.jdbc.datasource.JdbcConnectionManager.getConnection(JdbcConnectionManager.java:118)
INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.MetadataManager.
因为zk的配置为空或者有错误导致启动不了.我先实现一个配置导入工具看看能不绕过这个问题
先把zk的配置完全删除再看看
我每次测试都是先清空zk里的数据的
我另外搭一个环境,用mysql 8.0.23、mycat-server 1.6.7.6。 mycat配置里有一项
如果配置0,启动失败:
INFO | jvm 1 | 2021/04/27 13:25:23 | Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class is
com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
INFO | jvm 1 | 2021/04/27 13:25:24 |
INFO | jvm 1 | 2021/04/27 13:25:24 | WrapperSimpleApp: Encountered an error running main: java.lang.IllegalAccessError: class io.mycat.buffer.ByteBufferPage (in unnamed module @0x46fbb2c1) cannot access class sun.nio.ch.DirectBuffer (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x46fbb2c1
INFO | jvm 1 | 2021/04/27 13:25:24 | java.lang.IllegalAccessError: class io.mycat.buffer.ByteBufferPage (in unnamed module @0x46fbb2c1) cannot access class sun.nio.ch.DirectBuffer (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x46fbb2c1
INFO | jvm 1 | 2021/04/27 13:25:24 | at io.mycat.buffer.ByteBufferPage.
如果改为
processorBufferPoolType = 0 启动失败 processorBufferPoolType = 1 启动正常,连接失败
连接器 已经换成了 mysql-connector-java-8.0.23.jar
INFO | jvm 1 | 2021/04/27 09:23:10 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms INFO | jvm 1 | 2021/04/27 09:23:24 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms INFO | jvm 1 | 2021/04/27 09:23:37 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms INFO | jvm 1 | 2021/04/27 09:23:50 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms INFO | jvm 1 | 2021/04/27 09:24:04 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms INFO | jvm 1 | 2021/04/27 09:24:17 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms INFO | jvm 1 | 2021/04/27 09:24:30 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 3ms INFO | jvm 1 | 2021/04/27 09:24:44 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms INFO | jvm 1 | 2021/04/27 09:24:55 | [WrapperSimpleAppMain] DEBUG io.mycat.datasource.jdbc.datasource.JdbcConnectionManager - INFO | jvm 1 | 2021/04/27 09:24:55 | com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 60012, active 0, maxActive 1000, creating 1, createElapseMillis 367, createErrorCount 27 INFO | jvm 1 | 2021/04/27 09:24:55 | at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1743) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:1415) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1395) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1385) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:100) INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.datasource.jdbc.datasource.JdbcConnectionManager.getConnection(JdbcConnectionManager.java:134) INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.datasource.jdbc.datasource.JdbcConnectionManager.getConnection(JdbcConnectionManager.java:118) INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.MetadataManager.(MetadataManager.java:167) INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.MetadataManager.createMetadataManager(MetadataManager.java:126) INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.config.ConfigPrepareExecuter.fullInitBy(ConfigPrepareExecuter.java:209) INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.config.ConfigPrepareExecuter.prepareRuntimeObject(ConfigPrepareExecuter.java:133) INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.config.FileMetadataStorageManager.commitAndSyncDisk(FileMetadataStorageManager.java:271) INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.config.CoordinatorMetadataStorageManager$1.commit(CoordinatorMetadataStorageManager.java:174) INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.config.CoordinatorMetadataStorageManager.start(CoordinatorMetadataStorageManager.java:45) INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.MycatCore.start(MycatCore.java:225) INFO | jvm 1 | 2021/04/27 09:24:55 | at io.mycat.MycatCore.main(MycatCore.java:238) INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/java.lang.reflect.Method.invoke(Method.java:567) INFO | jvm 1 | 2021/04/27 09:24:55 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/java.lang.Thread.run(Thread.java:831) INFO | jvm 1 | 2021/04/27 09:24:55 | Caused by: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:906) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:831) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:456) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1652) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1718) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2792) INFO | jvm 1 | 2021/04/27 09:24:55 | Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure INFO | jvm 1 | 2021/04/27 09:24:55 | INFO | jvm 1 | 2021/04/27 09:24:55 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. INFO | jvm 1 | 2021/04/27 09:24:55 | at jdk.internal.reflect.GeneratedConstructorAccessor12.newInstance(Unknown Source) INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.NativeSession.connect(NativeSession.java:144) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:850) INFO | jvm 1 | 2021/04/27 09:24:55 | ... 7 more INFO | jvm 1 | 2021/04/27 09:24:55 | Caused by: java.net.ConnectException: Connection refused: connect INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/sun.nio.ch.Net.connect0(Native Method) INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/sun.nio.ch.Net.connect(Net.java:576) INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/sun.nio.ch.Net.connect(Net.java:565) INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588) INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:333) INFO | jvm 1 | 2021/04/27 09:24:55 | at java.base/java.net.Socket.connect(Socket.java:645) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155) INFO | jvm 1 | 2021/04/27 09:24:55 | at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63) INFO | jvm 1 | 2021/04/27 09:24:55 | ... 9 more INFO | jvm 1 | 2021/04/27 09:24:56 | INFO | jvm 1 | 2021/04/27 09:24:56 | WrapperSimpleApp: Encountered an error running main: io.mycat.MycatException: ERROR-CODE: [MYCAT-3002][ERR_FETCH_METADATA] MetadataManager init fail INFO | jvm 1 | 2021/04/27 09:24:56 | io.mycat.MycatException: ERROR-CODE: [MYCAT-3002][ERR_FETCH_METADATA] MetadataManager init fail INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.beans.mycat.MycatErrorCode.createMycatException(MycatErrorCode.java:156) INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.MetadataManager.createMetadataManager(MetadataManager.java:133) INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.config.ConfigPrepareExecuter.fullInitBy(ConfigPrepareExecuter.java:209) INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.config.ConfigPrepareExecuter.prepareRuntimeObject(ConfigPrepareExecuter.java:133) INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.config.FileMetadataStorageManager.commitAndSyncDisk(FileMetadataStorageManager.java:271) INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.config.CoordinatorMetadataStorageManager$1.commit(CoordinatorMetadataStorageManager.java:174) INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.config.CoordinatorMetadataStorageManager.start(CoordinatorMetadataStorageManager.java:45) INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.MycatCore.start(MycatCore.java:225) INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.MycatCore.main(MycatCore.java:238) INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/java.lang.reflect.Method.invoke(Method.java:567) INFO | jvm 1 | 2021/04/27 09:24:56 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/java.lang.Thread.run(Thread.java:831) INFO | jvm 1 | 2021/04/27 09:24:56 | Caused by: io.mycat.MycatException: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 60012, active 0, maxActive 1000, creating 1, createElapseMillis 367, createErrorCount 27 INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.datasource.jdbc.datasource.JdbcConnectionManager.getConnection(JdbcConnectionManager.java:153) INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.datasource.jdbc.datasource.JdbcConnectionManager.getConnection(JdbcConnectionManager.java:118) INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.MetadataManager.(MetadataManager.java:167) INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.MetadataManager.createMetadataManager(MetadataManager.java:126) INFO | jvm 1 | 2021/04/27 09:24:56 | ... 13 more INFO | jvm 1 | 2021/04/27 09:24:56 | Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 60012, active 0, maxActive 1000, creating 1, createElapseMillis 367, createErrorCount 27 INFO | jvm 1 | 2021/04/27 09:24:56 | at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1743) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:1415) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1395) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1385) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:100) INFO | jvm 1 | 2021/04/27 09:24:56 | at io.mycat.datasource.jdbc.datasource.JdbcConnectionManager.getConnection(JdbcConnectionManager.java:134) INFO | jvm 1 | 2021/04/27 09:24:56 | ... 16 more INFO | jvm 1 | 2021/04/27 09:24:56 | Caused by: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:906) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:831) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:456) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1652) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1718) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2792) INFO | jvm 1 | 2021/04/27 09:24:56 | Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure INFO | jvm 1 | 2021/04/27 09:24:56 | INFO | jvm 1 | 2021/04/27 09:24:56 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. INFO | jvm 1 | 2021/04/27 09:24:56 | at jdk.internal.reflect.GeneratedConstructorAccessor12.newInstance(Unknown Source) INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.NativeSession.connect(NativeSession.java:144) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:850) INFO | jvm 1 | 2021/04/27 09:24:56 | ... 7 more INFO | jvm 1 | 2021/04/27 09:24:56 | Caused by: java.net.ConnectException: Connection refused: connect INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/sun.nio.ch.Net.connect0(Native Method) INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/sun.nio.ch.Net.connect(Net.java:576) INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/sun.nio.ch.Net.connect(Net.java:565) INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588) INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:333) INFO | jvm 1 | 2021/04/27 09:24:56 | at java.base/java.net.Socket.connect(Socket.java:645) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155) INFO | jvm 1 | 2021/04/27 09:24:56 | at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63) INFO | jvm 1 | 2021/04/27 09:24:56 | ... 9 more INFO | jvm 1 | 2021/04/27 09:24:57 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x17910eb607b0000 after 1ms INFO | jvm 1 | 2021/04/27 09:24:57 | [Thread-3] DEBUG org.apache.curator.framework.imps.CuratorFrameworkImpl - Closing INFO | jvm 1 | 2021/04/27 09:24:57 | [Curator-Framework-0] INFO org.apache.curator.framework.imps.CuratorFrameworkImpl - backgroundOperationsLoop exiting INFO | jvm 1 | 2021/04/27 09:24:57 | [Thread-3] DEBUG org.apache.curator.CuratorZookeeperClient - Closing INFO | jvm 1 | 2021/04/27 09:24:57 | [Thread-3] DEBUG org.apache.curator.ConnectionState - Closing INFO | jvm 1 | 2021/04/27 09:24:57 | [Thread-3] DEBUG org.apache.zookeeper.ZooKeeper - Closing session: 0x17910eb607b0000 INFO | jvm 1 | 2021/04/27 09:24:57 | [Thread-3] DEBUG org.apache.zookeeper.ClientCnxn - Closing client for session: 0x17910eb607b0000 INFO | jvm 1 | 2021/04/27 09:24:57 | [WrapperSimpleAppMain-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x17910eb607b0000, packet:: clientPath:null serverPath:null finished:false header:: 41,-11 replyHeader:: 41,9,0 request:: null response:: null INFO | jvm 1 | 2021/04/27 09:24:57 | [Thread-3] DEBUG org.apache.zookeeper.ClientCnxn - Disconnecting client for session: 0x17910eb607b0000 INFO | jvm 1 | 2021/04/27 09:24:57 | [Thread-3] INFO org.apache.zookeeper.ZooKeeper - Session: 0x17910eb607b0000 closed INFO | jvm 1 | 2021/04/27 09:24:57 | [WrapperSimpleAppMain-EventThread] INFO org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0x17910eb607b0000 STATUS | wrapper | 2021/04/27 09:24:58 | <-- Wrapper Stopped
这个问题解决了吗
没有
好吧
当我把zookeeper服务关了为什么他还会继续去连接
检查不到zk会启动一个内置的zk
我按照配置文件配置后MySQL进行mycat连接时 出现这种问题
1.6只能用JDK8
@XPPXX 设置忽略密码或者用sqlyog或者5.7的客户端
@0x46fbb2c1) cannot access class sun.nio.ch.DirectBuffer (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x46fbb2c1
好
@0x46fbb2c1) cannot access class sun.nio.ch.DirectBuffer (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x46fbb2c1
2/1.6只能用JDK8
好的
mycat2在server.json里配置zookeeper,如下: "mode":"cluster", "properties":{"zk_address":"127.0.0.1:2181"}
zookeeper服务一切正常,用ZooInspector都可以正常连接。 为什么mycat2并没有连接成功?也无任何连接zookeeper异常日志。
另外mycat-web能支持mycat2.0吗?