일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Windows 10 Home
- CentOS
- CentOS 8
- 라떼판다 NAS
- 자작 NAS
- openstack
- MySQL
- haproxy
- RHEL 8
- Packstack
- MariaDB
- PostgreSQL
- RHEL
- LattePanda Ubuntu
- Rocky Linux 8
- RDP Wrap
- centos 7
- LattePanda NAS
- podman
- Kubernetes
- MSA
- Openstack Rocky
- Rocky Linux
- nextcloud
- WireGuard
- 라떼판다 우분투
- RHEL 7
- ubuntu
- LattePanda
- 라떼판다
Archives
- Today
- Total
간마늘작업소
[PGSQL] PostgreSQL 15 – 01.설치 본문
0.개요
- PostgreSQL 15 설치 진행.
- PostgreSQL 10 이상이면 설치 방법이 동일함.
1.사전 준비
- https://www.postgresql.org/download/
- 설치할 운영체제에 맞춰서 선택.
- 선택을 완료하면 설치할 PostgreSQL 버전과 운영체제, CPU 아키텍처 방식을 지정할 수 있음.
- 설치할 PostgreSQL 버전은 PostgreSQL 15.
- 서버의 운영체제는 CentOS 7.9이므로 이에 맞는 버전 지정.
- CPU 아키텍처 방식은 AMD64이므로 x86_64 지정.
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
dnf -qy module disable postgresql ## RHEL 8 및 CentOS 8, Rocky Linux 8 등 RHEL 8 기반 운영체제 및 그 이상 버전에서 실시
yum grouplist -y
- PostgreSQL 리포지토리 설치 진행.
2.설치
yum install glibc* gcc* perl
yum install postgresql15-server postgresql15-contrib postgresql15-devel
- PostgreSQL 15 패키지 설치.
mkdir -p /var/lib/pgsql/15/data/
chown -R postgres.postgres /var/lib/pgsql/15
chown -R postgres.postgres /usr/pgsql-15
- 데이터 디렉토리 생성 및 postgres 계정 할당.
usermod -d /usr/pgsql-15 postgres
cat /etc/passwd | grep postgres
- postgres 계정의 홈 디렉토리를 변경.
cd /usr/pgsql-15
cp /etc/skel/.* .
chown -R postgres.postgres .
- bash 쉘 터미널 적용.
su - postgres
cd /usr/pgsql-15/bin
./initdb -D /var/lib/pgsql/15/data/
exit
- PostgreSQL 15 데이터 디렉토리 설치.
3.초기 설정
su - postgres
cd /var/lib/pgsql/15/data/
vi postgresql.conf
(전략)
listen_addresses = '*'
(중략)
port = 5432
(중략)
password_encryption = scram-sha-256
(후략)
- postgresql.conf 파일에서 'listen_addresses' 설정 항목을 찾아서 내용 수정.
- 기본 값은 '#listen_addresses = 'localhost'로 되어 있음.
- postgresql.conf 파일에서 'port' 설정 항목을 찾아서 내용 수정.
- 기본 값은 '#port = 5432'로 되어 있음.
- postgresql.conf 파일에서 'password_encryption' 설정 항목을 찾아서 내용 수정.
- 기본 값은 '#port = 5432'로 되어 있음.
- 암호 형식
- md5 : PostgreSQL 14 미만 버전에서의 기본 값.
- scram-sha-256 : PostgreSQL 14 이상 버전에서의 기본 값.
- 암호 형식
- 기본 값은 '#port = 5432'로 되어 있음.
vi pg_hba.conf
(전략)
# IPv4 local connections:
(중략)
host all all 0.0.0.0/0 scram-sha-256
(후략)
- pg_hba.conf 파일 하단에 위치한 '# IPv4 local connections:' 부분에 내용 추가 후 저장.
- 암호 형식
- md5 : PostgreSQL 14 미만 버전에서의 기본 값.
- scram-sha-256 : PostgreSQL 14 이상 버전에서의 기본 값.
- 암호 형식
4.실행
sudo systemctl start postgresql-15.service
sudo systemctl status postgresql-15.service
- PostgreSQL 실행 및 프로세스 상태 확인.
'Linux > 31.PostgreSQL' 카테고리의 다른 글
[PGSQL] PostgreSQL 이중화 구성 – Repmgr 이용 (0) | 2022.12.21 |
---|---|
[PGSQL] PostgreSQL 11 – 02.Replication(복제) 설정 (0) | 2022.07.05 |
[PGSQL] PostgreSQL 14 – 02.Replication(복제) 설정 (0) | 2022.07.04 |
Comments