摘要:将mycat1.4升级到1.5
为什么升级
我们公司自2015年6月开始使用mycat1.4-RC,9月份升级到1.4-RELEASE,直到今天已经稳定运行快2年了。昨天晚上线上mycat突然发生连接失败报警,于是迅速登上服务器看到如下报错:
04/21 21:50:01.156 WARN [$_MyCatServer] (NIOAcceptor.java:121) -$_MyCatServer java.lang.ArrayIndexOutOfBoundsException: 9 at org.opencloudb.net.NIOReactorPool.getNextReactor(NIOReactorPool.java:22) at org.opencloudb.net.NIOAcceptor.accept(NIOAcceptor.java:117) at org.opencloudb.net.NIOAcceptor.run(NIOAcceptor.java:91)
|
先紧急处理故障:备份mycat日志并重启mycat后恢复正常。今天上午咨询了Leader-us,确认此为1.4的bug,建议升级到1.5!
下载mycat1.5
下载地址:https://github.com/MyCATApache/Mycat-download/blob/master/1.5-RELEASE/Mycat-server-1.5.1-RELEASE-20161130213509-linux.tar.gz
删除当前目录下所有的文件夹:
[root@mycat2 src]# find ./ -type d |xargs rm -rf
|
解压:
[root@mycat2 src]# tar -zxvf Mycat-server-1.5.1-RELEASE-20161130213509-linux.tar.gz
|
查看文件:
[root@mycat2 src]# cd mycat/ [root@mycat2 mycat]# ls bin catlet conf lib logs version.txt [root@mycat2 mycat]# cat version.txt BuildTime 2016-11-30 13:35:05 GitVersion 15645b8ef82a653bcd7c66f6d15f8bd73249991f MavenVersion 1.5.1-RELEASE GitUrl https://github.com/MyCATApache/Mycat-Server.git MyCatSite http://www.mycat.org.cn QQGroup 106088787 [root@mycat2 mycat]#
|
备份mycat1.4
[root@mycat2 local]# cp -r mycat mycat1.4_20170422
|
升级
将mycat1.4中的配置文件目录(conf)拷贝到1.5
[root@mycat2]#cd /usr/local/mycat 采用不提示直接覆盖的方式拷贝文件: [root@mycat2 mycat]# \cp -rf conf/ /src/mycat/ 拷贝完毕后要到1.5的mycat目录中确认下配置文件是否完好,确定OK后再将1.4的mycat删掉,将1.5的mycat拷贝到/usr/local然后启动mycat [root@mycat2 local]# rm -rf mycat [root@mycat2 local]# mv /src/mycat/ ./ [root@mycat2 local]# mycat start Starting Mycat-server... [root@mycat2 local]# ps -ef|grep mycat root 300 1 0 15:00 ? 00:00:00 /usr/local/mycat/bin/./wrapper-linux-x86-64 /usr/local/mycat/conf/wrapper.conf wrapper.syslog.ident=mycat wrapper.pidfile=/usr/local/mycat/logs/mycat.pid wrapper.daemonize=TRUE wrapper.lockfile=/var/lock/subsys/mycat root 351 17022 0 15:00 pts/0 00:00:00 grep mycat [root@mycat2 local]# mysql -udev_ro -pdev2017 -h192.168.1.130 -P8066 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 51 Server version: 5.5.8-mycat-1.5.1-RELEASE-20161130213509 MyCat Server (OpenCloundDB) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +---------------+ | DATABASE | +---------------+ | testdb | | riverdb | +---------------+ 14 rows in set (0.00 sec) mysql> exit Bye [root@mycat2 local]#
|