Ad Widget

Collapse

Toggle between proxies

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jfuentes
    Junior Member
    • Jul 2015
    • 2

    #1

    Toggle between proxies

    Hello Zabbix folks - I've been playing around with proxy servers to get familiar with how they behave.

    For instance, I have two proxy servers in one of our data centers. I have updated a host's proxy_hostid on the main server via API so that I could switch back and forth between the two proxy servers. The host has both proxy server FQDN in its agent config file. I see the appropriate proxy server in the GUI after I issue the API update. This has mostly behaved in a predictable manner. I did encounter data loss however and I think that was because I either needed to restart the proxy service or "zabbix_proxy -R config_cache_reload" on the active proxy server.

    So I have a few questions:

    Is it sufficient to say:
    1. update proxy_hostid to use preferred proxy for hosts
    2. run "zabbix_proxy -R config_cache_reload" on the preferred proxy server
    and we're done?

    Is anybody doing this with SQL, like select all hosts with proxy_hostid XXXXX and update with proxy_hostid XXXXX? Care to share the update SQL or tell me which tables and columns need to be updated?

    Am I being naive to think that I could use this as a failover mechanism in the event of a proxy failure? Let's say the main server or another proxy detects that a proxy is down and that triggers either an SQL update or a REST API update on localhost(main server) so that all hosts use operational proxy server or should I just start digging into something like pacemaker?

    Can anybody else share similar experience without using actual HA software? If I have to use an HA product I will but I'd first like to see if I can keep this simple and do something like I have described.

    Thank you,
    Jim

    P.S. This is a proof of concept so if I can demonstrate some successful failover scenarios - i.e. no "hole in the graph" that will go a long way toward getting our company to switch to Zabbix.
  • jfuentes
    Junior Member
    • Jul 2015
    • 2

    #2
    Hopefully I'm not messing anything up by doing this - I looked at the schema and examined constraints, primary and foreign keys on the hosts table and looks like this should be OK:

    mysql -e"update hosts set proxy_hostid = '10273' where proxy_hostid = '10272'" -Dzabbix

    That's how I'm flipping back and forth between proxies then I run "/usr/sbin/zabbix_proxy -R config_cache_reload".

    Things mostly look OK but it took a long time, maybe 30 minutes or more, before the agents on monitored hosts showed up as "available"(status 1).

    Comment

    Working...