在linux上安装了mycat后,输入命令启动mycat时,
[root@itcast mycat]# cd /usr/local/software/mycat
[root@itcast mycat]# bin/mycat start
Starting Mycat-server…
[root@itcast mycat]#
检查mycat运行的状态
[root@itcast mycat]# bin/mycat start
Mycat-server is not running
[root@itcast mycat]#
查看mycat的日志
[root@itcast mycat]# /usr/local/software/mycat/bin/mycat console
发现类似报错信息:
# error='Cannot allocate memory' (errno=12)
# Native memory allocation (malloc) failed to allocate 1431699456 bytes for committing reserved memory.
提示说无法申请内存,可能的原因就是虚拟机的内存不够。我用的虚拟机是 1024M的 内存,所以内存不够,重新分配了1G,就不会报这个错了。
重新分配内存的话就需要修改虚拟机的硬件配置。我用的虚拟机是centOS,要修改虚拟机配置,需要在虚拟机的设置-处理器和内存中进行配置。