远程Mysql连接Navicat连接远程mycat报错ERROR 2003 (HY000): Can't connect to MySQL server on x.x.x.x

今天 linux 系统下做了 mycat 的数据库分片,虚拟机启动 mycat 服务后,win7 下远程连接 mycat。

发现 mycat 启动以后使用 Navicat for mysql 连接报了下列错误

ERROR 2003 (HY000): Can't connect to MySQL server on x.x.x.x

于是回去看了一下mycat的服务居然自动挂了

./mycat status

看了一下mycat的日志

./mycat console

出现下列信息

wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
wrapper  | JVM exited while loading the application.
jvm 1    | OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=64M; support was removed in 8.0
jvm 1    | OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000aaaa0000, 1431699456, 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 1431699456 bytes for committing reserved memory.
jvm 1    | # An error report file with more information is saved as:
jvm 1    | # /usr/local/mycat/hs_err_pid49051.log
wrapper  | Launching a JVM...
wrapper  | JVM exited while loading the application.

 

翻译了一下大概说是jvm没法分配内存了

于是去度娘了一下!

发现网上说需要开启系统的 Over-commit,跳过系统的可用内存检查直接分配。

为了避免重启服务器以后  搭建的zk集群solr集群redis集群  需要重新启动

执行了临时操作

临时更改: echo 1 > /proc/sys/vm/overcommit_memory

永久更改: 编辑 /etc/sysctl.conf,修改参数 vm.overcommit_memory = 1,重启服务器或者用户重新登录

执行完以后发现Navicat可以正常连接mycat的端口了

记录每一个坑!

参考: http://www.cnblogs.com/rabbitpei/p/6738671.html

 

 

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值