MyCat:java
MyCat的官方網站:linux
下載地址:github
https://github.com/MyCATApache/Mycat-download服務器
已經更換爲:app
http://dl.mycat.io/1.6-RELEASE/less
第一步:將Mycat-server-1.4-release-20151019230038-linux.tar.gz上傳至服務器dom
tar -xzvf Mycat-server-1.4-release-20151019230038-linux.tar.gz mv mycat /usr/local
第二步:將壓縮包解壓縮。建議將mycat放到/usr/local/mycat目錄下。jvm
./mycat start
中止:第三步:進入mycat目錄的bin目錄,啓動mycat網站
./mycat stop
Mycat的默認端口號爲:8066mycat 支持的命令{ console | start | stop | restart | status | dump }
下載新版本的啓動的時候會報錯:
STATUS | wrapper | 2019/09/27 10:19:53 | --> Wrapper Started as Daemon STATUS | wrapper | 2019/09/27 10:19:53 | Launching a JVM... ERROR | wrapper | 2019/09/27 10:19:53 | JVM exited while loading the application. INFO | jvm 1 | 2019/09/27 10:19:53 | Invalid maximum heap size: -Xmx4G INFO | jvm 1 | 2019/09/27 10:19:53 | The specified size exceeds the maximum representable size. INFO | jvm 1 | 2019/09/27 10:19:53 | Error: Could not create the Java Virtual Machine. INFO | jvm 1 | 2019/09/27 10:19:53 | Error: A fatal exception has occurred. Program will exit. STATUS | wrapper | 2019/09/27 10:19:57 | Launching a JVM... ERROR | wrapper | 2019/09/27 10:19:57 | JVM exited while loading the application. INFO | jvm 2 | 2019/09/27 10:19:57 | Invalid maximum heap size: -Xmx4G INFO | jvm 2 | 2019/09/27 10:19:57 | The specified size exceeds the maximum representable size. INFO | jvm 2 | 2019/09/27 10:19:57 | Error: Could not create the Java Virtual Machine. INFO | jvm 2 | 2019/09/27 10:19:57 | Error: A fatal exception has occurred. Program will exit. STATUS | wrapper | 2019/09/27 10:20:02 | Launching a JVM... ERROR | wrapper | 2019/09/27 10:20:02 | JVM exited while loading the application. INFO | jvm 3 | 2019/09/27 10:20:02 | Invalid maximum heap size: -Xmx4G INFO | jvm 3 | 2019/09/27 10:20:02 | The specified size exceeds the maximum representable size. INFO | jvm 3 | 2019/09/27 10:20:02 | Error: Could not create the Java Virtual Machine. INFO | jvm 3 | 2019/09/27 10:20:02 | Error: A fatal exception has occurred. Program will exit. STATUS | wrapper | 2019/09/27 10:20:06 | Launching a JVM... ERROR | wrapper | 2019/09/27 10:20:06 | JVM exited while loading the application. INFO | jvm 4 | 2019/09/27 10:20:06 | Invalid maximum heap size: -Xmx4G INFO | jvm 4 | 2019/09/27 10:20:06 | The specified size exceeds the maximum representable size. INFO | jvm 4 | 2019/09/27 10:20:06 | Error: Could not create the Java Virtual Machine. INFO | jvm 4 | 2019/09/27 10:20:06 | Error: A fatal exception has occurred. Program will exit. STATUS | wrapper | 2019/09/27 10:20:10 | Launching a JVM... ERROR | wrapper | 2019/09/27 10:20:10 | JVM exited while loading the application. INFO | jvm 5 | 2019/09/27 10:20:10 | Invalid maximum heap size: -Xmx4G INFO | jvm 5 | 2019/09/27 10:20:10 | The specified size exceeds the maximum representable size. INFO | jvm 5 | 2019/09/27 10:20:10 | Error: Could not create the Java Virtual Machine. INFO | jvm 5 | 2019/09/27 10:20:10 | Error: A fatal exception has occurred. Program will exit. FATAL | wrapper | 2019/09/27 10:20:10 | There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up. FATAL | wrapper | 2019/09/27 10:20:10 | There may be a configuration problem: please check the logs. STATUS | wrapper | 2019/09/27 10:20:10 | <-- Wrapper Stopped
大體意思是jvm內存不夠,解決方法:
在mycat文件下conf中修改wrapper.conf文件
刪除一下兩行:在第36,37行(1.6的版本)
wrapper.java.additional.10=-Xmx4G wrapper.java.additional.11=-Xms1G
而後再次啓動的時候,還會報錯:
STATUS | wrapper | 2019/09/29 23:24:33 | --> Wrapper Started as Daemon STATUS | wrapper | 2019/09/29 23:24:34 | Launching a JVM... ERROR | wrapper | 2019/09/29 23:24:49 | JVM exited while loading the application. INFO | jvm 1 | 2019/09/29 23:24:49 | Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: cluster-1: cluster-1: Temporary failure in name resolution STATUS | wrapper | 2019/09/29 23:24:53 | Launching a JVM... ERROR | wrapper | 2019/09/29 23:25:08 | JVM exited while loading the application. INFO | jvm 2 | 2019/09/29 23:25:08 | Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: cluster-1: cluster-1: Temporary failure in name resolution STATUS | wrapper | 2019/09/29 23:25:12 | Launching a JVM... ERROR | wrapper | 2019/09/29 23:25:28 | JVM exited while loading the application. INFO | jvm 3 | 2019/09/29 23:25:28 | Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: cluster-1: cluster-1: Temporary failure in name resolution STATUS | wrapper | 2019/09/29 23:25:32 | Launching a JVM... ERROR | wrapper | 2019/09/29 23:25:47 | JVM exited while loading the application. INFO | jvm 4 | 2019/09/29 23:25:47 | Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: cluster-1: cluster-1: Temporary failure in name resolution STATUS | wrapper | 2019/09/29 23:25:51 | Launching a JVM... ERROR | wrapper | 2019/09/29 23:26:06 | JVM exited while loading the application. INFO | jvm 5 | 2019/09/29 23:26:06 | Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: cluster-1: cluster-1: Temporary failure in name resolution FATAL | wrapper | 2019/09/29 23:26:06 | There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up. FATAL | wrapper | 2019/09/29 23:26:06 | There may be a configuration problem: please check the logs. STATUS | wrapper | 2019/09/29 23:26:06 | <-- Wrapper Stopped
解決方法:
vi /etc/sysconfig/network 追加一行: HOSTNAME=你的主機名 接着修改: vi /etc/hosts 添加這句後面添加 你的主機名 127.0.0.1 localhost.localdomain localhost 你的主機名
而後從新啓動。。。。ok