콘텐츠로 이동

HA 구성

DeepFinder HA 구성

DeepFinder Manager는 ServerPostgreSQL의 HA(고가용성) 구성을 지원하여, Active 서버 장애 시 Standby 서버가 즉시 동작하도록 설정할 수 있습니다.
HA 구성이 완료되면, Active 서버에 장애(네트워크 단절, 고장 등) 발생 시 Standby 서버가 Active 서버로 자동 전환되며, Agent들 또한 Standby 서버로 통신을 재요청합니다.

Server Process HA 구성

1) 설치 파일 다운로드
리포지토리에서 DeepFinder Manager Server 설치 파일을 다운로드합니다.

[root@localhost~]# wget http://download.deepfinder.co.kr/DeepFinder/dfServer/DFServer.tar.gz


2) 압축 해제
다운로드한 설치 파일의 압축을 해제합니다.

[root@localhost~]# tar xvfz DFServer.tar.gz


3)  스크립트 실행
압축이 해제된 DFServer 디렉토리로 진입하여 설치 스크립트를 실행합니다.

[root@localhost~]# cd DFServer
[root@localhost~]# ./setup.sh CHECK OS BIT : x86_64 (64 bit) CHECK OS : Linux CHECK LINUX : Unknown  Linux Failed to enable unit: Unit file deepfinder.service does not exist. request license with this info INFO : IP  : 192.168.3.58 INFO : Mac : BC:24:11:6D:50:52 1. modify config.xml 2. cp license.txt /usr/local/dfserver/license/ 3. service dfserver start

Server Active 설치

[root@localhost DFServer]# ./ha.sh master 192.168.3.8
Redirecting to /bin/systemctl restart dfserver.service

Server Standby 설치

[root@localhost DFServer]# ./ha.sh slave 192.168.3.58
Redirecting to /bin/systemctl restart dfserver.service

Postgres HA 구성

1) Postgres 포트 오픈
Active 서버와 Standby 서버 간의 PostgreSQL 통신을 위해, 각 서버의 방화벽에서 TCP 5432 포트Inbound로 허용합니다.

Danger

Inbound 5432 포트 개방 시, 반드시 상대편 서버의 IP에 대해서만 허용하도록 보안 정책을 설정하십시오.

2) Postgres Active 서버 설치

[root@localhost DFDB]# ./setup_postgres.sh master

installing... /usr/local/dfserver/postgres
Started DeepFinder Server DB installation.
Copying ./postgres ...
Create system account user 'postgres' ...
Make postgres startup script for DeepFinder ...


Startup postgres for DeepFinder ...
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "ko_KR.UTF-8".
initdb: could not find suitable text search configuration for locale "ko_KR.UTF-8"
The default text search configuration will be set to "simple".

Data page checksums are disabled.

fixing permissions on existing directory /usr/local/dfserver/postgres/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

3) Postgres Standby 서버 설치

[root@localhost DFDB]# ./setup_postgres.sh slave 192.168.3.58

installing... /usr/local/dfserver/postgres
Started DeepFinder Server DB installation.
Copying ./postgres ...
Create system account user 'postgres' ...
Make postgres startup script for DeepFinder ...


Startup postgres for DeepFinder ...
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "ko_KR.UTF-8".
initdb: could not find suitable text search configuration for locale "ko_KR.UTF-8"
The default text search configuration will be set to "simple".

Data page checksums are disabled.

fixing permissions on existing directory /usr/local/dfserver/postgres/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

4) pg_hba.conf 수정

Active/Standby 서버 간의 PostgreSQL 통신을 허용하기 위해, 양쪽 서버pg_hba.conf 파일을 각각 수정해야 합니다.
각 서버의 pg_hba.conf 파일에 상대방 서버의 IP 주소host 항목으로 추가합니다.
수정 후에는 dfserver-postgres 서비스를 재시작하여 변경 내용을 적용합니다.

[root@ip-172-31-12-31 ~]# cat /usr/local/dfserver/postgres/data/pg_hba.conf
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
host    all             all             172.31.12.32             trust # DeepFinder HA 통신 (상대방 IP)
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     trust
host    replication     all             127.0.0.1/32            trust
host    replication     all             ::1/128                 trust


[root@ip-172-31-12-31 ~]# service dfserver-postgres restart
Stopping PostgreSQL 10.5:
waiting for server to shut down.... done
server stopped
Starting PostgreSQL 10.5:
waiting for server to start.... done
server started
PostgreSQL 10.5 started successfully

라이선스 확인

Manager License 확인
Manager HA 구성이 완료되면 [환경 관리] - [환경 설정]의 라이선스 정보에 'HA Server Info' 항목이 표시됩니다.