Ad Widget

Collapse

Zabbix High availability

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alexdaoust
    Junior Member
    • May 2009
    • 6

    #1

    Zabbix High availability

    Hi! I wanted to share with you all my current setup for a two node active/active zabbix setup. It's not perfect but for now that’s the best I was able to do, maybe some of will be able to help out.

    Important note: this setup does not permit you to do active check on both servers just the first one mention in your zabbix agent config file. (it does not bother me as i don’t really use that function)


    SO we have 2 zabbix server running zabbix 1.8.2 with a mysql DB
    we have about 500 host .
    We wanted to be able to have both server running at the same time since there in different site, that way we have a better monitoring(since something could be seen down in one site but not the other)

    What i did was enable mysql replication of the zabbix database from zabbix1 to zabbix2. I limited the replication to the following table:
    applications
    autoreg_host
    conditions
    config
    dcchecks
    dhosts
    drules
    dservices
    escalations
    expressions
    functions
    globalmacro
    graphs
    graphs_items
    graphs_theme
    groups
    hosts
    hosts_groups
    hosts_profiles
    hosts_profiles_ext
    hosts_templates
    hostmacro
    httpstep
    httpstepitem
    httptest
    images
    items
    items_applications
    maintenances
    maintenances_groups
    maintenances_hosts
    maintenances_windows
    media
    opconditions
    operations
    opmediatypes
    profiles
    regexps
    rights
    screens
    screens_items
    scripts
    service_alarms
    services
    services_links
    services_times
    sysmaps
    sysmaps_elements
    sysmaps_link_triggers
    sysmaps_links
    timeperiods
    trigger_depends
    triggers
    users
    users_groups
    usrgrp

    So basically these are the "configuration" table
    The other tables were not included, because they contain the monitoring data.

    So if i change a setting in zabbix1 it get replicated to zabbix2.

    But, I had to limit the replication to a 2 hour windows during the night, because running the replication all the time is rendering zabbix2 (the slave) useless

    All of this (I believe) because of the items table.

    You see this table contain row called lastclock, lastvalue, prevvalue, and so basically monitoring data. so when this data is replicated to zabbix2 it will cause various problem, like polling the host more than he is suppose to (because of the lastclock value is being replicated) alert not being sent ect....

    Running it during the night also have its disadvantage. One of them being that the slave server will check the host a lot more and that any time limit in the item will not work (since the server will think it’s another hour becasue of the lastclock...)any alert with a avg won’t work either because if the server was suppose to check the data once evey 5 min, now he might do it one every 30 (again because of the lastclock )

    What I would like is to be able to leave the replication running all the time that way if I change the configuration on my main server (zabbix1) the configuration will be automatically replicated to zabbix2

    Anyway just a first post to see what people have for active/active setup and maybe point me in the right direction.


    Also if anyone is interested i can post my config in detail.
  • sunnyfedora99
    Junior Member
    • May 2010
    • 2

    #2
    Zabbix HA

    Hey alexdaoust,

    Can you give me a detailed config setup for this? The only thing is i have a shared (DRBD) storage for mysql databases.

    Regards,

    Sunny

    Comment

    • alexdaoust
      Junior Member
      • May 2009
      • 6

      #3
      sure thing here is the config
      we have 2 server lets call them zabbix1 and zabbix2.
      zabbix1 is the primary server and zabbix2 is the slave.

      first you have to setup replication
      here is a good article http://www.howtoforge.com/mysql_database_replication

      if you need more help with the replication i can always help you.

      on the slave server in /etc/mysql/my.cnf
      add the following line after your replication setting
      replicate-do-table=zabbix.applications
      replicate-do-table=zabbix.autoreg_host
      replicate-do-table=zabbix.conditions
      replicate-do-table=zabbix.config
      replicate-do-table=zabbix.dcchecks
      replicate-do-table=zabbix.dhosts
      replicate-do-table=zabbix.drules
      replicate-do-table=zabbix.dservices
      replicate-do-table=zabbix.escalations
      replicate-do-table=zabbix.expressions
      replicate-do-table=zabbix.functions
      replicate-do-table=zabbix.globalmacro
      replicate-do-table=zabbix.graphs
      replicate-do-table=zabbix.graphs_items
      replicate-do-table=zabbix.graphs_theme
      replicate-do-table=zabbix.groups
      replicate-do-table=zabbix.hosts
      replicate-do-table=zabbix.hosts_groups
      replicate-do-table=zabbix.hosts_profiles
      replicate-do-table=zabbix.hosts_profiles_ext
      replicate-do-table=zabbix.hosts_templates
      replicate-do-table=zabbix.hostmacro
      replicate-do-table=zabbix.httpstep
      replicate-do-table=zabbix.httpstepitem
      replicate-do-table=zabbix.httptest
      replicate-do-table=zabbix.images
      replicate-do-table=zabbix.items
      replicate-do-table=zabbix.items_applications
      replicate-do-table=zabbix.maintenances
      replicate-do-table=zabbix.maintenances_groups
      replicate-do-table=zabbix.maintenances_hosts
      replicate-do-table=zabbix.maintenances_windows
      replicate-do-table=zabbix.media
      replicate-do-table=zabbix.opconditions
      replicate-do-table=zabbix.operations
      replicate-do-table=zabbix.opmediatypes
      replicate-do-table=zabbix.profiles
      replicate-do-table=zabbix.regexps
      replicate-do-table=zabbix.rights
      replicate-do-table=zabbix.screens
      replicate-do-table=zabbix.screens_items
      replicate-do-table=zabbix.scripts
      replicate-do-table=zabbix.service_alarms
      replicate-do-table=zabbix.services
      replicate-do-table=zabbix.services_links
      replicate-do-table=zabbix.services_times
      replicate-do-table=zabbix.sysmaps
      replicate-do-table=zabbix.sysmaps_elements
      replicate-do-table=zabbix.sysmaps_link_triggers
      replicate-do-table=zabbix.sysmaps_links
      replicate-do-table=zabbix.timeperiods
      replicate-do-table=zabbix.trigger_depends
      replicate-do-table=zabbix.triggers
      replicate-do-table=zabbix.users
      replicate-do-table=zabbix.users_groups
      replicate-do-table=zabbix.usrgrp


      after that you have to start the replication (fallowing the article)
      Remember that your DB must be the same on both server

      Comment

      Working...