In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
First, the basic knowledge of Keepalived dual-computer hot backup
Keepalived official website: www.keepalived.org/ can also be used as a hot backup software in non-LVS environments.
1. Keepalived action
Keepalived was originally a powerful auxiliary tool designed specifically for LVS, which is mainly used to provide failover and health check functions-to determine the availability of LVS load dispatchers and node servers, isolate and replace them with new servers in time, and rejoin the cluster when the failed host replies. If the LVS environment is deployed separately, if the scheduler goes down, the whole cluster will fail. After a web node goes down, the client will always be unable to access the web page. Therefore, the combination of keepalived and LVS can form a real high-availability cluster. Of course, the back-end shared storage must also build a highly available storage server, one of which can not be satisfied. Cannot be called a highly available cluster environment.
2. Hot backup mode of Keepalived
Keepalived adopts VRRP (Virtual routing redundancy Protocol) hot backup protocol to realize the multi-machine hot backup function of Linux server in the way of software. VRRP is a backup solution for routers-a hot backup group of routers that provides services through a shared virtual IP (VIP) address In each hot backup group, only one primary router provides services at the same time, and the other routers are in a redundant state. If the currently online router fails, the other routers will automatically replace (priority determines the replacement order) virtual IP address to continue to provide services.
Each router in the hot standby group may become the primary router, and the IP address (VIP) of the virtual router can be transferred in the hot standby group, so it is also known as the drift IP address. When using keepalived, the implementation of the drift address does not need to manually establish a virtual interface profile (such as ens32:0), but is automatically managed by keepalived according to the configuration file.
Second, use Keepalived to realize dual-computer hot backup.
Based on the hot backup method of VRRP, keepalived can be used for server failover, and each hot backup group can have multiple servers-the most commonly used is multi-machine hot backup. In this multi-machine hot backup scheme, the failover is mainly aimed at the drift of virtual IP addresses. Therefore, it can be applied to a variety of application servers (whether it is Web, FTP, Mail, SSH, DNS....).
The topology diagram is as follows:
1. Configure the primary server
The configuration directory for the Keepalived service is located in / etc/keepalived/. Where keepalived.conf is the main configuration file; there is also a subdirectory samples/, that provides many configuration samples for reference. In the configuration file of Keepalived, use the "global_defs {...}" section to specify global parameters, and use the "vrrp_instance instance name {...}" section to specify VRRP hot backup parameters. Note text with "!" The beginning of the symbol.
[root@centos04 ~] # systemctl stop firewalld [root@centos04 ~] # yum-y install ipvsadm keepalived [root@centos04 ~] # cp / etc/keepalived/keepalived.conf / etc/keepalived/keepalived.conf.bak [root@centos04 ~] # systemctl start keepalived [root@centos04 ~] # chkconfig-level 35 keepalived on [root@centos04 ~] # vim / etc/keepalived/keepalived.conf! Configuration File for keepalivedglobal_defs {router_id LVS_HA_Master} vrrp_instance VI_1 {state MASTER interface ens32 virtual_router_id 51 priority 100 advert_int 1 authentication {auth_type PASS auth _ pass 1111} virtual_ipaddress {192.168.100.253}}.
After confirming that the above configuration is correct, then start the keepalived service. The master server with the actual status of MASTER will automatically add the VIP address for the ens32 interface, which can be viewed by the ip command (Note: the ifconfig command is not visible).
[root@centos04 ~] # systemctl restart keepalived [root@centos04 ~] # ip a show dev ens32 ens32: valid_lft forever preferred_lft forever inet6 fe80::95f8:eeb7:2ed2:d13c/64 scope link noprefixroute valid_lft forever preferred_lft forever [root@centos05 ~] # yum-y install keepalived ipvsadm [root@centos05 ~] # scp root@192.168.100.40:/etc/keepalived/keepalived.conf/etc/keepalived/root@192.168.100.40 s password Keepalived.conf 3549 3.5MB/s 00:00 [root@centos05 ~] # vim / etc/keepalived/keepalived.conf global_defs {. Router_id LVS_DEVEL2.} .vrrp _ instance VI_1 {state BACKUP interface ens32 virtual_router_id 51 priority 90 advert_int 1 authentication {auth_type PASS auth_pass 1111} virtual _ ipaddress {192.168.100.253}}. [root@centos05 ~] # systemctl start keepalived [root@centos05 ~] # systemctl enable keepalivedens32: ens32: valid_lft forever preferred_lft forever inet6 fe80::3050:1a9b:5956:5297/64 scope link noprefixroute valid_lft forever preferred_lft foreverens32: valid_lft forever preferred_lft forever Inet6 fe80::95f8:eeb7:2ed2:d13c/64 scope link noprefixroute valid_lft forever preferred_lft forever [root@centos05 ~] # ip a show dev ens32 ens32:
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.