콘텐츠로 이동

HA 구성

DeepFinder HA 구성

DeepFinder Manager는 Server, Postgres HA 구성을 통해 Active 서버 장애 시 Standby서버가 동작할 수 있도록 구성할 수 있습니다.
HA 구성 후 Active 서버의 고장 등으로 인해 네트워크 연결이 불가능해지면 Standby 서버가 Active 서버 역할을 수행함과 동시에 연결이 끊어진 Agent는 Standby 서버로 통신을 요청합니다.

Server Process HA 구성

1) 설치 파일 다운로드
Repository에서 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) 스크립트 실행
설치 스크립트 실행압축이 해제된 디렉토리에 진입하여 설치 스크립트를 실행합니다.

[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 Postgres 간 통신을 위해 Active 서버 내 Inbound Port 5432 를 허용합니다.

Danger

Inbound 5432 Port 오픈 시 반드시 Master/Standby 서버 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 서버의 Postgres 통신을 진행하기 위해 각각의 postgres - pg_hba.conf를 수정합니다.
host의 IP를 서로 통신할 서버 IP를 입력합니다.
수정 후에는 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 통신
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 Server Info 정보가 나타납니다.