Keepalived : प्रक्रियाओं की निगरानी करें2024/07/23 |
Keepalived के साथ प्रक्रियाओं की निगरानी। यह उदाहरण निम्न प्रकार से पर्यावरण पर आधारित है। VIP:10.0.0.30 +----------------------+ | +----------------------+ | [node01.srv.world] |10.0.0.51 | 10.0.0.52| [node02.srv.world] | | Keepalived#1 +----------+----------+ Keepalived#2 | | | | | +----------------------+ +----------------------+ |
[1] | |
[2] | उदाहरण के लिए, बुनियादी Keepalived सेटिंग्स के अलावा, sshd प्रक्रिया की निगरानी के लिए सेटिंग्स जोड़ें। |
root@node01:~#
vi /etc/keepalived/keepalived.conf global_defs { router_id node01 notification_email { root@localhost } notification_email_from root@node01.srv.world smtp_server localhost smtp_connect_timeout 30 } # sshd प्रक्रिया के लिए मॉनिटरिंग सेटिंग जोड़ें vrrp_track_process track_sshd { process sshd delay 1 } vrrp_instance VRRP1 { state MASTER # nopreempt interface enp1s0 virtual_router_id 101 priority 200 advert_int 1 virtual_ipaddress { 10.0.0.30/24 } # जोड़ना track_process { track_sshd } smtp_alert }root@node01:~# systemctl restart keepalived
|
[3] | ठीक है। sshd डाउन होने पर फ़ेलओवर और फ़ेलबैक सत्यापित करें। |
# प्राथमिक नोड root@node01:~# ip address show enp1s0 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 52:54:00:1e:27:13 brd ff:ff:ff:ff:ff:ff inet 10.0.0.51/24 brd 10.0.0.255 scope global enp1s0 valid_lft forever preferred_lft forever inet 10.0.0.30/24 scope global secondary enp1s0 valid_lft forever preferred_lft forever inet6 fe80::5054:ff:fe1e:2713/64 scope link valid_lft forever preferred_lft foreverroot@node01:~# systemctl stop ssh root@node01:~# ip address show enp1s0 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 52:54:00:1e:27:13 brd ff:ff:ff:ff:ff:ff inet 10.0.0.51/24 brd 10.0.0.255 scope global enp1s0 valid_lft forever preferred_lft forever inet6 fe80::5054:ff:fe1e:2713/64 scope link valid_lft forever preferred_lft foreverroot@node01:~# ssh ubuntu@node02 "ip address show enp1s0" ubuntu@node02's password: 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 52:54:00:4c:63:11 brd ff:ff:ff:ff:ff:ff inet 10.0.0.52/24 brd 10.0.0.255 scope global enp1s0 valid_lft forever preferred_lft forever inet 10.0.0.30/24 scope global secondary enp1s0 valid_lft forever preferred_lft forever inet6 fe80::5054:ff:fe4c:6311/64 scope link valid_lft forever preferred_lft forever |
Sponsored Link |
|