-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall keepalived
47 lines (40 loc) · 1.2 KB
/
install keepalived
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
yum install -y gcc kernel-headers kernel-devel
yum install -y keepalived
/etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
sysadmin@mydomain.com
support@mydomain.com
}
notification_email_from srv@mydomain.com
smtp_server localhost
smtp_connect_timeout 30
}
vrrp_instance VI_1 {
state MASTER
interface ens160
virtual_router_id 51
priority 101 #priorité 101 pour le master et 100 pour les autres
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
172.16.1.40
}
}
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
systemctl start keepalived
systemctl enable keepalived
ip addr show ens160
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:0c:29:1c:2c:8a brd ff:ff:ff:ff:ff:ff
inet 172.16.1.31/24 brd 172.16.1.255 scope global dynamic ens160
valid_lft 5438sec preferred_lft 5438sec
inet 172.16.1.40/32 scope global ens160
valid_lft forever preferred_lft forever
inet6 fe80::9469:27ec:25a5:5683/64 scope link
valid_lft forever preferred_lft forever