728x90

์„ค์น˜ํ™˜๊ฒฝ

CentOS 7

 

VERSION

Postgresql 9.6

postgis 2.3

 

 

 

 

[CentOS 7] PostgreSQL 9.6 Database ์„ค์น˜

CentOS 7์— PoatgreSQL์„ ์„ค์น˜ํ•˜๋ ค๋ฉด ๋จผ์ € ์šด์˜์ฒด์ œ ์ข…๋ฅ˜์™€ ๋ฒ„์ „ ๋ณ„๋กœ ์ œํ’ˆ์˜ ์–ด๋–ค ๋ฒ„์ „์ด ์ง€์› ๋˜๊ณ  ์žˆ๋Š”์ง€ ํ™•์ธ์„ ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. PostgreSQL๋„ ํ™ˆํŽ˜์ด์ง€์— ๋“ค์–ด๊ฐ€ ๋ณด๋ฉด 2020๋…„ 05์›” ํ˜„์žฌ ์ง€์› ํ•˜๋Š” ์ƒํ™ฉ์„

copycoding.tistory.com

 

 

1. Pgsql ์„ค์น˜

OS ์„ค์น˜ ์‹œ ์„ค์ •ํ•œ ๋””ํดํŠธ postgresql์€ 9.2๋ฒ„์ „์ด๋ผ์„œ ๋”ฐ๋กœ rpm ์„ค์น˜ํ•ด์•ผ ํ•จ

(์ฐธ๊ณ  2021.07.12 - [์›น] - VM์— ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ๊ตฌ์ถ•ํ•˜๊ธฐ - OS ์„ค์น˜)

 

yum list grep ๋ช…๋ น์œผ๋กœ ํ˜„์žฌ ๋ฆฌํฌ์ง€์— ์žˆ๋Š” ๊ฒƒ ํ™•์ธ ๊ฐ€๋Šฅ

 

 

 

 

 

PostgreSQL: Linux downloads (Red Hat family)

Linux downloads (Red Hat family) The Red Hat family of distributions includes: Red Hat Enterprise Linux Rocky Linux CentOS Fedora Scientific Linux Oracle Linux and others. PostgreSQL is available on these platforms by default. However, each version of the

www.postgresql.org

์›ํ•˜๋Š” ๋ฒ„์ „ ์ž…๋ ฅํ•˜๋ฉด ์ž๋™์œผ๋กœ ์Šคํฌ๋ฆฝํŠธ ๋งŒ๋“ค์–ด์คŒ

cat /etc/redhat-release

์œ„ ๋ช…๋ น์–ด๋กœ ๋ฆฌ๋ˆ…์Šค ๋ ˆ๋“œํ–‡ ๋ฒ„์ „ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Œ

#์—๋Ÿฌ

[Errno -1] Gpg Keys not imported, cannot verify repomd.xml for repo pgdg-common Trying other mirror.

์ค‘๊ฐ„์— yum ๋ฆฌํฌ ์ฃผ์†Œ ๋ฐ”๊พธ๋‹ค๊ฐ€ pubKey ์—๋Ÿฌ๋‚˜์„œ ๋ฆฌํฌ์ง€๋ž‘ ์—ฐ๊ฒฐ ์•ˆ ๋จ.

์•„๋ž˜ ๋ช…๋ น์–ด๋กœ ์—…๋ฐ์ดํŠธํ•˜๊ณ  ์žฌ์—ฐ๊ฒฐํ•จ

๋ฃจํŠธ๋กœ ๋กœ๊ทธ์ธ ํ•œ ๋’ค
# yum check-update

 

 

 

2. POSTGIS ์„ค์น˜

 

Installing PostGIS 3.1 and PostgreSQL 13 on CentOS 8 | Devrim Gunduz's PostgreSQL Blog

Installing PostGIS 3.1 on CentOS 8 requires a few steps: Run these steps as root: - Install PostgreSQL repo RPM: dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm - Disable postgresql modul

people.planetpostgresql.org

epel ์ €์žฅ์†Œ ์„ค์น˜
# yum install epel-release

postgis 2.3 ์„ค์น˜
# yum install postgis23_96.x86_64

postgresql ์žฌ์‹œ์ž‘
#systemctl restart postgresql-9.6.service

 

 

 

3. ์ ‘๊ทผ์„ค์ •

 

 

<่จ˜> CentOS 7์— PostgreSQL 12 ์„ค์น˜ํ•˜๊ธฐ

ํ˜„์žฌ ๊ตฌ์„ฑํ•˜๊ณ  ์žˆ๋Š” ์„œ๋ฒ„์—๋Š” ์ด๋ฏธ CentOS๋ฅผ ์„ค์น˜ํ•  ๋•Œ ํŒจํ‚ค์ง€๋กœ ์„ค์น˜๋œ PostgreSQL์ด ์žˆ๋‹ค.(์†”์งํžˆ ์–ธ์ œ ์–ด๋–ป๊ฒŒ ์„ค์น˜ํ–ˆ๋Š”์ง€ ๊ธฐ์–ต์ด ๋‚˜์งˆ ์•Š๋Š”๋‹ค... ใ…กใ…ก; ๊ทธ๋ƒฅ ํŒจํ‚ค์ง€๋กœ ์„ค์น˜๋˜์—ˆ๋‹ค ์ถ”์ธกํ•˜๊ณ  ์žˆ๋‹ค.) #

flipdata.tistory.com

 

postgresql.conf

ํŒŒ์ผ ์œ„์น˜ ๋ชป์ฐพ์œผ๋ฉด,

find / -name postgresql.conf

 

ํŒŒ์ผ 58ํ–‰์˜ Connection Settings ์ˆ˜์ •

listen_address, port (ํฌํŠธ๋Š” ๊ธฐ๋ณธ 5432๋ผ์„œ ๊ตณ์ด ์•ˆํ’€์–ด๋„ ๋จ)

 

pg_hba.conf

๋นจ๊ฐ„ ๋ถ€๋ถ„ ์ถ”๊ฐ€(์•„๋‹ˆ๋ฉด ์ˆ˜์ •ํ•˜๊ฑฐ๋‚˜)

 

์„ค์ • ํ›„ ์žฌ์‹œ์ž‘

systemctl restart postgresql-9.6

 

 

 

๋ฐฉํ™”๋ฒฝ ์„ค์ •

 

 

RHEL/CentOS ์—์„œ ๋ฐฉํ™”๋ฒฝ(firewall) ์„ค์ •ํ•˜๊ธฐ

ํฌํŠธ ์ถ”๊ฐ€/๋ณ€๊ฒฝ, IP ์ถ”๊ฐ€/๋ณ€๊ฒฝ๋Š” --reload ์˜ต์…˜์„ ์‹คํ–‰ํ•ด์•ผ ๋ฐ˜์˜๋จ.

www.lesstif.com

๋ชฉ๋ก ์ถœ๋ ฅ
firewall-cmd --get-zones

๋ชฉ๋ก ์ƒ์„ธ ์ถœ๋ ฅ
firewall-cmd --list-all-zones 

ํฌํŠธ ์ถ”๊ฐ€ [๋ฒ”์œ„] *****
firewall-cmd --permanent --zone=public --add-port=8080[-8090]/tcp

ํฌํŠธ ์‚ญ์ œ
firewall-cmd --permanent --zone=public --remove-port=8080/tcp

๋ฐฉํ™”๋ฒฝ ์žฌ์‹œ์ž‘
firewall-cmd --reload

 

 

++ postgres ๊ณ„์ • ๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์ •ํ•ด์ฃผ๋ฉด ๋

 

728x90

+ Recent posts