한화시스템 BEYOND SW CAMP 12기_2-1

Ryoni·2024년 11월 22일
0

Ubuntu ip 설정 및 HAProxy 설정

  1. 관리자 로그인
    sudo su - root

  2. IP 설정
    vi /etc/netplan/00-installer-config.yaml
    network:
    renderer: networkd
    ethernets:
    ens33:
    addresses:
    - 10.10.10.100/24
    nameservers:
    addresses: [8.8.8.8]
    routes:
    - to: default
    via: 10.10.10.2
    version: 2

  3. IP 설정 적용
    netplan apply

  4. 레포지토리 목록 갱신
    apt update

  5. HAProxy 설치
    apt install haproxy

  6. HAProxy 실행
    systemctl restart haproxy

  7. HAProxy 설정
    vi /etc/haproxy/haproxy.cfg 맨 마지막 줄에 다음 내용 추가

listen stats
bind *:9000
mode http
option dontlog-normal
stats enable
stats realm Haproxy\ Statistics
stats uri /stats

  1. HAProxy 설정 적용
    systemctl restart haproxy
  1. HAProxy 실행 확인
    systemctl status haproxy
    apt install -y net-tools
    netstat -anlp | grep :9000
profile
비전공자 개발자는 술로 코딩한다

0개의 댓글