Research/Devops
[Centos 7, Postgresql 15] 설치. ( version 11 or later )
JMcunst
2022. 12. 29. 14:51
728x90
반응형
Docker 컨테이너 환경에서 Postgresql을 올리려고 하면 버전 11 이상을 쓰라고 권고를 하고 있다.
그도 그럴게, Postgresql 버전 정책을 찾아보면, 아래와 같이 Version 11 이상을 지원하는 것을 확인할 수 있었다.
필자가 설치한 Centos 7 OS에서 단순히 yum -y install postgresql-server postgresql-contrib을 하면, 아래 처럼 버전 9가 깔리는 것을 확인할 수 있다.
따라서, 11 이상의 버전을 설치할 수 있도록 레포에 등록을 해준다. 일단 Postgresql RPM인 'pgg-redhat-repo' 를 설치.
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
그 다음, 레포 리스트 들을 추가한다.
yum -y repolist
다음으로, Postgresql dependency를 위한 'epel-release' RPM을 설치한다.
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
이후 원하는 버전으로 설치.
yum -y install postgresql15-server
설치가 완료 된 것을 확인하면, initialize 해준다.
/usr/pgsql-15/bin/postgresql-15-setup initdb
postgresql 서비스 시작.
systemctl enable --now postgresql-15
728x90
반응형