CentOS 8 + KeepAlived [미완성] > 구축

본문 바로가기
사이트 내 전체검색

구축

Linux CentOS 8 + KeepAlived [미완성]

페이지 정보

작성자 불꽃싸대기 댓글 0건 조회 555회 작성일 19-11-07 21:55

본문

설치를 하면서 작성하는거라 정리가 필요함.


# 환경

CentOS 8.0.1905


es 10.23.1.100

es1 10.23.1.101

es2 10.23.1.102


1. 먼저 es의 아이피를 vip로 만듭니다.

cp /etc/sysconfig/network-scripts/eth0 /etc/sysconfig/network-scripts/eth0:0


vi  /etc/sysconfig/network-scripts/eth0:0  # 복사한뒤 vip를 설정해 줍니다.

DEVICE=eth0:0

TYPE=Ethernet

ONBOOT=yes

IPV6INIT=no

NM_CONTROLLED=no

BOOTPROTO=none

IPADDR=10.23.1.100

PREFIX=24

GATEWAY=10.23.1.254



systemctl restart network

ifconfig -a


vi /etc/sysctl.conf

net.ipv4.ip_forward = 1

sysctl -p


yum install -y keepalived


systemctl enable keepalived


systemctl start keepalived




mv /etc/keepalived/keepalived.conf /etc/keepalived/keepalived.old


vi /etc/keepalived/keepalived.conf

! Configuration File for keepalived

 

global_defs {

  notification_email {

    admin@ssadaegi.com

  }

  notification_email_from admin@ssadaegi.com

  smtp_server localhost

  smtp_connect_timeout 30

  router_id es1

}


vrrp_instance VI_1 {

  state MASTER

  interface eth0

  virtual_router_id 51

  priority 100

  advert_int 1

  authentication {

    auth_type PASS

    auth_pass 1111

  }

  virtual_ipaddress {

    10.23.1.100

  }

}


systemctl reload keepalived


tailf /var/log/messages



keepalived 설정 - es2

mv /etc/keepalived/keepalived.conf /etc/keepalived/keepalived.old

vi /etc/keepalived/keepalived.conf

! Configuration File for keepalived

 

global_defs {

  notification_email {

    admin@ssadaegi.com

  }

  notification_email_from admin@ssadaegi.com

  smtp_server localhost

  smtp_connect_timeout 30

  router_id es2

}


vrrp_instance VI_1 {

  state MASTER

  interface eth0

  virtual_router_id 51

  priority 99

  advert_int 1

  authentication {

    auth_type PASS

    auth_pass 1111

  }

  virtual_ipaddress {

    10.23.1.100

  }

}


systemctl reload keepalived


tailf /var/log/messages


# vip test

ping 10.23.1.100



pg_basebackup -h 16.8.35.227 -D /var/lib/pgsql/9.6/data -U replication -P -v -X stream

  • 트위터로 보내기
  • 페이스북으로 보내기
  • 구글플러스로 보내기

댓글목록

등록된 댓글이 없습니다.

  • 게시물이 없습니다.

회원로그인

접속자집계

오늘
49
어제
69
최대
454
전체
58,195

그누보드5
Copyright © ssadaegi.com. All rights reserved.