mycat2 配置 sqlserver2008 后启动不了
我其它配置都是使用默认的,都没有改,SQL语句也没有写,但就是启动不了,当把账号密码,数据库类型改为mysql时就一切正常,
root.user.json
{
"dialect":"sqlserver",
"ip":null,
"password":"root",
"transactionType":"xa",
"username":"sa"
}
数据源配置
{
"dbType":"sqlserver",
"idleTimeout":60000,
"initSqls":[],
"initSqlsGetConnection":true,
"instanceType":"READ_WRITE",
"maxCon":1000,
"maxConnectTimeout":3000,
"maxRetryCount":5,
"minCon":1,
"name":"prototypeDs",
"password":"root",
"type":"JDBC",
"url":"jdbc:sqlserver://localhost:1433;DatabaseName=hqxdCat01;user=sa;password=root",
"user":"sa",
"weight":0
}
启动不了
C:\mycat\bin>mycat start
wrapper | Starting the mycat2 service...
wrapper | Waiting to start...
wrapper | The mycat2 service was launched, but failed to start
日志报错.
2023-03-17 11:35:21,669[INFO]io.mycat.MycatCore.newMycatServer:209start VertxMycatServer
INFO | jvm 1 | 2023/03/17 11:35:22 | 2023-03-17 11:35:22,367[INFO]com.alibaba.druid.pool.DruidDataSource.init:990{dataSource-1} inited
INFO | jvm 1 | 2023/03/17 11:35:22 |
INFO | jvm 1 | 2023/03/17 11:35:22 | WrapperSimpleApp: Encountered an error running main: io.mycat.MycatException: ERROR-CODE: [MYCAT-3036][ERR_INIT_CONFIG] start FileMetadataStorageManager fail
INFO | jvm 1 | 2023/03/17 11:35:22 | io.mycat.MycatException: ERROR-CODE: [MYCAT-3036][ERR_INIT_CONFIG] start FileMetadataStorageManager fail
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.beans.mycat.MycatErrorCode.createMycatException(MycatErrorCode.java:156)
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.config.FileMetadataStorageManager.start(FileMetadataStorageManager.java:211)
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.config.FileMetadataStorageManager.start(FileMetadataStorageManager.java:204)
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.MycatCore.startServer(MycatCore.java:216)
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.MycatCore.main(MycatCore.java:235)
INFO | jvm 1 | 2023/03/17 11:35:22 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2023/03/17 11:35:22 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 1 | 2023/03/17 11:35:22 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 1 | 2023/03/17 11:35:22 | at java.lang.reflect.Method.invoke(Unknown Source)
INFO | jvm 1 | 2023/03/17 11:35:22 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
INFO | jvm 1 | 2023/03/17 11:35:22 | at java.lang.Thread.run(Unknown Source)
INFO | jvm 1 | 2023/03/17 11:35:22 | Caused by: io.mycat.MycatException: ERROR-CODE: [MYCAT-3002][ERR_FETCH_METADATA] MetadataManager init fail
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.beans.mycat.MycatErrorCode.createMycatException(MycatErrorCode.java:156)
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.MetadataManager.createMetadataManager(MetadataManager.java:131)
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.config.ConfigPrepareExecuter.fullInitBy(ConfigPrepareExecuter.java:217)
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.config.ConfigPrepareExecuter.prepareRuntimeObject(ConfigPrepareExecuter.java:135)
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.config.FileMetadataStorageManager.commitAndSyncDisk(FileMetadataStorageManager.java:271)
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.config.FileMetadataStorageManager$1.commit(FileMetadataStorageManager.java:250)
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.config.FileMetadataStorageManager.start(FileMetadataStorageManager.java:209)
INFO | jvm 1 | 2023/03/17 11:35:22 | ... 9 more
INFO | jvm 1 | 2023/03/17 11:35:22 | Caused by: io.mycat.MycatException: com.microsoft.sqlserver.jdbc.SQLServerException: 'VARIABLES' 附近有语法错误。
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.datasource.jdbc.datasource.DefaultConnection.executeQuery(DefaultConnection.java:93)
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.MetadataManager.<init>(MetadataManager.java:166)
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.MetadataManager.createMetadataManager(MetadataManager.java:124)
INFO | jvm 1 | 2023/03/17 11:35:22 | ... 14 more
INFO | jvm 1 | 2023/03/17 11:35:22 | Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 'VARIABLES' 附近有语法错误。
INFO | jvm 1 | 2023/03/17 11:35:22 | at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:196)
INFO | jvm 1 | 2023/03/17 11:35:22 | at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1454)
INFO | jvm 1 | 2023/03/17 11:35:22 | at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:786)
INFO | jvm 1 | 2023/03/17 11:35:22 | at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:685)
INFO | jvm 1 | 2023/03/17 11:35:22 | at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026)
INFO | jvm 1 | 2023/03/17 11:35:22 | at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1416)
INFO | jvm 1 | 2023/03/17 11:35:22 | at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:185)
INFO | jvm 1 | 2023/03/17 11:35:22 | at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:160)
INFO | jvm 1 | 2023/03/17 11:35:22 | at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:620)
INFO | jvm 1 | 2023/03/17 11:35:22 | at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:296)
INFO | jvm 1 | 2023/03/17 11:35:22 | at io.mycat.datasource.jdbc.datasource.DefaultConnection.executeQuery(DefaultConnection.java:84)
INFO | jvm 1 | 2023/03/17 11:35:22 | ... 16 more
INFO | jvm 1 | 2023/03/17 11:35:22 | 2023-03-17 11:35:22,663[INFO]io.mycat.replica.heartbeat.HeartbeatFlow.sendDataSourceStatus:66prototypeDs heartStatus DatasourceStatus(status=OK_STATUS, isSlaveBehindMaster=false, dbSynStatus=DB_SYN_NORMAL, master=true)
STATUS | wrapper | 2023/03/17 11:35:25 | <-- Wrapper Stopped
INFO | wrapper | 2023/03/17 11:35:25 | Waiting to start...
ERROR | wrapper | 2023/03/17 11:35:26 | The mycat2 service was launched, but failed to start.