当前位置:网站首页>Implementation of grayscale publishing with haproxy
Implementation of grayscale publishing with haproxy
2022-07-28 18:53:00 【Water and moon are clear and bright】
haproxy To achieve gray Publishing
scene : be based on header The head of the depart Grayscale publishing of field information
global # Setting of global parameters
log 127.0.0.1 local2 # log grammar :log <address_1>[max_level_1] # Global log configuration , Use log keyword ,
Specify the use of 127.0.0.1
Upper syslog In service local0 Log devices , The logging level is info Log
chroot /usr/local/haproxy # Change the current working directory
pidfile /var/run/haproxy.pid # The current process id file
maxconn 4000 # maximum connection
user haproxy # Users
group haproxy # Subordinate to the group
nbproc 8
cpu-map 1 0
cpu-map 2 1
cpu-map 3 2
cpu-map 4 3
cpu-map 5 4
cpu-map 6 5
cpu-map 7 6
cpu-map 8 7
daemon # Run as a daemons haproxy
stats socket /var/lib/haproxy/stats
defaults
mode http # Default mode mode { tcp|http|health },tcp yes 4 layer ,http yes 7 layer ,health Will only return OK
log global # Apply global log configuration
option httplog # Enable logging HTTP request , Default haproxy Logging is not logging HTTP Request log
option dontlognull # Enable this , Empty connections will not be logged . An empty connection is a load balancer upstream Or monitoring system to detect the Whether the service is available or not , You need to connect regularly or get some
A fixed component or page , Or detect whether the scanning port is monitored Actions such as listening or opening are called empty connections ;
The official document says , If there is no other load balancer upstream of the service , Suggest Do not use
This parameter , Because malicious scanning or other actions on the Internet will not be recorded
option http-server-close # Close after each request http passageway
option forwardfor except 127.0.0.0/8 # If the application on the server wants to record the IP Address , Need to be in HAProxy
On Configure this option , such HAProxy Will put the client IP The message is sent to the server , stay HTTP
Add in request "X-Forwarded-For" word paragraph . Enable X-Forwarded-For, stay requests
The head is inserted into the client IP Sent to the back end server, Make the back end server a Get the real of the client IP.
option redispatch # When using the cookie when ,haproxy The back-end server that will send its request to serverID Insert into
cookie in , In order to make sure The session SESSION persistence ; And then , If the back-end server goes down
了 , But on the client side cookie Will not refresh Of , If this parameter is set , Will send the customer's request
Force direction to another back end server On , To ensure the normal service .
retries 3 # Defines the number of failed reconnections to the backend server , If the number of connection failures exceeds this value, the corresponding backend
Server marked as unavailable
timeout http-request 10s #http Request timeout
timeout queue 1m # The timeout of a request in the queue
timeout connect 10s # Connection timeout
timeout client 1m # Client timeout
timeout server 1m # Server side timeout
timeout http-keep-alive 10s # Set up http-keep-alive Timeout for
timeout check 10s # Detection timeout
maxconn 3000 # The maximum number of connections available per process
listen status
bind 0.0.0.0:1080
mode http
log global
stats refresh 30s
stts uri /admin?stats
stats realm Private lands
stats auth admin:[email protected]
stats hide-version
frontend http_443_in
bind *:443 ssl crt /etc/haproxy/cert.pem
mode http
#-----------#
#acl list
acl pipeline hdr_reg(host) -i ^(www.test.com)(:443)?$
#acl gray user config
acl test_user_tag hdr_reg(x-user-name) -i ^(jdtw00000)
#acl gay depart config
acl test_depart_tag hdr_reg(depart) -i ^(ASDFSEWW51235LJL145)$
#userbackend gray user list
#use_backend backend_pipeline_test if pipeline pipeline_user_tag
#userbackend gray depart list
#use_backend backend_pipeline_test if pipeline test_depart_tag
#usebackend list
use_backend backend_pipeline if pipeline
#___________---
backend backend_pipeline
mode http
balacne roundrobin
option forwardfor
option httpchk GET /cd-test/v2/healthcheck
server test_svr_a01 12.0.2.4:8443 ssl check verify none check inter 5000 rise 2 fall 3
server test_svr_b01 12.0.2.80:8443 ssl check verify none check inter 5000 rise 2 fall 3
backend backend_pipeline_test
mode http
balacne roundrobin # Load balancing algorithm
option forwardfor
option httpchk GET /cd-test/v2/healthcheck
#server test_test_svr_a01 12.0.2.4:8443 ssl check verify none check inter 5000 rise 2 fall 3
#server test_test_svr_b01 12.0.2.80:8443 ssl check verify none check inter 5000 rise 2 fall 3
边栏推荐
- CTR click through rate prediction practice project of advertising recommendation!
- What if you don't understand the difference between modularity, componentization and plug-in?
- kotlin:out in
- 2022.7.26 constructor, interview: the role of new, deep copy and shallow copy
- How does Xiaobai learn software testing with zero foundation?
- LeetCode_63_不同路径Ⅱ
- What kind of knowledge payment system functions are more conducive to the development of the platform and lecturers?
- 真正的 HTAP 对用户和开发者意味着什么?
- [GXYCTF2019]StrongestMind
- LeetCode_ 96_ Different binary search trees
猜你喜欢

Cause analysis and solution of video jam after easycvr is connected to the device

我的创作纪念日 -- 2022年7月25日

SwiftUI 组件之如何实现电话号码掩码隐藏部分的文本字段TextField(教程含源码)

记录自己在厦门两年来的面试经历--完结篇

EasyCVR新版本级联时,下级平台向上传递层级目录显示不全的原因分析

Getting started with gateway

什么样的知识付费系统功能,更有利于平台与讲师发展?

真正的 HTAP 对用户和开发者意味着什么?

Go concurrency one

“讳疾忌医”的开源走不远
随机推荐
jvm调优
Ue5 gas learning notes 0.2 configuration plug-in
MYSQL入门与进阶(七)
“讳疾忌医”的开源走不远
行业落地呈现新进展 | 2022开放原子全球开源峰会OpenAtom OpenHarmony分论坛圆满召开
Golang concurrency model
零知识证明:具有DDH假设的 ZKP
十进制转二进制进阶版(可转化负数以及边界值)
[actual combat] realize page distortion correction with OpenCV
Full analysis of warehouse building on the lake: how to build a lake warehouse integrated data platform | deepnova technology collection series open class phase IV
2022年中国企业服务产业市场行情
什么样的知识付费系统功能,更有利于平台与讲师发展?
How to see the future development of software testing?
408复习策略(强化阶段)
MySQL index usage and optimization
Go concurrency one
408 review strategy (strengthening stage)
When the new version of easycvr is linked at the same level, the subordinate platform passes up the cause analysis of the incomplete display of the hierarchical directory
1.1. Sparse array
jvm四种引用类型