Mycat启动报错排查

报错如下:
[root@localhost mycat]# mycat console
Running Mycat-server...
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    | 
jvm 1    | 
jvm 1    | WrapperSimpleApp: Encountered an error running main: java.lang.ExceptionInInitializerError
jvm 1    | java.lang.ExceptionInInitializerError
jvm 1    | 	at io.mycat.MycatStartup.main(MycatStartup.java:53)
jvm 1    | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1    | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
jvm 1    | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
jvm 1    | 	at java.lang.reflect.Method.invoke(Method.java:498)
jvm 1    | 	at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
jvm 1    | 	at java.lang.Thread.run(Thread.java:748)
jvm 1    | Caused by: io.mycat.config.util.ConfigException: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 82; Attribute "DataNode" must be declared for element type "schema".
jvm 1    | 	at io.mycat.config.loader.xml.XMLSchemaLoader.load(XMLSchemaLoader.java:121)
jvm 1    | 	at io.mycat.config.loader.xml.XMLSchemaLoader.<init>(XMLSchemaLoader.java:78)
jvm 1    | 	at io.mycat.config.loader.xml.XMLSchemaLoader.<init>(XMLSchemaLoader.java:82)
jvm 1    | 	at io.mycat.config.ConfigInitializer.<init>(ConfigInitializer.java:76)
jvm 1    | 	at io.mycat.config.MycatConfig.<init>(MycatConfig.java:72)
jvm 1    | 	at io.mycat.MycatServer.<init>(MycatServer.java:178)
jvm 1    | 	at io.mycat.MycatServer.<clinit>(MycatServer.java:121)
jvm 1    | 	... 7 more
jvm 1    | Caused by: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 82; Attribute "DataNode" must be declared for element type "schema".
jvm 1    | 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
jvm 1    | 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
jvm 1    | 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
jvm 1    | 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
jvm 1    | 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
jvm 1    | 	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(XMLDTDValidator.java:1253)
jvm 1    | 	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1917)
jvm 1    | 	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:742)
jvm 1    | 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359)
jvm 1    | 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
jvm 1    | 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
jvm 1    | 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
jvm 1    | 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
jvm 1    | 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
jvm 1    | 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
jvm 1    | 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
jvm 1    | 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
jvm 1    | 	at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
jvm 1    | 	at io.mycat.config.util.ConfigUtil.getDocument(ConfigUtil.java:115)
jvm 1    | 	at io.mycat.config.loader.xml.XMLSchemaLoader.load(XMLSchemaLoader.java:111)
jvm 1    | 	... 13 more
wrapper  | <-- Wrapper Stopped

配置如下:
vim schema.xml
在这里插入图片描述
vim server.xml:
在这里插入图片描述
报错原因:

Caused by: io.mycat.config.util.ConfigException: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 82; Attribute "DataNode" must be declared for element type "schema".

在这里插入图片描述
改成false之后:

在这里插入图片描述
dataNode:
在这里插入图片描述
然后第一个问题得到解决。接下来的问题如下:

Caused by: io.mycat.config.util.ConfigException: org.xml.sax.SAXParseException; lineNumber: 11; columnNumber: 5; The element type "readHost" must be terminated by the matching end-tag "</readHost>".

单标签,readHost,改成双标签。
在这里插入图片描述
改后:
在这里插入图片描述
再次启动:
在这里插入图片描述
搞定。

其他:在启动后实现读写分离的时候,只实现了写,读取数据还是默认走主库。
在这里插入图片描述
在这里插入图片描述

发布了128 篇原创文章 · 获赞 5 · 访问量 4028
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 数字20 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览