Ad Widget

Collapse

"MySQL server has gone away" - Backend on MySQL Galera via HAProxy

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FonTim
    Junior Member
    • Jan 2013
    • 15

    #1

    "MySQL server has gone away" - Backend on MySQL Galera via HAProxy

    We are installing a new Zabbix (2.0.6 on Debian Wheezy from wheezy-backports repo) and with the backend DB hosted by a 2-node MySQL Galera cluster which the Zabbix server accesses via HAProxy (HAProxy on the same server as Zabbix, the Galera cluster hosted separately).

    Our log level is currently at DEBUG during the installation & configuration and we are getting a lot of the below errors in the Zabbix Server log:

    Code:
     23570:20130711:214200.284 [Z3005] query failed: [2006] MySQL server has gone away [select m.maintenanceid,m.maintenance_type,m.active_since,tp.timeperiod_type,tp.every,tp.month,tp.dayofweek,tp.day,tp.start_time,tp.period,tp.start_date from maintenances m,maintenances_windows mw,timeperiods tp where m.maintenanceid=mw.maintenanceid and mw.timeperiodid=tp.timeperiodid and m.active_since<=1373571720 and m.active_till>1373571720]
     23572:20130711:214226.714 [Z3005] query failed: [2006] MySQL server has gone away [select distinct r.druleid,r.iprange,r.name,c.dcheckid from drules r left join dchecks c on c.druleid=r.druleid and uniq=1 where r.proxy_hostid is null and r.status=0 and (r.nextcheck<=1373571746 or r.nextcheck>1373571746+r.delay) and mod(r.druleid,1)=0 and r.druleid between 0 and 99999999999999]
     23554:20130711:214229.565 [Z3005] query failed: [2006] MySQL server has gone away [select alert_history,event_history,refresh_unsupported,discovery_groupid,snmptrap_logging,severity_name_0,severity_name_1,severity_name_2,severity_name_3,severity_name_4,severity_name_5 from config where 1=1 and configid between 0 and 99999999999999]
     23570:20130711:214300.290 [Z3005] query failed: [2006] MySQL server has gone away [select m.maintenanceid,m.maintenance_type,m.active_since,tp.timeperiod_type,tp.every,tp.month,tp.dayofweek,tp.day,tp.start_time,tp.period,tp.start_date from maintenances m,maintenances_windows mw,timeperiods tp where m.maintenanceid=mw.maintenanceid and mw.timeperiodid=tp.timeperiodid and m.active_since<=1373571780 and m.active_till>1373571780]
     23572:20130711:214326.720 [Z3005] query failed: [2006] MySQL server has gone away [select distinct r.druleid,r.iprange,r.name,c.dcheckid from drules r left join dchecks c on c.druleid=r.druleid and uniq=1 where r.proxy_hostid is null and r.status=0 and (r.nextcheck<=1373571806 or r.nextcheck>1373571806+r.delay) and mod(r.druleid,1)=0 and r.druleid between 0 and 99999999999999]
     23554:20130711:214329.572 [Z3005] query failed: [2006] MySQL server has gone away [select alert_history,event_history,refresh_unsupported,discovery_groupid,snmptrap_logging,severity_name_0,severity_name_1,severity_name_2,severity_name_3,severity_name_4,severity_name_5 from config where 1=1 and configid between 0 and 99999999999999]
     23570:20130711:214400.296 [Z3005] query failed: [2006] MySQL server has gone away [select m.maintenanceid,m.maintenance_type,m.active_since,tp.timeperiod_type,tp.every,tp.month,tp.dayofweek,tp.day,tp.start_time,tp.period,tp.start_date from maintenances m,maintenances_windows mw,timeperiods tp where m.maintenanceid=mw.maintenanceid and mw.timeperiodid=tp.timeperiodid and m.active_since<=1373571840 and m.active_till>1373571840]
     23572:20130711:214426.726 [Z3005] query failed: [2006] MySQL server has gone away [select distinct r.druleid,r.iprange,r.name,c.dcheckid from drules r left join dchecks c on c.druleid=r.druleid and uniq=1 where r.proxy_hostid is null and r.status=0 and (r.nextcheck<=1373571866 or r.nextcheck>1373571866+r.delay) and mod(r.druleid,1)=0 and r.druleid between 0 and 99999999999999]
     23554:20130711:214429.580 [Z3005] query failed: [2006] MySQL server has gone away [select alert_history,event_history,refresh_unsupported,discovery_groupid,snmptrap_logging,severity_name_0,severity_name_1,severity_name_2,severity_name_3,severity_name_4,severity_name_5 from config where 1=1 and configid between 0 and 99999999999999]
    This was with a very simply HAProxy config with roundrobin balancing. When we marked one of the Galera servers as 'backup' only, it massively reduced the errors, but didn't solve the issue altogether.

    Does anyone have experience with this issue and any ideas for us to try and solve it, or is it safe to ignore in that when Zabbix fails with this error, it tries the MySQL connection again?

    Many thanks.
  • BayramGrbz45
    Junior Member
    • Sep 2020
    • 16

    #2
    I'm trying to run Zabbix with haproxy, mariadb and galera cluster. Can you help me?

    3 mariadb cluster databse server.
    2 keepalıvad and haproxy server.
    1 zabbix server.

    log;
    Error in query [COMMIT] [Deadlock found when trying to get lock; try restarting transaction]

    log2;
    Sep 28 13:59:41 db2 mysqld[18273]: 2020-09-28 13:59:41 101 [Warning] Aborted connection 101 to db: 'mydb' user: 'myuser' host: '192.168.1.107' (Got an error reading communication packets)

    log3;
    Sep 28 14:01:58 hake haproxy[16785]: 192.168.1.103:37036 [28/Sep/2020:14:01:58.229] galera_cluster_frontend galera_cluster_backend/db2 1/1/8 295 -- 14/14/13/4/0 0/0
    Sep 28 14:01:59 hake haproxy[16785]: 192.168.1.103:36960 [28/Sep/2020:14:01:09.283] galera_cluster_frontend galera_cluster_backend/db1 1/0/50008 364 cD 13/13/12/4/0 0/0
    Sep 28 14:01:59 hake haproxy[16785]: 192.168.1.103:37038 [28/Sep/2020:14:01:59.492] galera_cluster_frontend galera_cluster_backend/db3 1/0/27 2550 -- 14/14/13/4/0 0/0

    log4;

    Sep 28 14:05:29 hake Keepalived_vrrp[19536]: Opening file '/etc/keepalived/keepalived.conf'.
    Sep 28 14:05:29 hake Keepalived_vrrp[19536]: WARNING - default user 'keepalived_script' for script execution does not exist - please create.
    Sep 28 14:05:29 hake Keepalived_vrrp[19536]: Truncating auth_pass to 8 characters
    Sep 28 14:05:29 hake Keepalived_vrrp[19536]: SECURITY VIOLATION - scripts are being executed but script_security not enabled.
    Sep 28 14:05:29 hake Keepalived_vrrp[19536]: Using LinkWatch kernel netlink reflector...
    Sep 28 14:05:29 hake Keepalived_vrrp[19536]: VRRP_Script(chk_haproxy) succeeded
    Sep 28 14:05:30 hake Keepalived_vrrp[19536]: VRRP_Instance(LB_VIP) Transition to MASTER STATE
    Sep 28 14:05:30 hake Keepalived_vrrp[19536]: VRRP_Instance(LB_VIP) Changing effective priority from 101 to 103
    Sep 28 14:05:31 hake Keepalived_vrrp[19536]: VRRP_Instance(LB_VIP) Entering MASTER STATE
    Sep 28 14:05:31 hake Keepalived_vrrp[19536]: SMTP connection ERROR to [127.0.0.1]:25.

    Comment

    Working...