Linux下mycat安装,windows下SQLyog连接,以及启动存在的问题
文章目录
一、Linux下mycat安装
1.安装JDK
因为mycat是用java写的,中国人写的,直接安装
①
yum list|grep JDK
yum install java-1.7.0-openjdk
因为mycat 基于jdk1.7开发的,所有最好安装jdk1.7的版本
或者
② 通过在Windows下载压缩包,解压在linux下,再配置环境变量
2. 下载 mycat(官网:http://www.mycat.io/)
- 说明: Mycat-server-1.6-release 版本发布的版本是基于jdk1.7开发的,所在要安装JDK1.7
Mycat-server-1.6.7.1-release 版本发布 更新成了JDK1.8所以要安装JDK1.8(使用比较广泛),下面的教程是使用JDK1.8
下载好Linux版本压缩包(http://dl.mycat.io/1.6.7.1/Mycat-server-1.6.7.1-release-20190627191042-linux.tar.gz)
传达Linux下,解压到指定目录
- Mycat的目录结构
- bin 执行命令的目录
- conf 配置文件
- lib 依赖包
- logs 日志包
二、控制台形式运行mycat(./mycat console)问题截图(JDK1.8)
1.问题(查看JDK版本为1.8,是内存不足的问题)
cd bin
./mycat start|stop|restart|status|console
Running Mycat-server...
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
wrapper | JVM exited while loading the application.
jvm 1 | Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=64M; support was removed in 8.0
jvm 1 | Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000715550000, 715849728, 0) failed; error='Cannot allocate memory' (errno=12)
jvm 1 | #
jvm 1 | # There is insufficient memory for the Java Runtime Environment to continue.
jvm 1 | # Native memory allocation (mmap) failed to map 715849728 bytes for committing reserved memory.
jvm 1 | # An error report file with more information is saved as:
jvm 1 | # /usr/local/mycat/mycat/hs_err_pid19995.log
2. 解决方法(修改 mycat/conf/wrapper.conf 配置文件)
重新启动
cd bin
./mycat console
三、Windows下安装mycat的SQLyog连接
发现里面已经有一些表,但这些表不是真实的表,是虚拟的,无法查看,显示无效的数据源(Invalid DataSource)