Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

이열매의 메모장

HA proxy 본문

서버

HA proxy

이열매 2020. 3. 24. 14:54

HA Proxy with Nginx

  • HA Proxy 란

    • TCP(L4) / HTTP(L7) 로드 밸런서 및 프록시 서버용 오픈소스 소프트웨어

    • Nginx 앞 단에서 서버로 들어오는 요청을 받고 처리 결과를 전달하는 reverse proxy 형태로 동작

  • HA Proxy 설치

yum install -y haproxy

 

  • {NGINX_HOME}/conf/nginx.config 파일 변경

#listen 80;
listen 127.0.0.1:80;
​
#listen 443 ssl;
listen 127.0.0.1:443;

 

  • /etc/haproxy/haproxy.cfg 파일 변경
frontend main
  #HTTP
  bind :80
  #Redirect http request to https
  http-request redirect scheme https if !{ ssl_fc }
   
#---------------------------------------------------------------------
backend app-main
  server nginx1 {SERVER_IP}:80 check                 #Nginx1

 

  • HA proxy config valid check

/usr/sbin/haproxy -c -V -f /etc/haproxy/haproxy.cfg

 

  • HAproxy 실행

sudo systemctl start haproxy
  • 이 때, HA proxy 와 동일하게 80포트/443포트 사용하는 웹 서버는 사용 중지 상태여야 합니다

'서버' 카테고리의 다른 글

Zookeeper / Kafka 정리  (0) 2020.01.05
Storm 정리  (0) 2020.01.05
Filebeat 정리  (0) 2020.01.05
Elasticsearch 정리  (0) 2020.01.05
Ansible 정리  (0) 2020.01.05
Comments