InfoGrab Docs

데이터베이스 로드 밸런싱

데이터베이스 로드 밸런싱에 대해 설명합니다.

데이터베이스 로드 밸런싱을 사용하면 읽기 전용 쿼리를 여러 PostgreSQL 노드에 분산하여 성능을 향상시킬 수 있습니다. 이 기능은 GitLab Rails 및 Sidekiq에서 기본적으로 제공되며, 외부 의존성 없이 라운드 로빈 방식으로 데이터베이스 읽기 쿼리의 균형을 조정하도록 구성할 수 있습니다: PlantUML 다이어그램 (38줄) 소스 코드 보기 @startuml !theme plain card "**Internal Load Balancer**" as ilb skinparam linetype ortho together { collections " GitLab Rails x3" as gitlab collections " Sidekiq x4" as sidekiq } collections " Consul x3" as consul card "Database" as database { collections " PGBouncer x3 \n//Consul//" as pgbouncer card " PostgreSQL //Primary//\n//Patroni//\n//PgBouncer//\n//Consul//" as postgres_primary collections " PostgreSQL //Secondary// x2 \n//Patroni//\n//PgBouncer//\n//Consul//" as postgres_secondary pgbouncer --> postgres_primary postgres_primary .r-> postgres_secondary } gitlab --> ilb gitlab -[hidden]-> pgbouncer gitlab .[norank]-> postgres_primary gitlab .[norank]-> postgres_secondary sidekiq --> ilb sidekiq -[hidden]-> pgbouncer sidekiq .[norank]-> postgres_primary sidekiq .[norank]-> postgres_secondary ilb --> pgbouncer consul -r-> pgbouncer consul .[norank]r-> postgres_primary consul .[norank]r-> postgres_secondary @enduml 데이터베이스 로드 밸런싱 활성화 요구 사항 # 데이터베이스 로드 밸런싱을 활성화하려면 다음을 확인하세요: HA PostgreSQL 설정에 기본을 복제하는 하나 이상의 보조 노드가 있습니다. 각 PostgreSQL 노드가 동일한 자격 증명과 동일한 포트로 연결되어 있습니다. Linux 패키지 설치의 경우 다중 노드 설정을 구성 할 때 모든 부하 분산 연결을 풀링하기 위해 각 PostgreSQL 노드에 PgBouncer도 구성해야 합니다. 데이터베이스 로드 밸런싱 구성 # 데이터베이스 로드 밸런싱은 다음 두 가지 방법 중 하나로 구성할 수 있습니다: (권장) 호스트 : PostgreSQL 호스트 목록. 서비스 디스커버리 : PostgreSQL 호스트