diff --git a/KeepAliveD_config/KPAVD-VM-1.conf b/KeepAliveD_config/KPAVD-VM-1.conf new file mode 100644 index 0000000..325a984 --- /dev/null +++ b/KeepAliveD_config/KPAVD-VM-1.conf @@ -0,0 +1,33 @@ +vrrp_script track_npm { + script "/etc/keepalived/check_docker_container.sh " + interval 5 + fall 1 + rise 30 +} + +vrrp_instance NPM-V1 { + state MASTER + interface eth0 + virtual_router_id 40 + priority 100 + advert_int 1 + + unicast_src_ip + unicast_peer { + + } + + authentication { + auth_type PASS + auth_pass + } + + virtual_ipaddress { + / + } + + track_script { + track_npm + } + +} diff --git a/KeepAliveD_config/KPAVD-VM-2.conf b/KeepAliveD_config/KPAVD-VM-2.conf new file mode 100644 index 0000000..da13047 --- /dev/null +++ b/KeepAliveD_config/KPAVD-VM-2.conf @@ -0,0 +1,33 @@ +vrrp_script track_npm { + script "/etc/keepalived/check_docker_container.sh " + interval 5 + fall 1 + rise 30 +} + +vrrp_instance NPM-V1 { + state BACKUP + interface eth0 + virtual_router_id 40 + priority 10 + advert_int 1 + + unicast_src_ip + unicast_peer { + + } + + authentication { + auth_type PASS + auth_pass + } + + virtual_ipaddress { + / + } + + track_script { + track_npm + } + +} diff --git a/KeepAliveD_config/KPAVD-VM-3.conf b/KeepAliveD_config/KPAVD-VM-3.conf new file mode 100644 index 0000000..3a329bb --- /dev/null +++ b/KeepAliveD_config/KPAVD-VM-3.conf @@ -0,0 +1,33 @@ +vrrp_script track_npm { + script "/etc/keepalived/check_docker_container.sh " + interval 5 + fall 1 + rise 30 +} + +vrrp_instance NPM-V1 { + state BACKUP + interface eth0 + virtual_router_id 40 + priority 11 + advert_int 1 + + unicast_src_ip + unicast_peer { + + } + + authentication { + auth_type PASS + auth_pass + } + + virtual_ipaddress { + / + } + + track_script { + track_npm + } + +} diff --git a/NPM-TEST/check_docker_container.sh b/KeepAliveD_config/check_docker_container.sh similarity index 100% rename from NPM-TEST/check_docker_container.sh rename to KeepAliveD_config/check_docker_container.sh diff --git a/NPM-TEST/rsync_between_nodes.sh b/KeepAliveD_config/rsync_between_nodes.sh similarity index 89% rename from NPM-TEST/rsync_between_nodes.sh rename to KeepAliveD_config/rsync_between_nodes.sh index ea6c705..6f33899 100644 --- a/NPM-TEST/rsync_between_nodes.sh +++ b/KeepAliveD_config/rsync_between_nodes.sh @@ -17,19 +17,17 @@ rsync_npmz () { # $1 == local_username input # $2 == remote_username input - # NODE-2 - rsync -avru /home/$1/npm/ $2@192.168.25.15:/home/$2/npm/ + # NODE-1 + rsync -avru /home/$1/npm/ $2@:/home/$2/npm/ - # NODE-3 - rsync -avru /home/$1/npm/ $2@192.168.25.17:/home/$2/npm/ + # NODE-2 + rsync -avru /home/$1/npm/ $2@:/home/$2/npm/ } # DEF VARIABLE NAMES container_name=$1 - local_username=$2 - remote_username=$3 state_restarting=$(sudo docker inspect --format="{{.State.Restarting}}" "$container_name") diff --git a/NPM-TEST/KPAVD-VM-1.conf b/NPM-TEST/KPAVD-VM-1.conf deleted file mode 100644 index ff978b0..0000000 --- a/NPM-TEST/KPAVD-VM-1.conf +++ /dev/null @@ -1,58 +0,0 @@ -vrrp_script track_npm { - script "/etc/keepalived/check_docker_container.sh yuru_app_1" - interval 5 - fall 1 - rise 30 -} - -vrrp_instance TEST-NPM-V1 { - state MASTER - interface eth0 - virtual_router_id 40 - priority 100 - advert_int 1 - - unicast_src_ip 192.168.1.130 - unicast_peer { - 192.168.1.131 - 192.168.1.132 - } - - authentication { - auth_type PASS - auth_pass Loli6969 - } - - virtual_ipaddress { - 192.168.1.125/24 - } - - track_script { - track_npm - } - -} - -virtual_server 192.168.1.125 80 { - delay_loop 6 - lb_algo rr - lb_kind NAT - protocol TCP - - real_server 192.168.1.130 80 { - TCP_CHECK { - connect_timeout 10 - } - } - real_server 192.168.1.131 80 { - TCP_CHECK { - connect_timeout 10 - } - } - real_server 192.168.1.132 80 { - TCP_CHECK { - connect_timeout 10 - } - } - -} diff --git a/NPM-TEST/KPAVD-VM-2.conf b/NPM-TEST/KPAVD-VM-2.conf deleted file mode 100644 index 26ad694..0000000 --- a/NPM-TEST/KPAVD-VM-2.conf +++ /dev/null @@ -1,58 +0,0 @@ -vrrp_script track_npm { - script "/etc/keepalived/check_docker_container.sh npm" - interval 5 - fall 1 - rise 30 -} - -vrrp_instance TEST-NPM-V1 { - state BACKUP - interface eth0 - virtual_router_id 40 - priority 10 - advert_int 1 - - unicast_src_ip 192.168.1.131 - unicast_peer { - 192.168.1.130 - 192.168.1.132 - } - - authentication { - auth_type PASS - auth_pass Loli6969 - } - - virtual_ipaddress { - 192.168.1.125/24 - } - - track_script { - track_npm - } - -} - -virtual_server 192.168.1.125 80 { - delay_loop 6 - lb_algo rr - lb_kind NAT - protocol TCP - - real_server 192.168.1.130 80 { - TCP_CHECK { - connect_timeout 10 - } - } - real_server 192.168.1.131 80 { - TCP_CHECK { - connect_timeout 10 - } - } - real_server 192.168.1.132 80 { - TCP_CHECK { - connect_timeout 10 - } - } - -} diff --git a/NPM-TEST/KPAVD-VM-3.conf b/NPM-TEST/KPAVD-VM-3.conf deleted file mode 100644 index 1683ea9..0000000 --- a/NPM-TEST/KPAVD-VM-3.conf +++ /dev/null @@ -1,58 +0,0 @@ -vrrp_script track_npm { - script "/etc/keepalived/check_docker_container.sh npm" - interval 5 - fall 1 - rise 30 -} - -vrrp_instance TEST-NPM-V1 { - state BACKUP - interface eth0 - virtual_router_id 40 - priority 11 - advert_int 1 - - unicast_src_ip 192.168.1.132 - unicast_peer { - 192.168.1.130 - 192.168.1.131 - } - - authentication { - auth_type PASS - auth_pass Loli6969 - } - - virtual_ipaddress { - 192.168.1.125/24 - } - - track_script { - track_npm - } - -} - -virtual_server 192.168.1.125 80 { - delay_loop 6 - lb_algo rr - lb_kind NAT - protocol TCP - - real_server 192.168.1.130 80 { - TCP_CHECK { - connect_timeout 10 - } - } - real_server 192.168.1.131 80 { - TCP_CHECK { - connect_timeout 10 - } - } - real_server 192.168.1.132 80 { - TCP_CHECK { - connect_timeout 10 - } - } - -} diff --git a/NPM-TEST/KPAVD-VM-LOAD-BALANCING.conf b/NPM-TEST/KPAVD-VM-LOAD-BALANCING.conf deleted file mode 100644 index b3b710e..0000000 --- a/NPM-TEST/KPAVD-VM-LOAD-BALANCING.conf +++ /dev/null @@ -1,24 +0,0 @@ - -virtual_server 192.168.1.125 443 { - delay_loop 6 - lb_algo rr - lb_kind NAT - protocol TCP - - real_server 192.168.1.130 443 { - TCP_CHECK { - connect_timeout 10 - } - } - real_server 192.168.1.131 443 { - TCP_CHECK { - connect_timeout 10 - } - } - real_server 192.168.1.132 443 { - TCP_CHECK { - connect_timeout 10 - } - } - -} diff --git a/README.md b/README.md index f19eb07..30b6006 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # Nginx-Proxy-Manager-KeepAliveD KeepAliveD with NPM for a HA cluster + +