Ad Widget

Collapse

Zabbix-HA, node failover.

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

    #1

    Zabbix-HA, node failover.

    Hi all,

    I'm trying to asses Zabbix-HA and have a working model (bunch of VMs) of an Active/Passive failover setup with Pacemaker/Corosync and I'm looking to extend this to cover distributed monitoring too. In the main datacenter I will have this Zabbix-HA setup acting as a master node to other regular Zabbix nodes in other datacentres.

    My question is: if I have a Zabbix node per datacentre, can I configure the agents that normally respond to the node to talk directly to the master in case the node is unavailable, or should I roll out the same Zabbix-HA solution for each node as well as the master?

    Many thanks.
  • elvar
    Senior Member
    • Feb 2008
    • 226

    #2
    Originally posted by FonTim
    Hi all,

    I'm trying to asses Zabbix-HA and have a working model (bunch of VMs) of an Active/Passive failover setup with Pacemaker/Corosync and I'm looking to extend this to cover distributed monitoring too. In the main datacenter I will have this Zabbix-HA setup acting as a master node to other regular Zabbix nodes in other datacentres.

    My question is: if I have a Zabbix node per datacentre, can I configure the agents that normally respond to the node to talk directly to the master in case the node is unavailable, or should I roll out the same Zabbix-HA solution for each node as well as the master?

    Many thanks.
    I'm interested in how this plays out and what the final solution ends up being. Consider this reply my subscription to the thread.

    Comment

    • FonTim
      Junior Member
      • Jan 2013
      • 15

      #3
      For the time being, my boss wants to use the facilities of VMWare & shared storage to ensure the high availability. So rather than an active passive, the master will be rebooted in the event of hardware failure.

      This is making me lean more to using nodes rather than proxies so in the event of the master going down, we can still see the status with the node dashboards, and still recieve alerts etc...

      Comment

      • PhilSynek
        Junior Member
        • May 2012
        • 13

        #4
        Hi,

        first of all, thanks for the great tool. I really like Zabbix and think it is the best monitoring solution. I use it a lot, but I never tried to set it up as a high availability cluster.

        We are using a loadbalancer for creating clusters, so the database and the GUI should be no problem. But how about the zabbix-server itself? How do I tell the second node to take over the gathering, if the master node is offline?

        My setup so far:

        my /etc/hosts on all servers:
        Code:
        127.0.0.1       localhost
        192.168.4.220   zabbixdb
        192.168.4.221   zabbix1
        192.168.4.222   zabbix2
        192.168.4.180   failover
        my /etc/zabbix/web/zabbix.conf.php on both nodes:
        Code:
        <?php
        // Zabbix GUI configuration file
        global $DB;
        
        $DB['TYPE']     = 'MYSQL';
        $DB['SERVER']   = 'zabbixdb';
        $DB['PORT']     = '0';
        $DB['DATABASE'] = 'zabbix';
        $DB['USER']     = 'zabbix';
        $DB['PASSWORD'] = 'supersecurepassword';
        
        // SCHEMA is relevant only for IBM_DB2 database
        $DB['SCHEMA'] = '';
        
        $ZBX_SERVER      = 'failover';
        $ZBX_SERVER_PORT = '10051';
        $ZBX_SERVER_NAME = 'Zabbix 2.2 Failover';
        
        $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
        ?>
        my /etc/zabbix/zabbix_server.conf on both nodes (NodeID & IP is changed):
        Code:
        # This is a configuration file for Zabbix Server process
        # To get more information about Zabbix,
        # visit http://www.zabbix.com
        
        ############ GENERAL PARAMETERS #################
        
        ### Option: NodeID
        #       Unique NodeID in distributed setup.
        #       0 - standalone server
        #
        # Mandatory: no
        # Range: 0-999
        # Default:
        NodeID=1
        
        ### Option: ListenPort
        #       Listen port for trapper.
        #
        # Mandatory: no
        # Range: 1024-32767
        # Default:
        ListenPort=10051
        
        ### Option: SourceIP
        #       Source IP address for outgoing connections.
        #
        # Mandatory: no
        # Default:
        SourceIP=192.168.4.221
        
        ### Option: LogFile
        #       Name of log file.
        #       If not set, syslog is used.
        #
        # Mandatory: no
        # Default:
        # LogFile=
        
        LogFile=/var/log/zabbix/zabbix_server.log
        
        ### Option: LogFileSize
        #       Maximum size of log file in MB.
        #       0 - disable automatic log rotation.
        #
        # Mandatory: no
        # Range: 0-1024
        # Default:
        # LogFileSize=1
        
        LogFileSize=0
        
        ### Option: DebugLevel
        #       Specifies debug level
        #       0 - no debug
        #       1 - critical information
        #       2 - error information
        #       3 - warnings
        #       4 - for debugging (produces lots of information)
        #
        # Mandatory: no
        # Range: 0-4
        # Default:
        # DebugLevel=3
        
        ### Option: PidFile
        #       Name of PID file.
        #
        # Mandatory: no
        # Default:
        # PidFile=/tmp/zabbix_server.pid
        
        PidFile=/var/run/zabbix/zabbix_server.pid
        
        ### Option: DBHost
        #       Database host name.
        #       If set to localhost, socket is used for MySQL.
        #       If set to empty string, socket is used for PostgreSQL.
        #
        # Mandatory: no
        # Default:
        # DBHost=localhost
        
        DBHost=zabbixdb
        
        ### Option: DBName
        #       Database name.
        #       For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
        #
        # Mandatory: yes
        # Default:
        # DBName=
        
        DBName=zabbix
        
        ### Option: DBSchema
        #       Schema name. Used for IBM DB2.
        #
        # Mandatory: no
        # Default:
        # DBSchema=
        
        ### Option: DBUser
        #       Database user. Ignored for SQLite.
        #
        # Mandatory: no
        # Default:
        # DBUser=
        
        DBUser=zabbix
        
        ### Option: DBPassword
        #       Database password. Ignored for SQLite.
        #       Comment this line if no password is used.
        #
        # Mandatory: no
        # Default:
        # DBPassword=
        
        DBPassword=supersecurepassword
        
        ### Option: DBSocket
        #       Path to MySQL socket.
        #
        # Mandatory: no
        # Default:
        # DBSocket=/tmp/mysql.sock
        
        DBSocket=/var/run/mysqld/mysqld.sock
        
        ### Option: DBPort
        #       Database port when not using local socket. Ignored for SQLite.
        #
        # Mandatory: no
        # Range: 1024-65535
        # Default (for MySQL):
        # DBPort=3306
        I added node with "sudo zabbix_server -n 1 -c /etc/zabbix/zabbix_server.conf" and then added zabbix2 as node 2 via the GUI.

        How does zabbix2 knows, when it has to start monitoring? Right now I get no values anymore, when I turn of zabbix1.

        Thanks,
        Phil

        Comment

        Working...