From a35f062b64f81918de03fc8157985593607fb094 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 19 Feb 2024 22:12:05 -0600 Subject: [PATCH] update --- nodemgmt-scripts.sh | 2 + templates/haproxy.config | 146 ------------------------------------- templates/keepalive.config | 32 -------- 3 files changed, 2 insertions(+), 178 deletions(-) delete mode 100755 templates/haproxy.config delete mode 100755 templates/keepalive.config diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index afdbee2d..e45dc65a 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -22,6 +22,8 @@ if [ "${1}" == "report" ] || [ "${2}" == "report" ] || [ "${3}" == "report" ]; t idsST=('') fi +# [ -f ${NM_BACKUP_FOLDER}/templates/*.config ] && rm -f ${NM_BACKUP_FOLDER}/templates/*.config + BACKUP(){ BACKUP_FOLDER=${NM_BACKUP_FOLDER}/node-backup/$(date +%m-%d-%y)/$(date +%H-%M-%S) diff --git a/templates/haproxy.config b/templates/haproxy.config deleted file mode 100755 index 43ab5396..00000000 --- a/templates/haproxy.config +++ /dev/null @@ -1,146 +0,0 @@ -global - pidfile /var/run/haproxy.pid - daemon - user haproxy - group haproxy - stats socket /var/run/haproxy.socket user haproxy group haproxy mode 600 level admin - node haproxy_%NIP% - description haproxy server - - #* Performance Tuning - maxconn 8192 - spread-checks 3 - quiet -defaults - #log global - mode tcp - option dontlognull - option tcp-smart-accept - option tcp-smart-connect - #option dontlog-normal - retries 3 - option redispatch - maxconn 8192 - timeout check 3500ms - timeout queue 3500ms - timeout connect 3500ms - timeout client 10800s - timeout server 10800s - - userlist STATSUSERS - group admin users admin - user admin insecure-password Dc$@1910 - user stats insecure-password Dc$@1910 - -listen admin_page - bind *:9600 - mode http - stats enable - stats refresh 60s - stats uri / - acl AuthOkay_ReadOnly http_auth(STATSUSERS) - acl AuthOkay_Admin http_auth_group(STATSUSERS) admin - stats http-request auth realm admin_page unless AuthOkay_ReadOnly - # stats admin if AuthOkay_Admin - -listen MySQL_3307_rw - bind *:3307 - mode tcp - timeout client 10800s - timeout server 10800s - tcp-check expect string is\ running - balance leastconn - option tcp-check - # option allbackups - default-server port 9200 inter 2s downinter 5s rise 3 fall 2 slowstart 60s maxconn 64 maxqueue 128 weight 100 - server 10.5.10.51 10.5.10.51:3306 check - server 10.5.10.52 10.5.10.52:3306 check backup - server 10.5.10.53 10.5.10.53:3306 check backup - - -listen MySQL_3308_ro - bind *:3308 - mode tcp - timeout client 10800s - timeout server 10800s - tcp-check expect string is\ running - balance leastconn - option tcp-check - # option allbackups - default-server port 9200 inter 2s downinter 5s rise 3 fall 2 slowstart 60s maxconn 64 maxqueue 128 weight 100 - server 10.5.10.51 10.5.10.51:3306 check - server 10.5.10.52 10.5.10.52:3306 check - server 10.5.10.53 10.5.10.53:3306 check backup - -listen NGINX_http - bind *:80 - mode tcp - timeout client 10800s - timeout server 10800s - # tcp-check expect string is\ running - balance leastconn - option tcp-check - # option allbackups - default-server port 9200 inter 2s downinter 5s rise 3 fall 2 slowstart 60s maxconn 64 maxqueue 128 weight 100 - cookie SERVERUSED insert indirect nocache - server 10.5.10.121 10.5.10.121:80 cookie s1 check port 80 send-proxy - server 10.5.10.122 10.5.10.122:80 cookie s2 check port 80 send-proxy - server 10.5.10.123 10.5.10.123:80 cookie s3 check port 80 send-proxy backup - -listen NGINX_https - bind *:443 - mode tcp - timeout client 10800s - timeout server 10800s - # tcp-check expect string is\ running - balance leastconn - option tcp-check - # option allbackups - default-server port 9200 inter 2s downinter 5s rise 3 fall 2 slowstart 60s maxconn 64 maxqueue 128 weight 100 - cookie SERVERUSED insert indirect nocache - server 10.5.10.121 10.5.10.121:443 cookie s1 check port 443 send-proxy - server 10.5.10.122 10.5.10.122:443 cookie s2 check port 443 send-proxy - server 10.5.10.123 10.5.10.123:443 cookie s3 check port 443 send-proxy backup - -listen Gitea - bind *:3000 - mode tcp - timeout client 10800s - timeout server 10800s - # tcp-check expect string is\ running - balance leastconn - option tcp-check - # option allbackups - default-server port 9200 inter 2s downinter 5s rise 3 fall 2 slowstart 60s maxconn 64 maxqueue 128 weight 100 - cookie SERVERUSED insert indirect nocache - server 10.5.10.121 10.5.10.121:3000 cookie s1 check port 3000 - server 10.5.10.122 10.5.10.122:3000 cookie s2 check port 3000 backup - server 10.5.10.123 10.5.10.123:3000 cookie s3 check port 3000 backup - -listen Nextcloud - bind *:3001 - mode tcp - timeout client 10800s - timeout server 10800s - # tcp-check expect string is\ running - balance leastconn - option tcp-check - # option allbackups - default-server port 9200 inter 2s downinter 5s rise 3 fall 2 slowstart 60s maxconn 64 maxqueue 128 weight 100 - cookie SERVERUSED insert indirect nocache - server 10.5.10.42 10.5.10.42:443 cookie s1 check port 443 send-proxy - server 10.5.10.43 10.5.10.43:443 cookie s2 check port 443 send-proxy backup - -listen Maxscale_rw - bind *:3309 - mode tcp - timeout client 10800s - timeout server 10800s - tcp-check expect string is\ running - balance leastconn - option tcp-check - # option allbackups - default-server port 9200 inter 2s downinter 5s rise 3 fall 2 slowstart 60s maxconn 64 maxqueue 128 weight 100 - server 10.5.10.51 10.5.10.51:4008 check - server 10.5.10.52 10.5.10.52:4008 check backup - # server 10.5.10.53 10.5.10.53:4008 check backup diff --git a/templates/keepalive.config b/templates/keepalive.config deleted file mode 100755 index 8fbe4206..00000000 --- a/templates/keepalive.config +++ /dev/null @@ -1,32 +0,0 @@ -#haproxy - You can add more types manually after this. - -vrrp_script chk_haproxy { - script "killall -0 haproxy" # verify the pid existance - interval 2 # check every 2 seconds - weight 2 # add 2 points of prio if OK -} -vrrp_instance VI_HAPROXY { - interface ens192 # interface to monitor - state MASTER - virtual_router_id 51 # Assign one ID for this route - priority 104 - unicast_src_ip 10.5.10.51 - unicast_peer { - 10.5.10.52 - 10.5.10.53 - 10.5.10.120 - 10.5.10.121 - - } - virtual_ipaddress { - 10.5.10.56 # the virtual IP - } - track_script { - chk_haproxy - } -# notify /usr/local/bin/notify_keepalived.sh -} - -# DO NOT REMOVE THE NEXT LINE -#@S9S_NEXT_SECTION@ -