Zevenet Community Edition v.5.0およびV.5.9でクラスターを設定する方法

投稿日: 23 年 2018 月 XNUMX 日


Zevenet Cluster Serviceは、Zevenet CEコアパッケージの外部にある独立したソフトウェアのように設定できます。この新しいZevenetクラスタサービスは、あらゆるネットワークアーキテクチャのニーズに適応するために、システム管理者によって容易に管理および変更されるというアイデアで開発されました。 。
次の手順では、Load Balancerの高可用性が必要な場合にZevenet Clusterをインストールおよび設定する方法について説明します。

次のように公式のAPTリポジトリを設定します。

ZEVENET Community EditionのAPTリポジトリを構成する方法

Zevenet CEクラスタパッケージをインストールする

ローカルデータベースリポジトリが更新されたら、次のようにクラスターパッケージzevenet-ce-clusterを検索してください。

root@lb1 > apt-cache search zevenet-ce-cluster
zevenet-ce-cluster - Zevenet Load Balancer Community Edition Cluster Service

root@lb1 > apt-cache show zevenet-ce-cluster
Package: zevenet-ce-cluster
Version: 1.2
Maintainer: Zevenet SL <zevenet-ce-users@zevenet.com>
Architecture: i386
Depends: zevenet (>=5.0), liblinux-inotify2-perl, ntp
Priority: optional
Section: admin
Filename: pool/main/z/zevenet-ce-cluster/zevenet-ce-cluster_1.0_i386.deb
Size: 43350
SHA256: e39bb9b8283904db2873287147c885637178e179be5dee67b2c7044039899f35
SHA1: 425d742cde523c93a55b25e96447a8088663a028
MD5sum: 123abcf0eab334a18054802962287dc7
Description: Zevenet Load Balancer Community Edition Cluster Service
Cluster service for Zevenet CE, based in ucarp for vrrp implementation and zeninotify for configuration replication. VRRP through UDP is supported in this version.
Description-md5: 5b668a78c0d00cdf89ac66c47b44ba28

root@lb1 > apt-get install zevenet-ce-cluster
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  liblinux-inotify2-perl
Suggested packages:
  iwatch
The following NEW packages will be installed:
  liblinux-inotify2-perl zevenet-ce-cluster
