This is a translation of the original English documentation page. Help us make it better.

2 プロキシの負荷分散と高可用性

Overview

Proxy load balancing allows monitoring hosts by a proxy group with automated distribution of hosts between proxies and high proxy availability.

If one proxy from the proxy group goes offline, its hosts will be immediately distributed among other proxies having the least assigned hosts in the group.

Host redistribution happens only in "online" proxy groups. A proxy group is "online" if the configured minimum number of its proxies are online.

The proxy state is:

  • online - if there was communication with it for the failover delay period (passive proxy responded to server requests and active proxy sent a request to server);
  • offline - if there was no communication with it for the failover delay period;
  • unknown - after proxy creation or server start.

Zabbix server also checks the balance between host-proxy assignments. If the balance is bad the group is marked for host reassignment, which will be done after 10xfailover delay period unless the balance is restored. The group is considered to be unbalanced if the number of hosts assigned to a proxy differs from the average (within the group) by at least 10 hosts and factor of 2.

Note that older version proxies and the hosts monitored by these proxies are excluded from re-balancing operations until they are upgraded.

Host reassignment

Zabbix server checks the balance between host assignments to the proxies. The group is considered "out of balance" if there is:

  • host excess - a proxy has many more hosts than the group average;
  • host deficit - a proxy has far fewer hosts than the group average.

The group is considered "out of balance" if the number of hosts assigned to the proxy is above/below the group average by more than 10 and a factor of 2. In this case the group is marked by the server for host reassignment after the grace period (10 x failover delay), if the balance is not restored.

The following table illustrates with example numbers when host reassignment is (or is not) triggered:

Number of hosts on proxy Group average Host reassignment
>100 50 Yes
60 50 No
40 50 No
<25 50 Yes
>15 5 Yes
10 5 No

The proxy group manager will re-distribute hosts in proxy groups in the following way:

  • calculate the average number of proxies per host;
  • for proxies with host excess - move excess hosts to unassigned hosts;
  • for proxies with host deficit - calculate the number of hosts needed to balance proxies;
  • remove the missing number of hosts from proxies with most hosts;
  • distribute unassigned hosts between proxies with least hosts.

プロキシグループでZabbix Senderを使用する

入力ファイル内の異なるホストからの値をプロキシグループ内のプロキシに送信する場合は、-g オプションを使用して、一部の値が間違ったプロキシに送信されることを回避します。

Configuring proxy load balancing

To configure proxy load balancing for monitoring hosts:

  1. Create a proxy group (see "Configuring a proxy group" below).

  2. Make sure the proxy group is online.

  3. Configure that hosts are monitored by proxy group (not individual proxies). You may use host mass update to move hosts from proxy to the proxy group.

Hosts that are monitored by a single proxy (even if the proxy is part of proxy group) are not involved in load balancing/high availability at all.

  1. Wait a few seconds for configuration update and for host distribution among proxies in the proxy group. Observe the change by refreshing the host list in Monitoring -> Hosts.

Note that adding all proxies of the group to the ServerActive agent parameter of monitored hosts is beneficial, but not mandatory. Proxy load balancing will work even with a single proxy added to ServerActive - active checks (and Zabbix sender data requests) will be redirected to the correct online proxy for the host based on the current proxy-host assignment.

When a host is created based on auto registration/network discovery data from a proxy belonging to proxy group - then this host is set to be monitored by this proxy group.

制限事項
  • プロキシグループ内のプロキシでは、SNMPトラップはサポートされません。
  • 外部設定に依存するチェックは、プロキシグループ内のすべてのプロキシで同じ設定にする必要があります。これには以下が含まれます。
  • 外部チェック - スクリプト
  • データベースチェック - ODBC設定
  • "データベース監視"項目を使用する場合、DBオブジェクト/サーバーに拡張権限が必要です。
  • プロキシグループで監視する場合、VMwareホストはグループ内のプロキシ間でランダムに分散され、各プロキシがすべてのVMwareデータをキャッシュするため、vCenterへの負荷が増加します。
ファイアウォールで発生する可能性のある問題

エージェントは、ファイアウォールレベルですべてのプロキシに常にアクセスできるようにする必要があります。以下のシナリオを検討してください。

  • Zabbixエージェントのアクティブチェックにおいて、エージェント起動時に最初のプロキシが応答し、別のプロキシにリダイレクトします。もう一方のプロキシはファイアウォールの問題のためにアクセスできず、もう一方のプロキシの応答を待つ状態で通信が停止します。この状況の根本的な原因は、最初のプロキシがもう一方のプロキシが確実に正常であることを認識していたことです。最初のプロキシに障害が発生した場合、これは問題ではありません。その場合、最初のプロキシは"ServerActive"パラメータで設定された別のアドレスを試します。
  • HA設定は数ヶ月間安定しています。ホストの再バランス調整は行われておらず、必要ありません。エージェントは他のプロキシへの"バックアップ"チャネルを検証する必要はありません。フェイルオーバーシナリオでは、半年前にファイアウォールが変更されたために失敗する可能性があります。

プロキシグループの設定

Zabbix フロントエンドでプロキシグループを設定するには、以下の手順に従います。

  • 管理 → プロキシグループ へ移動します。
  • プロキシグループの作成 をクリックします。

パラメータ 説明
名前 プロキシグループ名を入力します。
フェイルオーバー間隔 フェイルオーバーを実行するまでの間隔を秒単位で入力します(デフォルトは1分、許容範囲は10秒~15分)。
時間サフィックスがサポートされています(例:30秒、1分)。
ユーザーマクロがサポートされています。
プロキシの最小数 グループをオンラインにするために必要なオンラインプロキシの最小数を入力します(デフォルトは1、許容範囲は1~1000)。
ユーザーマクロがサポートされています。
説明 プロキシグループの説明を入力します。
プロキシ グループ内のプロキシの一覧です。最大5つのプロキシを表示できます(プロキシへの権限に応じて、リンクまたはプレーンテキストで表示されます)。
既存のプロキシグループを編集する場合、グループ内に少なくとも1つのプロキシが存在すると、この一覧が表示されます。