Ad Widget

Collapse

zabbix proxy clients unreachable during mysqldump

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tristan
    Senior Member
    • Feb 2008
    • 110

    #1

    zabbix proxy clients unreachable during mysqldump

    Every day at 21:00 i make a sqldump from my zabbix database. But when i run the backup there is no problem, but when the backup is finished mysql does something wat makes all my zabbixproxy clients unreachable for less the a minute!

    My database is approx. 800 meg. The problem appears since i have implement a zabbixproxy for my external hosts. When i add an internal host to my zabbix proxy i have the same unreachable error.

    Are there people with the same problem?

    i have used nice to lower the piority of the mysqldump process but it doens't help.
  • Tristan
    Senior Member
    • Feb 2008
    • 110

    #2
    Originally posted by Tristan
    Every day at 21:00 i make a sqldump from my zabbix database. But when i run the backup there is no problem, but when the backup is finished mysql does something wat makes all my zabbixproxy clients unreachable for less the a minute!

    My database is approx. 800 meg. The problem appears since i have implement a zabbixproxy for my external hosts. When i add an internal host to my zabbix proxy i have the same unreachable error.

    Are there people with the same problem?

    i have used nice to lower the piority of the mysqldump process but it doens't help.
    It's obivious that the nice command doens't work. Mysqldump loads mysql and that don't have a nice.

    Comment

    • Tristan
      Senior Member
      • Feb 2008
      • 110

      #3
      Solved!

      It's really very easy if you know the solution :P
      I have reads some information about mysqldump and figured out the following.
      I use mysqldump now with the -q option. It dumps row for row instead of the whole table to memory and then writing it tho the disks. It's better for big databases.

      To solve the unreachable problem i used --single-transaction
      It privents mysqldump to lock the tables during backup(innodb required). So the zabbix server get's its info and don't warns me with false unreachable errors. Strange that this is happening only from my zabbix proxy hosts.

      my backup script. It used zabbix sender to send a message to my zabbix server. i used this script on all my mysql database servers:

      OUTPUTFILE="/backup/zabbixdb.sqldump"
      DATABASE="zabbix"
      ZABBIXSENDER="/opt/zabbix-1.6.0/sbin/zabbix_sender"
      ZABBIXSRV="135.150.161.75"
      ZABBIXHOSTNAME="zabbix"
      DATABASEUSER="root"
      DATABASEPASSWORD="Blabla"

      #Backup maken
      OUTPUT=$(nice -n 19 mysqldump -u $DATABASEUSER --password=$DATABASEPASSWORD --single-transaction -q $DATABASE 2>&1 > $OUTPUTFILE)

      #send message to zabbix
      if [ -z "$OUTPUT" ]
      then
      $ZABBIXSENDER -z $ZABBIXSRV -p 10051 -s $ZABBIXHOSTNAME -k mysqlbackup -o "completed"
      else
      $ZABBIXSENDER -z $ZABBIXSRV -p 10051 -s $ZABBIXHOSTNAME -k mysqlbackup -o "Failled: $OUTPUT"
      Last edited by Tristan; 20-10-2008, 16:22.

      Comment

      Working...