0 upgraded, 2 newly installed, 0 to remove and 37 not upgraded.
Need to get 43.4 kB/61.4 kB of archives.
After this operation, 60.4 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://repo.zevenet.com/ce/v5 stretch/main i386 zevenet-ce-cluster i386 1.0 [43.4 kB]
Fetched 43.4 kB in 0s (57.3 kB/s)        
Selecting previously unselected package liblinux-inotify2-perl.
(Reading database ... 57851 files and directories currently installed.)
Preparing to unpack .../liblinux-inotify2-perl_1%3a1.22-3_i386.deb ...
Unpacking liblinux-inotify2-perl (1:1.22-3) ...
Selecting previously unselected package zevenet-ce-cluster.
Preparing to unpack .../zevenet-ce-cluster_1.0_i386.deb ...
Unpacking zevenet-ce-cluster (1.0) ...
Setting up liblinux-inotify2-perl (1:1.22-3) ...
Processing triggers for systemd (232-25+deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up zevenet-ce-cluster (1.0) ...
Completing the Zevenet CE Cluster installation...

Zevenet CEクラスタはVRRPを使用しており、このプロトコルでは同期時間が必須であるため、NTPサービスが正しく設定され、NTPサーバーがロードバランサから到達可能であることを確認してください。

Zevenet CEクラスタパッケージを設定する

インストールが完了したら、次のようにクラスタサービスを設定してください。

/usr/local/zevenet/app/ucarp/etc/zevenet-cluster.confのパスにある構成ファイルを開きます。

最も重要なパラメータについて次に説明します。

#interface used for the cluster where is configured local_ip and remote_ip
$interface="eth0";

#local IP to be monitored, i e 192.168.0.101
$local_ip="192.168.101.242";

#remote IP to be monitored, i e 192.168.0.102
$remote_ip="192.168.101.243";

#used password for vrrp protocol communication
$password="secret";

#unique value for vrrp cluster in the network
$cluster_id="1";

#used virtual IP in the cluster, this IP will run always in the master node
$cluster_ip="192.168.101.244";

# if the nic used for cluster is different to eth0 then please change the exclude conf file in following line
########
$exclude="--exclude if_eth0_conf";

仮想インターフェイスのみが複製されるため、複数のNICまたはVLANで実行している場合は、仮想インターフェイスのみをクラスタ設定ファイルで除外する必要があります。たとえば、eth0はクラスタ用に、vlan100(eth0.100)は負荷分散用に使用します。そして:

$exclude="--exclude if_eth0_conf --exclude if_eth0.100_conf";

zevenetクラスタはrootユーザーによって管理され、rsync(ssh)を介してマスターノードからバックアップに設定を複製するため、ノード間でパスワードなしのsshを設定する必要があります。

定義されていることに注意してください $ cluster_ip このノードでサービスが開始されるとすぐに、1つのZevenet仮想ロードバランサー、将来のマスターで設定してUPする必要があります。 $ cluster_ip バックアップサーバに自動的に複製されます。

次に、次のXNUMXつの手順でクラスターサービスを有効にします。

まず、ファイル/etc/init.d/zevenet-ce-clusterを開き、次の変数を変更します。

$enable_cluster="true";

次に、サービスzevenet-ce-clusterは起動後にデフォルトで無効になっています。次のコマンドを実行して、再起動後にzevenet-ce-clusterを有効にしてください。

[] root@lb1 > systemctl enable zevenet-ce-cluster

構成ファイル/usr/local/zevenet/app/ucarp/etc/zevenet-cluster.confを変更するには、クラスターサービスを再起動する必要があることを考慮してください。構成パラメーターが完了したら、両方のノードでクラスターを再起動してください。次のように:

[] root@lb1 > /etc/init.d/zevenet-ce-cluster stop
[] root@lb1 > /etc/init.d/zevenet-ce-cluster start

クラスタサービスが実行されるとすぐに、各サービスのクラスタステータスを表示するためにロードバランサーのプロンプトが変更されます。
マスター:

[master] root@lb1>

バックアップ:

[backup] root@lb2>

ログとトラブルシューティング

  1. 両方のクラスタノード間でパスワードなしのSSHが必要
  2. ntpは両方のクラスタノードで設定する必要があります
  3. Zeninotifyサービスはマスターノードでのみ実行されます。zeninotifyが実行されていることを次のコマンドで確認してください。マスターノードで次のようなものが表示されるはずです。
    [master] root@lb1> ps -ef | grep zeninotify
    root 16912 1 0 03:20 ? 00:00:00 /usr/bin/perl /usr/local/zevenet/app/zeninotify/zeninotify.pl
    

    そしてバックアップノードにはzeninotifyに関連するものは何もないはずです。

    [backup] root@lb2> ps -ef | grep zeninotify
    [backup] root@lb2>
    

     

  4. ucarpサービスのログはsyslog / var / log / syslogに送信されます。
  5. zeninotifyレプリケーションサービスのログは/var/log/zeninotify.logに送信されます。
  6. クラスターステータスはプロンプトに表示され、コマンドの実行後に更新されます。さらに、クラスターステータスは構成ファイル/etc/zevenet-ce-cluster.statusに保存されます。このファイルが存在しない場合、クラスターサービスは停止します。
  7. クラスタノードがMASTERに昇格した瞬間に、次のスクリプトが実行されます。/ usr / local / zevenet / app / ucarp / sbin / zevenet-ce-cluster-start
  8. クラスタノードがBACKUPに昇格した瞬間に、次のスクリプトが実行されます。/ usr / local / zevenet / app / ucarp / sbin / zevenet-ce-cluster-stop
  9. クラスタノードが提供情報を実行する必要がある時点で、次のスクリプトが実行されます。/ usr / local / zevenet / app / ucarp / sbin / zevenet-ce-cluster-advertising
  10. ucarpの実行でパラメータを変更する必要がある場合は、スクリプト/etc/init.d/zevenet-ce-cluster subrutine run_cluster()でucarpの実行関数を変更できます。
  11. クラスタサービスはVRRP実装を使用するため、マルチキャストパッケージをスイッチで許可する必要があります
上の共有:

GNU Free Documentation Licenseの条項に基づくドキュメンテーション。

この記事は役に立ちましたか?

関連記事