2017-09-27 06:56:57 +02:00
|
|
|
global_defs {
|
|
|
|
router_id haborlb
|
|
|
|
}
|
|
|
|
vrrp_sync_groups VG1 {
|
|
|
|
group {
|
|
|
|
VI_1
|
|
|
|
}
|
|
|
|
}
|
2018-01-23 10:25:48 +01:00
|
|
|
#Please change "ens160" to the interface name on you loadbalancer hosts.
|
|
|
|
#In some case it will be eth0, ens16xxx etc.
|
2017-09-27 06:56:57 +02:00
|
|
|
vrrp_instance VI_1 {
|
|
|
|
interface ens160
|
|
|
|
|
|
|
|
track_interface {
|
|
|
|
ens160
|
|
|
|
}
|
|
|
|
|
|
|
|
state MASTER
|
|
|
|
virtual_router_id 51
|
|
|
|
priority 10
|
|
|
|
|
|
|
|
virtual_ipaddress {
|
2018-01-23 10:25:48 +01:00
|
|
|
<change_to_VIP_address>/32
|
2017-09-27 06:56:57 +02:00
|
|
|
}
|
|
|
|
advert_int 1
|
|
|
|
authentication {
|
|
|
|
auth_type PASS
|
|
|
|
auth_pass d0cker
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2018-01-16 08:33:16 +01:00
|
|
|
########## Section for Harbor use HTTP protocol ######################
|
2018-01-23 10:25:48 +01:00
|
|
|
#Please change <change_to_VIP_address>, <harbor_node1_ip>, <harbor_node2_ip> to real ip address
|
|
|
|
virtual_server <change_to_VIP_address> 80 {
|
2017-09-27 06:56:57 +02:00
|
|
|
delay_loop 15
|
|
|
|
lb_algo rr
|
|
|
|
lb_kind DR
|
|
|
|
protocol TCP
|
|
|
|
nat_mask 255.255.255.0
|
|
|
|
persistence_timeout 10
|
|
|
|
|
2018-01-23 10:25:48 +01:00
|
|
|
real_server <harbor_node1_ip> 80 {
|
2017-09-27 06:56:57 +02:00
|
|
|
weight 10
|
2018-01-16 08:33:16 +01:00
|
|
|
MISC_CHECK {
|
2018-01-23 10:25:48 +01:00
|
|
|
misc_path "/usr/local/bin/check.sh <harbor_node1_ip>"
|
2018-01-16 08:33:16 +01:00
|
|
|
misc_timeout 5
|
2017-09-27 06:56:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-23 10:25:48 +01:00
|
|
|
real_server <harbor_node2_ip> 80 {
|
2017-09-27 06:56:57 +02:00
|
|
|
weight 10
|
2018-01-16 08:33:16 +01:00
|
|
|
MISC_CHECK {
|
2018-01-23 10:25:48 +01:00
|
|
|
misc_path "/usr/local/bin/check.sh <harbor_node2_ip>"
|
2018-01-16 08:33:16 +01:00
|
|
|
misc_timeout 5
|
2017-09-27 06:56:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-01-16 08:33:16 +01:00
|
|
|
|
|
|
|
#########################End of HTTP############################
|
|
|
|
|
|
|
|
##########################HTTPS#################################
|
2017-09-27 06:56:57 +02:00
|
|
|
#Please uncomment the follow when harbor running under https
|
2018-01-23 10:25:48 +01:00
|
|
|
#virtual_server <change_to_VIP_address> 443 {
|
2017-09-27 06:56:57 +02:00
|
|
|
# delay_loop 15
|
|
|
|
# lb_algo rr
|
|
|
|
# lb_kind DR
|
|
|
|
# protocol TCP
|
|
|
|
# nat_mask 255.255.255.0
|
|
|
|
# persistence_timeout 10
|
|
|
|
#
|
2018-01-23 10:25:48 +01:00
|
|
|
# real_server <harbor_node1_ip> 443 {
|
2017-09-27 06:56:57 +02:00
|
|
|
# weight 10
|
2018-01-16 08:33:16 +01:00
|
|
|
# MISC_CHECK {
|
2018-01-23 10:25:48 +01:00
|
|
|
# misc_path "/usr/local/bin/check.sh <harbor_node1_ip>"
|
2018-01-16 08:33:16 +01:00
|
|
|
# misc_timeout 5
|
2017-09-27 06:56:57 +02:00
|
|
|
# }
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# real_server harbor_node2_ip 443 {
|
|
|
|
# weight 10
|
2018-01-16 08:33:16 +01:00
|
|
|
# MISC_CHECK {
|
2018-01-23 10:25:48 +01:00
|
|
|
# misc_path "/usr/local/bin/check.sh <harbor_node2_ip>"
|
2018-01-16 08:33:16 +01:00
|
|
|
# misc_timeout 5
|
2017-09-27 06:56:57 +02:00
|
|
|
# }
|
|
|
|
# }
|
|
|
|
#}
|
2018-01-16 08:33:16 +01:00
|
|
|
#########################End of HTTPS Section#################
|