Ad Widget

Collapse

Zabbix Failover suggestions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • registration_is_lame
    Senior Member
    • Nov 2007
    • 148

    #1

    Zabbix Failover suggestions

    How can I setup failover for zabbix polling service without virtual IP.

    So I have 2 zabbix servers (along with frontend) connected to the same database.
    Zabbix 1: 10.10.10.10 -> Connect to Database 1. Current polling.
    Zabbix 2: 20.20.20.20 -> Connect to Database 1. (Zabbix service is stopped to prevent polling and duplicate data in DB - It can't be idle right ??)
    Database 1: 30.30.30.30

    Agents have been configured to listen from Zabbix 1 and Zabbix 2.

    I want setup failover in such a way that if zabbix 1 is down, zabbix 2 should start polling (temporarily).
    If zabbix 1 is back online, zabbix 2 should stop and zabbix 1 should take over and start polling.

    Any suggestions?

    If Zabbix 2 could be idle then instant polling (or send signal to start polling after few minutes) could be possible I guess? if Not, a tool is needed for service to be started if Zabbix 1 is down for 5 minutes.

    similar question but different: https://www.zabbix.com/forum/showthread.php?t=16744

    Frontend failover isn't necessary because both zabbix frontend has been configured to use the same Database to retrieve data.
    Last edited by registration_is_lame; 21-09-2016, 22:44.
  • hpeti2
    Junior Member
    • Jul 2015
    • 29

    #2
    Originally posted by registration_is_lame
    How can I setup failover for zabbix polling service without virtual IP.

    So I have 2 zabbix servers (along with frontend) connected to the same database.
    Zabbix 1: 10.10.10.10 -> Connect to Database 1. Current polling.
    Zabbix 2: 20.20.20.20 -> Connect to Database 1. (Zabbix service is stopped to prevent polling and duplicate data in DB - It can't be idle right ??)
    Database 1: 30.30.30.30

    Agents have been configured to listen from Zabbix 1 and Zabbix 2.

    I want setup failover in such a way that if zabbix 1 is down, zabbix 2 should start polling (temporarily).
    If zabbix 1 is back online, zabbix 2 should stop and zabbix 1 should take over and start polling.

    Any suggestions?

    If Zabbix 2 could be idle then instant polling (or send signal to start polling after few minutes) could be possible I guess? if Not, a tool is needed for service to be started if Zabbix 1 is down for 5 minutes.

    similar question but different: https://www.zabbix.com/forum/showthread.php?t=16744

    Frontend failover isn't necessary because both zabbix frontend has been configured to use the same Database to retrieve data.
    We use Corosync+Pacemaker to make a similar funcionality. 1 virtual IP for 2 server. HAProxy with 1 virtual IP for Percona XtraDB Cluster (mysql database).

    More information see this:
    Join the friendly and open Zabbix community on our forums and social media platforms.

    Comment

    • registration_is_lame
      Senior Member
      • Nov 2007
      • 148

      #3
      Originally posted by hpeti2
      We use Corosync+Pacemaker to make a similar funcionality. 1 virtual IP for 2 server. HAProxy with 1 virtual IP for Percona XtraDB Cluster (mysql database).

      More information see this:
      https://www.zabbix.org/wiki/Docs/how...h_availability
      I've been looking into corosync and pacemaker. But i'm unsure how to do it without virtual IP. Is virtual IP really necessary? I'm gonna do a trail run for some other service.

      Can you post your config if you can? I'd love to know how the zabbix 2 service is set to start in when the main server is down.

      Comment

      • hpeti2
        Junior Member
        • Jul 2015
        • 29

        #4
        Originally posted by registration_is_lame
        I've been looking into corosync and pacemaker. But i'm unsure how to do it without virtual IP. Is virtual IP really necessary? I'm gonna do a trail run for some other service.

        Can you post your config if you can? I'd love to know how the zabbix 2 service is set to start in when the main server is down.
        There are nothing special in zabbix_server.conf just set SourceIP=VIP and corosync config is same as describes in above link.

        I think the VIP is really useful if you set this to server's address in zabbix_agent.conf. Only the "active" zabbiy server recive data and avoid database collision.

        Comment

        • registration_is_lame
          Senior Member
          • Nov 2007
          • 148

          #5
          Originally posted by hpeti2
          There are nothing special in zabbix_server.conf just set SourceIP=VIP and corosync config is same as describes in above link.

          I think the VIP is really useful if you set this to server's address in zabbix_agent.conf. Only the "active" zabbiy server recive data and avoid database collision.
          I meant the corosync/pacemaker configs, anyway I've seen the documentation.
          But i'm not sure how I should configure corosync/pacemaker without virtual IP address. Couldn't find any articles for without virtual IP setup

          Comment

          • peatb
            Zabbix Certified Trainer
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Aug 2016
            • 36

            #6
            A virtual IP is just another resource in corosync/pacemaker. So making a cluster without it is the same as with it, just leave the IP out of the configuration (or you could use any address, like 192.168.1.1, and it will just not do anything)

            However, why don't you want to use a virtual IP (doesn't your network topology allow it)? It's a really convenient way to setup high availability. It also makes your zabbix agent configs easier, you only have to specify the VIP for server and serveractive. Also you can just ssh to the VIP (and the webinterface is on the VIP as well).

            final note: you can't have zabbix running in 'idle' mode and you certainly don't want them active at the same time.

            Comment

            • registration_is_lame
              Senior Member
              • Nov 2007
              • 148

              #7
              Originally posted by peatb
              A virtual IP is just another resource in corosync/pacemaker. So making a cluster without it is the same as with it, just leave the IP out of the configuration (or you could use any address, like 192.168.1.1, and it will just not do anything)
              I did not know that. Will try this week.

              Thanks for clarifying. Virtual IP isn't gonna happen unless I create another server in the same DC which I might in future.

              Comment

              Working...