報(bào)錯(cuò)信息
--> Wrapper Started as Daemon
STATUS | wrapper | 2019/10/21 16:08:40 | Launching a JVM...
ERROR | wrapper | 2019/10/21 16:08:40 | Unable to start JVM: No such file or directory (2)
ERROR | wrapper | 2019/10/21 16:08:40 | JVM exited while loading the application.
STATUS | wrapper | 2019/10/21 16:08:44 | Launching a JVM...
ERROR | wrapper | 2019/10/21 16:08:44 | Unable to start JVM: No such file or directory (2)
ERROR | wrapper | 2019/10/21 16:08:44 | JVM exited while loading the application.
STATUS | wrapper | 2019/10/21 16:08:48 | Launching a JVM...
ERROR | wrapper | 2019/10/21 16:08:48 | Unable to start JVM: No such file or directory (2)
ERROR | wrapper | 2019/10/21 16:08:48 | JVM exited while loading the application.
STATUS | wrapper | 2019/10/21 16:08:52 | Launching a JVM...
ERROR | wrapper | 2019/10/21 16:08:52 | Unable to start JVM: No such file or directory (2)
ERROR | wrapper | 2019/10/21 16:08:52 | JVM exited while loading the application.
STATUS | wrapper | 2019/10/21 16:08:57 | Launching a JVM...
ERROR | wrapper | 2019/10/21 16:08:57 | Unable to start JVM: No such file or directory (2)
ERROR | wrapper | 2019/10/21 16:08:57 | JVM exited while loading the application.
FATAL | wrapper | 2019/10/21 16:08:57 | There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up.
FATAL | wrapper | 2019/10/21 16:08:57 | There may be a configuration problem: please check the logs.
STATUS | wrapper | 2019/10/21 16:08:57 | <-- Wrapper Stopped
先定位到是jvm的問題
再看jvm的配置
#設(shè)置路徑
vim /root/mycat/mycat/conf/wrapper.conf
#查看配置
# Java Application
wrapper.java.command=%JAVA_HOME%/bin/java
先改成絕對(duì)路徑金矛,不用環(huán)境變量
wrapper.java.command=/usr/java/jdk1.8.0_171/bin/java
再重啟
mycat restart
還是失敗,繼續(xù)查看日志
INFO | jvm 4 | 2019/10/21 16:27:48 | # There is insufficient memory for the Java Runtime Environment to continue.
INFO | jvm 4 | 2019/10/21 16:27:48 | # Native memory allocation (mmap) failed to map 715849728 bytes for committing reserved memory.
INFO | jvm 4 | 2019/10/21 16:27:48 | # An error report file with more information is saved as:
INFO | jvm 4 | 2019/10/21 16:27:48 | # /root/mycat/mycat/hs_err_pid21295.log
STATUS | wrapper | 2019/10/21 16:27:52 | Launching a JVM...
ERROR | wrapper | 2019/10/21 16:27:52 | JVM exited while loading the application.
INFO | jvm 5 | 2019/10/21 16:27:52 | Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=64M; support was removed in 8.0
INFO | jvm 5 | 2019/10/21 16:27:52 | Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000715550000, 715849728, 0) failed; error='Cannot allocate memory' (errno=12)
INFO | jvm 5 | 2019/10/21 16:27:52 | #
INFO | jvm 5 | 2019/10/21 16:27:52 | # There is insufficient memory for the Java Runtime Environment to continue.
INFO | jvm 5 | 2019/10/21 16:27:52 | # Native memory allocation (mmap) failed to map 715849728 bytes for committing reserved memory.
INFO | jvm 5 | 2019/10/21 16:27:52 | # An error report file with more information is saved as:
INFO | jvm 5 | 2019/10/21 16:27:52 | # /root/mycat/mycat/hs_err_pid21453.log
FATAL | wrapper | 2019/10/21 16:27:52 | There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up.
FATAL | wrapper | 2019/10/21 16:27:52 | There may be a configuration problem: please check the logs.
STATUS | wrapper | 2019/10/21 16:27:52 | <-- Wrapper Stopped
尬...由于窮,買不起高配置的服務(wù)器,內(nèi)存太小浙滤,這個(gè)時(shí)候改下mycat的啟動(dòng)配置
#設(shè)置路徑
vim /root/mycat/mycat/conf/wrapper.conf
#修改配置
wrapper.java.additional.10=-Xmx640M
wrapper.java.additional.11=-Xms256M
再啟動(dòng)....
mycat restart
還是報(bào)錯(cuò),看日志
INFO | jvm 1 | 2019/10/21 16:37:19 | WrapperSimpleApp: Encountered an error running main: java.lang.ExceptionInInitializerError
INFO | jvm 1 | 2019/10/21 16:37:19 | java.lang.ExceptionInInitializerError
INFO | jvm 1 | 2019/10/21 16:37:19 | at io.mycat.MycatStartup.main(MycatStartup.java:53)
INFO | jvm 1 | 2019/10/21 16:37:19 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2019/10/21 16:37:19 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO | jvm 1 | 2019/10/21 16:37:19 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO | jvm 1 | 2019/10/21 16:37:19 | at java.lang.reflect.Method.invoke(Method.java:498)
INFO | jvm 1 | 2019/10/21 16:37:19 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
INFO | jvm 1 | 2019/10/21 16:37:19 | at java.lang.Thread.run(Thread.java:748)
INFO | jvm 1 | 2019/10/21 16:37:19 | Caused by: io.mycat.config.util.ConfigException: org.xml.sax.SAXParseException; lineNumber: 29; columnNumber: 10; 元素內(nèi)容必須由格式正確的字符數(shù)據(jù)或標(biāo)記組成气堕。
INFO | jvm 1 | 2019/10/21 16:37:19 | at io.mycat.config.loader.xml.XMLSchemaLoader.load(XMLSchemaLoader.java:121)
INFO | jvm 1 | 2019/10/21 16:37:19 | at io.mycat.config.loader.xml.XMLSchemaLoader.<init>(XMLSchemaLoader.java:78)
INFO | jvm 1 | 2019/10/21 16:37:19 | at io.mycat.config.loader.xml.XMLSchemaLoader.<init>(XMLSchemaLoader.java:82)
INFO | jvm 1 | 2019/10/21 16:37:19 | at io.mycat.config.ConfigInitializer.<init>(ConfigInitializer.java:76)
INFO | jvm 1 | 2019/10/21 16:37:19 | at io.mycat.config.MycatConfig.<init>(MycatConfig.java:72)
INFO | jvm 1 | 2019/10/21 16:37:19 | at io.mycat.MycatServer.<init>(MycatServer.java:166)
INFO | jvm 1 | 2019/10/21 16:37:19 | at io.mycat.MycatServer.<clinit>(MycatServer.java:109)
INFO | jvm 1 | 2019/10/21 16:37:19 | ... 7 more
INFO | jvm 1 | 2019/10/21 16:37:19 | Caused by: org.xml.sax.SAXParseException; lineNumber: 29; columnNumber: 10; 元素內(nèi)容必須由格式正確的字符數(shù)據(jù)或標(biāo)記組成纺腊。
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.startOfMarkup(XMLDocumentFragmentScannerImpl.java:2635)
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2732)
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
INFO | jvm 1 | 2019/10/21 16:37:19 | at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
INFO | jvm 1 | 2019/10/21 16:37:19 | at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
INFO | jvm 1 | 2019/10/21 16:37:19 | at io.mycat.config.util.ConfigUtil.getDocument(ConfigUtil.java:115)
INFO | jvm 1 | 2019/10/21 16:37:19 | at io.mycat.config.loader.xml.XMLSchemaLoader.load(XMLSchemaLoader.java:111)
INFO | jvm 1 | 2019/10/21 16:37:19 | ... 13 more
STATUS | wrapper | 2019/10/21 16:37:21 | <-- Wrapper Stopped
查看配置文件,在schema.xml 文件發(fā)現(xiàn)確實(shí)多了個(gè)<(提示很友好)
修改掉之后再重啟
mycat restart
再產(chǎn)看日志茎芭,終于啟動(dòng)成功了
STATUS | wrapper | 2019/10/21 16:53:45 | --> Wrapper Started as Daemon
STATUS | wrapper | 2019/10/21 16:53:45 | Launching a JVM...
INFO | jvm 1 | 2019/10/21 16:53:46 | Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=64M; support was removed in 8.0
INFO | jvm 1 | 2019/10/21 16:53:46 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
INFO | jvm 1 | 2019/10/21 16:53:46 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
INFO | jvm 1 | 2019/10/21 16:53:46 |
INFO | jvm 1 | 2019/10/21 16:53:48 | MyCAT Server startup successfully. see logs in logs/mycat.log