Keepalived : ईमेल अधिसूचना सेट करें2024/07/23 |
फेलओवर या फेलबैक होने पर ईमेल अधिसूचना सेट करें। यह उदाहरण निम्न प्रकार से पर्यावरण पर आधारित है। VIP:10.0.0.30 +----------------------+ | +----------------------+ | [node01.srv.world] |10.0.0.51 | 10.0.0.52| [node02.srv.world] | | Keepalived#1 +----------+----------+ Keepalived#2 | | | | | +----------------------+ +----------------------+ |
[1] |
सभी नोड्स पर SMTP सर्वर स्थापित करें, यहां देखें। |
[2] | यहां जैसी बुनियादी Keepalived सेटिंग्स के अलावा, सभी नोड्स पर ईमेल अधिसूचना सेट करें। |
root@node01:~#
vi /etc/keepalived/keepalived.conf global_defs { router_id node01 # SMTP सेटिंग जोड़ें notification_email { root@localhost } notification_email_from root@node01.srv.world smtp_server localhost smtp_connect_timeout 30 } vrrp_instance VRRP1 { state MASTER # nopreempt interface enp1s0 virtual_router_id 101 priority 200 advert_int 1 virtual_ipaddress { 10.0.0.30/24 } # जोड़ना smtp_alert }root@node01:~# systemctl reload keepalived
|
[3] | ठीक है। ईमेल अधिसूचना सत्यापित करें। |
# नोड कि कुछ परेशानियां हुईं root@node01:~# mail "/var/mail/root": 1 message 1 new >N 1 root@node01.srv.wo Tue Jul 23 05:30 15/546 [node01] VRRP Instance VR ? 1 Return-Path: <root@node01.srv.world> X-Original-To: root@localhost Delivered-To: root@localhost Received: from node01.srv.world (localhost [127.0.0.1]) by node01.srv.world (Postfix) with SMTP id 5D92F161D3A for <root@localhost>; Tue, 23 Jul 2024 05:30:34 +0000 (UTC) Date: Tue, 23 Jul 2024 05:30:34 +0000 From: root@node01.srv.world Subject: [node01] VRRP Instance VRRP1 - Entering FAULT state X-Mailer: Keepalived To: root@localhost Message-Id: <20240723053034.5D92F161D3A@node01.srv.world> => VRRP Instance is no longer owning VRRP VIPs <= # बैकअप नोड root@node02:~# mail "/var/mail/root": 1 message 1 new >N 1 root@node02.srv.wo Tue Jul 23 05:30 15/541 [node02] VRRP Instance VR ? 1 Return-Path: <root@node02.srv.world> X-Original-To: root@localhost Delivered-To: root@localhost Received: from node02.srv.world (localhost [127.0.0.1]) by node02.srv.world (Postfix) with SMTP id 5AC46160D71 for <root@localhost>; Tue, 23 Jul 2024 05:30:37 +0000 (UTC) Date: Tue, 23 Jul 2024 05:30:37 +0000 From: root@node02.srv.world Subject: [node02] VRRP Instance VRRP1 - Entering MASTER state X-Mailer: Keepalived To: root@localhost Message-Id: <20240723053037.5AC46160D71@node02.srv.world> => VRRP Instance is now owning VRRP VIPs <= |
Sponsored Link |
|