Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

136 wiersze
4.0 KiB

  1. global
  2. log /dev/log local0
  3. log /dev/log local1 notice
  4. chroot /var/lib/haproxy
  5. stats socket /run/haproxy/admin.sock mode 660 level admin
  6. stats timeout 30s
  7. user haproxy
  8. group haproxy
  9. daemon
  10. # Default SSL material locations
  11. ca-base /etc/ssl/certs
  12. crt-base /etc/ssl/private
  13. # See: https://ssl-config.mozilla.org/#server=haproxy&server-version=2.0.3&config=intermediate
  14. ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
  15. ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
  16. ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
  17. defaults
  18. log global
  19. mode http
  20. option httplog
  21. option dontlognull
  22. timeout connect 5000
  23. timeout client 50000
  24. timeout server 50000
  25. errorfile 400 /etc/haproxy/errors/400.http
  26. errorfile 403 /etc/haproxy/errors/403.http
  27. errorfile 408 /etc/haproxy/errors/408.http
  28. errorfile 500 /etc/haproxy/errors/500.http
  29. errorfile 502 /etc/haproxy/errors/502.http
  30. errorfile 503 /etc/haproxy/errors/503.http
  31. errorfile 504 /etc/haproxy/errors/504.http
  32. listen stats
  33. bind *:8404 # 監控頁面 Port
  34. stats enable
  35. stats uri /stats # 網址路徑
  36. stats refresh 10s # 刷新頻率
  37. stats auth admin:password # 登入帳號:密碼 (請自行修改)
  38. frontend kubernetes-api
  39. bind *:6444
  40. mode tcp
  41. option tcplog
  42. default_backend k8s_masters
  43. backend k8s_masters
  44. mode tcp
  45. option tcp-check
  46. balance roundrobin
  47. # 若要更 aggressive 的健康檢查,可加:
  48. # tcp-check connect port 6443
  49. server master-A 10.10.0.85:6443 check fall 3 rise 2
  50. server master-B 10.10.0.87:6443 check fall 3 rise 2
  51. server master-C 10.10.0.89:6443 check fall 3 rise 2
  52. frontend postgres_rw
  53. bind *:5000
  54. mode tcp
  55. option tcplog
  56. default_backend backend_rw
  57. backend backend_rw
  58. mode tcp
  59. option httpchk GET /primary
  60. http-check expect status 200
  61. server f01 10.10.0.85:5432 check port 8008
  62. server f02 10.10.0.87:5432 check port 8008
  63. server f03 10.10.0.89:5432 check port 8008
  64. frontend postgres_ro
  65. bind *:5001
  66. mode tcp
  67. option tcplog
  68. default_backend backend_ro
  69. backend backend_ro
  70. mode tcp
  71. balance roundrobin
  72. option httpchk GET /read-only
  73. http-check expect status 200
  74. server f01 10.10.0.85:5432 check port 8008
  75. server f02 10.10.0.87:5432 check port 8008
  76. server f03 10.10.0.89:5432 check port 8008
  77. frontend airflow_web
  78. bind *:8080
  79. mode http
  80. option httplog
  81. default_backend airflow_web_nodes
  82. backend airflow_web_nodes
  83. mode http
  84. balance roundrobin
  85. option httpchk GET /api/v2/monitor/health
  86. http-check expect status 200
  87. # 永遠設定 proto
  88. http-request set-header X-Forwarded-Proto https if { ssl_fc }
  89. http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  90. http-request set-header X-Forwarded-For %[src]
  91. http-request set-header Host %[req.hdr(host)]
  92. server k8s-master-1 10.10.0.85:30080 check
  93. server k8s-master-2 10.10.0.87:30080 check
  94. server k8s-master-3 10.10.0.89:30080 check
  95. frontend doris_mysql
  96. bind *:9031
  97. default_backend doris_mysql_backend
  98. backend doris_mysql_backend
  99. balance roundrobin
  100. option tcp-check
  101. server fe1 10.10.0.85:9030 check
  102. server fe2 10.10.0.87:9030 check
  103. server fe3 10.10.0.89:9030 check
  104. frontend fe_rabbitmq_mgmt
  105. bind *:15672
  106. mode http
  107. default_backend be_rabbitmq_mgmt
  108. backend be_rabbitmq_mgmt
  109. mode http
  110. balance roundrobin
  111. option httpchk GET /
  112. http-check expect status 200
  113. # 換成你的 master node IP
  114. server master1 10.10.0.85:31672 check
  115. server master2 10.10.0.87:31672 check
  116. server master3 10.10.0.89:31672 check