CentOS / RHEL 및 Fedora에 PostgreSQL 10을 설치하는 방법
PostgreSQL은 Linux 및 Windows OS를 포함한 Unix와 유사한 운영 체제에서 실행되는 강력하고 확장 성이 뛰어난 오픈 소스 및 교차 플랫폼 객체 관계형 데이터베이스 시스템입니다. 신뢰성이 높고 사용자에게 데이터 무결성과 정확성을 제공하는 엔터프라이즈 급 데이터베이스 시스템입니다.
이 기사에서는 공식 PostgreSQL Yum 저장소를 사용하여 CentOS, RHEL, Oracle Enterprise Linux, Scientific Linux 및 Fedora에 최신 버전의 PostgreSQL 10을 설치하는 방법을 설명합니다.
PostgreSQL Yum 리포지토리 추가
이 공식 PostgreSQL Yum 리포지토리는 Linux 시스템과 결합되며 CentOS, Scientific Linux 및 Scientific Linux와 같은 RedHat 기반 배포판과 현재 버전의 Fedora에서 지원되는 모든 PostgreSQL 버전에 대한 자동 업데이트를 제공합니다.
Fedora 지원주기가 짧기 때문에 모든 버전을 사용할 수있는 것은 아니며 서버 배포에 Fedora를 사용하지 않는 것이 좋습니다.
yum 저장소를 사용하려면 다음 단계를 따르십시오.
--------------- On RHEL/CentOS 7 and Scientific Linux/Oracle Linux 7 --------------- # yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat10-10-1.noarch.rpm --------------- On 64-Bit RHEL/CentOS 6 and Scientific Linux/Oracle Linux 6 --------------- # yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-x86_64/pgdg-redhat10-10-1.noarch.rpm --------------- On 32-Bit RHEL/CentOS 6 and Scientific Linux/Oracle Linux 6 --------------- # yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-i386/pgdg-redhat10-10-1.noarch.rpm --------------- On Fedora 26 --------------- # dnf install https://download.postgresql.org/pub/repos/yum/10/fedora/fedora-26-x86_64/pgdg-fedora10-10-2.noarch.rpm --------------- On Fedora 25 --------------- # dnf install https://download.postgresql.org/pub/repos/yum/10/fedora/fedora-25-x86_64/pgdg-fedora10-10-3.noarch.rpm --------------- On Fedora 24 --------------- # dnf install https://download.postgresql.org/pub/repos/yum/10/fedora/fedora-24-x86_64/pgdg-fedora10-10-3.noarch.rpm

PostgreSQL 서버 설치
각 Linux 배포에 PostgreSQL yum 저장소를 추가 한 후 다음 명령을 사용하여 PostgreSQL 서버 및 클라이언트 패키지를 설치합니다.
# yum install postgresql10-server postgresql10 [On RedHat based Distributions] # dnf install postgresql10-server postgresql10 [On Fedora Linux]

중요 : PostgreSQL 데이터 디렉토리 /var/lib/pgsql/10/data/
에는 데이터베이스에 대한 모든 데이터 파일이 포함되어 있습니다.
PostgreSQL 데이터베이스 초기화
Red Hat 기반 배포에 대한 일부 정책으로 인해 PostgreSQL 설치가 자동 시작을 위해 활성화되지 않거나 데이터베이스가 자동으로 초기화되지 않습니다. 데이터베이스 설치를 완료하려면 처음 사용하기 전에 데이터베이스를 초기화해야합니다.
# /usr/pgsql-10/bin/postgresql-10-setup initdb

PostgreSQL Server 시작 및 활성화
데이터베이스 초기화가 완료된 후 PostgreSQL 서비스를 시작하고 PostgreSQL 서비스가 시스템 부팅시 자동으로 시작되도록합니다.
--------------- On SystemD --------------- # systemctl start postgresql-10 # systemctl enable postgresql-10 # systemctl status postgresql-10 --------------- On SysVinit --------------- # service postgresql-10 start # chkconfig postgresql-10 on # service postgresql-10 status

PostgreSQL 설치 확인
서버에 PostgreSQL 10을 설치 한 후 postgres 데이터베이스 서버에 연결하여 설치를 확인합니다.
# su - postgres $ psql psql (10.0) Type "help" for help.
원하는 경우 보안을 위해 사용자 postgres에 대한 암호를 만들 수 있습니다.
postgres=# \password postgres

자세한 내용은 PostgreSQL 홈페이지 (https://www.postgresql.org/)에서 확인할 수 있습니다.
또한 인기있는 데이터베이스 관리 시스템에 대한 다음 기사를 확인하십시오.
- How to Install and Secure MariaDB 10 in CentOS 7
- How to Install and Secure MariaDB 10 in CentOS 6
- Install MongoDB Community Edition 3.2 on Linux Systems
그게 다야! "이 기사가 유용하기를 바랍니다. 공유 할 질문이나 생각이 있으면 아래 댓글 섹션을 사용하십시오.