16
loading...
This website collects cookies to deliver better user experience
Keepalived
for master-master usage. sudo apt-get install keepalived
cd /etc/keepalived
vim keepalived.conf
# ----- vim keepalived.conf -----
vrrp_instance machineOne {
state MASTER
nopreempt # preempt = get back the master position when recovers, nopreempt = stay in backup position when recovers (dual-master setting)
interface eno1 # interface
virtual_router_id 101
priority 101 # same priority to make sure both machines are master
advert_int 1 # interval between advertisements
authentication {
auth_type PASS
auth_pass abcdefg
}
virtual_ipaddress { # virtual IP
192.168.29.11
}
}
# ----- vim keepalived.conf -----
sudo apt-get install keepalived
cd /etc/keepalived
vim keepalived.conf
# ----- vim keepalived.conf -----
vrrp_instance esl35 {
state MASTER
nopreempt
interface eno1
virtual_router_id 101
priority 101
advert_int 1
authentication {
auth_type PASS
auth_pass abcdefg
}
virtual_ipaddress {
192.168.29.11
}
}
# ----- vim keepalived.conf -----
keepalived
service, we need to make sure that the SSH key files are the two machines are the same if master-master VRRP approach is adopted. This will avoid conflicts between machines.# In any one of the machine
# e.g. 192.168.29.10
cd /etc/ssh
ls
# ----- ls -----
#moduli sshd_config ssh_host_dsa_key.pub ssh_host_ed25519_key ssh_host_rsa_key.pub
#ssh_config sshd_config.d ssh_host_ecdsa_key ssh_host_ed25519_key.pub ssh_import_id
#ssh_config.d ssh_host_dsa_key ssh_host_ecdsa_key.pub ssh_host_rsa_key
# ----- ls -----
# syncing all those files to another machine
# account@server-ip should be like [email protected]
rsync ./* < account@server-ip >:/etc/ssh
rVRRPd
, but I could not find sufficient resources that could help me set that up successfully. If you do know how to make it working, please comment below no matter how ancient this sharing has become. 16