amoeba下载地址:http://sourceforge.net/projects/amoeba/files

amoeba version:amoeba-mysql-binary-2.1.0-RC5.tar.gz
mysql version:5.5.20
OS:Oracle Linux Server release 5.7
java version: "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)

amoeba 的安装和配置参考http://docs.hexnova.com/amoeba/index.html
安装和配置的过程比较简单,在此记录一个使用过程中遇到的问题:

[mysql@db01 ]$ mysql -uroot -pmysql -h192.168.0.18 -P8066
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11416420
Server version: 5.1.45-mysql-amoeba-proxy-2.1.0-RC5
Copyright (c) 2000, 2011, 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> use test;
No connection. Trying to reconnect...
Connection id:    11416420
Current database: *** NONE ***

mysql> select * from t1;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    11416420
Current database: test
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    11416420
Current database: test
ERROR 2006 (HY000): MySQL server has gone away

amoeba日志中的错误:
2012-03-05 15:10:21,028 INFO  net.ServerableConnectionManager - Amoeba Monitor Server listening on /192.168.0.18:8634.
java.util.NoSuchElementException: Could not create a validated object, cause: ValidateObject failed
        at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1191)
        at com.meidusa.amoeba.net.poolable.GenericObjectPool.borrowObject(GenericObjectPool.java:381)
        at com.meidusa.amoeba.mysql.handler.CommandMessageHandler.startSession(CommandMessageHandler.java:629)
        at com.meidusa.amoeba.mysql.handler.MySqlCommandDispatcher.handleMessage(MySqlCommandDispatcher.java:123)
        at com.meidusa.amoeba.mysql.net.MysqlClientConnection$2.run(MysqlClientConnection.java:291)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
        
查了一些资料,修改了以下三个参数,重启后依然没起作用。
http://dev.mysql.com/doc/refman/5.5/en/error-lost-connection.html        
mysql>show variables like 'connect_timeout';
mysql>show variables like  'net_read_timeout';
mysql>show variables like  'max_allowed_packet';

仔细检查dbServers.xml配置后发现factoryConfig中
<property name="password">password</property>             
默认是被注释掉的,注释取消后正常。
<factoryConfig class="com.meidusa.amoeba.mysql.net.MysqlServerConnectionFactory">
                        <property name="manager">${defaultManager}</property>
                        <property name="sendBufferSize">64</property>
                        <property name="receiveBufferSize">128</property>

<!-- mysql port -->
                        <property name="port">3306</property>

<!-- mysql schema -->
                        <property name="schema">test</property>

<!-- mysql user -->
                        <property name="user">root</property>

     <!--  mysql password
                        <property name="password">password</property>
                        -->
</factoryConfig>

http://blog.csdn.net/lwei_998/article/details/7321880

amoeba连接mysql--ERROR 2006 (HY000): MySQL server has gone away的更多相关文章

  1. Python pandas ERROR 2006 (HY000): MySQL server has gone away

    之前在做python pandas大数据分析的时候,在将分析后的数据存入mysql的时候报ERROR 2006 (HY000): MySQL server has gone away 原因分析:在对百 ...

  2. 解决ERROR 2006 (HY000): MySQL server has gone away

    刚把博客从百度云搬到腾讯云,发现文章少了几篇.当时在导入dump数据的时候,就曾经发现mysql提示: ERROR 2006 (HY000): MySQL server has gone away N ...

  3. MaxScale ERROR 2006 (HY000): MySQL server has gone away

    Error: MaxScale cannot be run as root.Failed to write child process message!解决办法:# maxscale -f /etc/ ...

  4. mysql 使用shell时出现 ERROR 2006 (HY000): MySQL server has gone away 解决方法

    ERROR (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection Current d ...

  5. MySQL_解决ERROR 2006 (HY000) at line XX MySQL server has gone away问题

    参考:http://www.111cn.net/database/mysql/106911.htm 1.修改mysqld的配置文件my.cnf 调整max_allowed_packet的值,修改为5M ...

  6. mysql恢复和数据导入的问题(ERROR 2006 (HY000) at line 1016: MySQL server has gone away)

    今天在上班过程中需要将一个1.3G的数据库sql文件导入到mysql数据库中去,在执行过程遇到了一些问题,执行到一半时报错,错误如下 ERROR 2006 (HY000) at line 1016: ...

  7. Linux MySQl 5.7.17 MySQL ERROR 1366(HY000):Incorrect string value 解决方法

    MySQL ERROR 1366(HY000):Incorrect string value,在往数据库中插入中文的时候会出现. 这也就是编码问题,网上大部分都是说设置下配置文件中的设置,而可悲的是在 ...

  8. MySQL:ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

    解决方法: 修改密码:alter user 'root'@'localhost' identified by '123456'; mysql> use mysql; ERROR 1820 (HY ...

  9. mysql - ERROR 1114 (HY000): The table is full

    mysql - ERROR 1114 (HY000): The table is full - Stack Overflowhttps://stackoverflow.com/questions/73 ...

随机推荐

  1. 水题 Codeforces Round #308 (Div. 2) A. Vanya and Table

    题目传送门 /* 水题:读懂题目就能做 */ #include <cstdio> #include <iostream> #include <algorithm> ...

  2. 命名管道实现进程间通信--石头、剪刀、布游戏 分类: linux 2014-06-01 22:50 467人阅读 评论(0) 收藏

    下面这个程序利用命名管道实现进程间通信,模拟石头剪刀布游戏. 主进程为裁判进程,两个子进程为选手进程.裁判与选手间各建立一个命名管道. 进行100次出招,最后给出游戏胜负. #include < ...

  3. JAVA300集笔记

    章节2 java入门阶段 2.1注释 单行注释 //  多行注释 /* 内容*/ 文本注释/**内容*/ 注释是为了方便阅读代码,在编译时注释会被删除. 2.2 标识符 标识符作用: 标识符用来给变量 ...

  4. ES5之变量

    什么是变量:存放物体的一个容器,以便后续利用该容器存放的物体. 变量的声明及赋值: 声明变量关键字var; 变量名的规范:变量名由英文字母.数字.下划线.美元符号组成,但是首字母只能是英文字母.下划线 ...

  5. git 控制操作

    克隆文件 git clone https://gitee.com/xxxxx/xxxxx.git 克隆分支文件 git clone -b 分支名 https://gitee.com/xxxxx/xxx ...

  6. js模拟支付宝发送短信验证码&&&&短信倒计时

    html <div class="pwdContent"> <div class="pwdBox"></div> <d ...

  7. 第3节 hive高级用法:13、hive的函数

    4.2.Hive参数配置方式 Hive参数大全: https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties 开 ...

  8. torch.nn.Linear()函数的理解

    import torch x = torch.randn(128, 20) # 输入的维度是(128,20)m = torch.nn.Linear(20, 30) # 20,30是指维度output ...

  9. android网络图片自动轮播 githhub地址

    https://github.com/panxw/android-image-indicator

  10. Redux的中间件Middleware不难,我信了^_^

    Redux的action和reducer已经足够复杂了,现在还需要理解Redux的中间件.为什么Redux的存在有何意义?为什么Redux的中间件有这么多层的函数返回?Redux的中间件究竟是如何工作 ...