OS환경 : Oracle Linux 7.6 (64bit)
DB 환경 :PostgreSQL 10 + PostGIS 2.5.3
방법 : linux7.6에 PostgreSQL 10 + PostGIS 2.5.3 구성하기(실패)
코드에서 #은 root 유저이고 $은 postgres 유저를 나타냄
1 2 3 4 | # whoami root $ whoami postgres |
이 글 말고 이다음 글을 보기를 권장함 https://positivemh.tistory.com/464
PostgreSQL 10 설치
https://www.postgresql.org 사이트에서 아래의 4개 파일을 다운로드 받음
(https://yum.postgresql.org/10/redhat/rhel-7-x86_64/repoview/)
postgresql10-libs-10.10-1PGDG.rhel7.x86_64.rpm
postgresql10-10.10-1PGDG.rhel7.x86_64.rpm
postgresql10-server-10.10-1PGDG.rhel7.x86_64.rpm
postgresql10-contrib-10.10-1PGDG.rhel7.x86_64.rpm
다운받은 이후 순서대로 설치
1 2 3 4 | # rpm -ivh postgresql10-libs-10.10-1PGDG.rhel7.x86_64.rpm # rpm -ivh postgresql10-10.10-1PGDG.rhel7.x86_64.rpm # rpm -ivh postgresql10-server-10.10-1PGDG.rhel7.x86_64.rpm # rpm -ivh postgresql10-contrib-10.10-1PGDG.rhel7.x86_64.rpm |
설치되는 경로 : /usr/pgsql-10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # rpm -ivh postgresql10-libs-10.10-1PGDG.rhel7.x86_64.rpm warning: postgresql10-libs-10.10-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ################################# [100%] Updating / installing... 1:postgresql10-libs-10.10-1PGDG.rhe################################# [100%] # rpm -ivh postgresql10-10.10-1PGDG.rhel7.x86_64.rpm warning: postgresql10-10.10-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ################################# [100%] Updating / installing... 1:postgresql10-10.10-1PGDG.rhel7 ################################# [100%] # rpm -ivh postgresql10-server-10.10-1PGDG.rhel7.x86_64.rpm warning: postgresql10-server-10.10-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ################################# [100%] Updating / installing... 1:postgresql10-server-10.10-1PGDG.r################################# [100%] # rpm -ivh postgresql10-contrib-10.10-1PGDG.rhel7.x86_64.rpm warning: postgresql10-contrib-10.10-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ################################# [100%] Updating / installing... 1:postgresql10-contrib-10.10-1PGDG.######################## ( 72%) ################################# [100%] |
5432 포트 방화벽 허용(기본 포트)
1 2 | # firewall-cmd --zone=public --add-port=5432/tcp success |
postgres 유저 생성 및 패스워드 변경 후 홈경로 변경
1 2 3 4 5 6 7 8 9 | # useradd postgres useradd: user 'postgres' already exists # passwd postgres Changing password for user postgres. New password: BAD PASSWORD: The password contains the user name in some form Retype new password: passwd: all authentication tokens updated successfully. # usermod -d /home/postgres/ postgres |
유저는 이미 있다고 나옴(패키지 설치 시 만들어진듯)
postgres 유저 홈경로 생성 및 권한부여
1 2 3 | # mkdir -p /home/postgres # chown -R postgres:postgres /home/postgres/ # chmod -R 755 /home/postgres/ |
postgres 유저로 접속
# su - postgres
.bash_profile 수정
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | $ vi .bash_profile alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi #pg export setting# export LD_LIBRARY_PATH=:/usr/pgsql-10/lib export PATH=$PATH:/usr/pgsql-10/bin export PGHOME=/usr/pgsql-10 export PGDATA=/home/postgres/DATA export PGDATABASE=postgres export PGUSER=postgres export PGPORT=5432 #pg export setting# |
1 2 | -bash-4.2$ . ./.bash_profile // 기존:-bash-4.2$가 나옴 [postgres@PG ~]$ // 변경후: 유저명@hostname이나옴 |
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 | $ $PGHOME/bin/initdb 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 "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. creating directory /home/postgres/DATA ... ok creating subdirectories ... ok selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default timezone ... Asia/Seoul selecting dynamic shared memory implementation ... posix creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: /usr/pgsql-10/bin/pg_ctl -D /home/postgres/DATA -l logfile start |
리스너의 유효 IP를 설정
1 2 3 4 | $ vi $PGDATA/postgresql.conf 59번 줄 수정 기존 : #listen_addresses = 'localhost' 수정 : listen_addresses = '*' |
PostgreSQL 프로세스가 사용할 temp 경로 지정
1 2 3 4 | $ vi $PGDATA/postgresql.conf 66번 줄 수정 기존 : #unix_socket_directories = '/var/run/postgresql, /tmp' 수정 : unix_socket_directories = '/home/postgres/DATA' |
외부 접속을 위한 보안 설정
1 2 3 4 5 6 7 8 9 | $ vi $PGDATA/pg_hba.conf # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: #host all all 127.0.0.1/32 trust //이부분 주석처리하고 host all all 0.0.0.0/0 md5 //이렇게 변경(추가) # IPv6 local connections: #host all all ::1/128 trust //이부분도 주석처리하고 host all all ::1/128 md5 //이렇게 변경(추가) |
postgreSQL 서비스 시작
PostgreSQL이 실행되지 않으면 해당 로그파일을 확인하여 문제를 조치해야함
1 2 3 | $ $PGHOME/bin/pg_ctl -D $PGDATA -l logfile start waiting for server to start.... done server started |
oracle의 sqlplus 같은 psql로 접속
1 2 3 4 | $ psql psql: error: could not connect to server: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? |
에러 발생
해결방법
먼저 $ cd /var/run/postgresql/ 경로로 이동해서 파일 확인
1 2 3 4 5 | $ cd /var/run/postgresql/ $ ls -al total 4 drwxr-xr-x. 2 postgres postgres 60 Oct 29 00:00 . drwxr-xr-x. 42 root root 1280 Oct 28 23:09 .. |
.s.PGSQL.5432 파일이 없음
psql 시 /var/run/postgresql/ 경로의 .s.PGSQL.5432를 바라보는데
이 파일이 $PGDATA 폴더의 .s.PGSQL.5432를 바라보도록 설정해줌(심볼릭링크)
1 2 3 4 5 6 7 | $ ln -s $PGDATA/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432 $ ls -al /var/run/postgresql/ total 4 drwxr-xr-x. 2 postgres postgres 80 Oct 29 00:04 . drwxr-xr-x. 42 root root 1280 Oct 28 23:09 .. -rw-------. 1 postgres postgres 209 Oct 29 00:00 logfile lrwxrwxrwx. 1 postgres postgres 33 Oct 29 00:04 .s.PGSQL.5432 -> /home/postgres/DATA/.s.PGSQL.5432 |
다시 psql 접속 시도 후 버전확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | $ psql --username=postgres --dbname=postgres psql (10.10) Type "help" for help. postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+----------+-------------+-------------+----------------------- postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres (3 rows) postgres=# select version(); version ---------------------------------------------------------------------------------------------------------- PostgreSQL 10.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit (1 row) |
정상 접속됨
postgres 계정 패스워드 변경
1 2 3 4 | postgres=# \password postgres Enter new password: //postgres 입력 Enter it again: //postgres 입력 postgres=# \q |
샘플 유저 생성
1 2 3 4 5 6 | postgres=# create role scott login; CREATE ROLE postgres=# create user scott postgres-# \password scott Enter new password: //tiger 입력 Enter it again: //tiger 입력 |
PostgreGIS 2.5.3 설치
먼저 https://yum.postgresql.org/repopackages.php#pg10 에서 Repository RPM 다운로드
나는 Red Hat Enterprise Linux 7 - x86_64 를 다운받음
다운받은 이후 rpm 설치
1 2 3 4 5 | # rpm -ivh pgdg-redhat-repo-latest.noarch.rpm warning: pgdg-redhat-repo-latest.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ################################# [100%] Updating / installing... 1:pgdg-redhat-repo-42.0-5 ################################# [100%] |
###필수 패키지 설치과정###
필수 requirement package 설치
http://postgis.net/docs/manual-2.5/postgis-ko_KR.html#install_requirements
필요한 필수 패키지 목록을 요약하면 아래와 같음
1 2 3 4 5 6 7 8 9 | Postgresql 9.4 이상 gcc gcc-c++ make proj 4.9 이상 geos 3.7 이상 libxml2 2.5이상 json-c 0.9이상 gdal 1.9이상 |
해당 패키지들 먼저 설치
gcc, gcc-c++, make는 OS 설치 시 패키지에 체크해서 이미 설치됨
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 | $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 4.8.5 20150623 (Red Hat 4.8.5-36.0.1) (GCC) $ c++ -v Using built-in specs. COLLECT_GCC=c++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 4.8.5 20150623 (Red Hat 4.8.5-36.0.1) (GCC) $ make -v GNU Make 3.82 Built for x86_64-redhat-linux-gnu Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. |
proj 4.9 설치
https://proj.org/download.html 에 들어가서 proj-4.9.3.tar.gz 다운로드
1 | # tar -xvf proj-4.9.3.tar.gz |
압축 해제 한 폴더로 이동 후 설치
1 2 | # cd proj-4.9.3 # ./configure && make && make install |
설치 후 버전 확인(패키지명 -v)
1 2 3 4 5 6 | # proj -v Rel. 4.9.3, 15 August 2016 <proj>: projection initialization failure cause: no arguments in initialization list program abnormally terminated |
geos 3.7 설치
https://trac.osgeo.org/geos/ 에 들어가서 geos-3.7.3.tar.bz2 다운로드
서버에 업드로 한 다음 설치
압축 해제
1 | # tar -xvf geos-3.7.3.tar.bz2 |
bzip2 패키지가 없어서 설치되지 않는다면 bzip2 패키지 먼저 설치
1 2 | # cd /run/media/root/OL-7.6\ Server.x86_64/Packages/ # rpm -ivh bzip2-1.0.6-13.el7.x86_64.rpm |
압축 해제 한 폴더로 이동 후 설치
1 2 | # cd geos-3.7.3 # ./configure --prefix=$LOCALDESTDIR && make && make install |
1 2 | # geos-config --version 3.7.3 |
libxml2, json-c 설치
libxml2 와 json-c는 이미 설치가 되어있었음(설치된 버전이 요구사항에 충족함)
1 2 3 4 5 6 7 8 9 10 | # cd /run/media/root/OL-7.6\ Server.x86_64/Packages/ # rpm -ivh libxml2-2.9.1-6.0.1.el7_2.3.x86_64.rpm warning: libxml2-2.9.1-6.0.1.el7_2.3.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] package libxml2-2.9.1-6.0.1.el7_2.3.x86_64 is already installed # rpm -ivh json-c-0.11-4.el7_0.x86_64.rpm warning: json-c-0.11-4.el7_0.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] package json-c-0.11-4.el7_0.x86_64 is already installed |
gdal 2.4.2 설치
1 | # tar -xvf gdal-2.4.2.tar.gz |
1 2 | # cd gdal-2.4.2/ # ./configure && make && make install |
###필수 패키지 설치과정###
PostGIS 다운로드
먼저 https://postgis.net/source/ 에 접속 후 postgis-2.5.3.tar.gz 다운로드
root 계정으로 postgis-2.5.3.tar.gz 파일 postgres 계정의 home 경로로 이동시킨 후 권한 부여
1 2 | # mv postgis-2.5.3.tar.gz /home/postgres/ # chown postgres:postgres /home/postgres/postgis-2.5.3.tar.gz |
postgres 계정으로 접속 후 압축 해제
1 2 3 | # su - postgres Last login: Tue Oct 29 00:17:32 KST 2019 on pts/0 $ tar -xvf postgis-2.5.3.tar.gz |
압축 푼 경로로 이동해서 configure 실행
1 2 3 4 5 6 7 | $ cd postgis-2.5.3 $ ./configure . . checking for pg_config... /usr/pgsql-10/bin/pg_config configure: error: the PGXS Makefile /usr/pgsql-10/lib/pgxs/src/makefiles/pgxs.mk cannot be found. Please install the PostgreSQL server development packages and re-run configure. |
postgresql development 패키지를 설치하라는 내용의 에러 발생
해당 패키지 설치
https://download.postgresql.org/pub/repos/yum/testing/10/redhat/rhel-7Server-x86_64/ 접속 후
postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm 다운로드
postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm 설치
1 2 3 4 | # rpm -ivh postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm warning: postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY error: Failed dependencies: libicu-devel is needed by postgresql10-devel-10.10-1PGDG.rhel7.x86_64 |
libicu-devel 패키지를 먼저 설치해야함
Oracle linux 7.6 cd에서 해당 파일 찾아서 설치
1 2 3 4 5 6 | # cd /run/media/root/OL-7.6\ Server.x86_64/Packages/ # rpm -ivh libicu-devel-50.1.2-17.el7.x86_64.rpm warning: libicu-devel-50.1.2-17.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] Updating / installing... 1:libicu-devel-50.1.2-17.el7 ################################# [100%] |
다시 postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm 설치
1 2 3 4 5 | # rpm -ivh postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm warning: postgresql10-devel-10.10-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ################################# [100%] Updating / installing... 1:postgresql10-devel-10.10-1PGDG.rh################################# [100%] |
다시 압축 푼 경로로 이동해서 configure 실행
1 2 3 4 5 6 7 8 9 | # su - postgres Last login: Tue Oct 29 00:18:10 KST 2019 on pts/0 $ cd postgis-2.5.3/ $ ./configure . . checking for xml2-config... no configure: error: could not find xml2-config from libxml2 within the current path. You may need to try re-running configure with a --with-xml2config parameter. |
libxml2 패키지가 이미 설치되어있는데 경고 메세지가 나옴
해당 패키지가 설치된 위치 찾아서 --with-xml2config 옵션으로 경로 잡아주고 다시 설치
1 2 3 4 5 6 7 8 | $ ls -al /usr/lib64/libxml2.so* -rwxr-xr-x. 1 root root 1509408 Jun 23 2016 /usr/lib64/libxml2.so.2.9.1 $ ./configure --with-xml2config=/usr/lib64/libxml2.so.2.9.1 . . checking libxml/tree.h presence... no checking for libxml/tree.h... no configure: error: could not find headers include related to libxml2 |
또 에러가나서 알아보니 libxml2-devel을 설치해야 한다고함
libxml2-devel을 설치하기 위해 xz-devel과 zlib-devel 먼저 설치 후 libxml2-devel 설치
OS CD에 들어있는 패키지 사용
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # cd /run/media/root/OL-7.6\ Server.x86_64/Packages/ # rpm -ivh xz-devel-5.2.2-1.el7.x86_64.rpm warning: xz-devel-5.2.2-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] Updating / installing... 1:xz-devel-5.2.2-1.el7 ################################# [100%] # rpm -ivh zlib-devel-1.2.7-18.el7.x86_64.rpm warning: zlib-devel-1.2.7-18.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] Updating / installing... 1:zlib-devel-1.2.7-18.el7 ################################# [100%] # rpm -ivh libxml2-devel-2.9.1-6.0.1.el7_2.3.x86_64.rpm warning: libxml2-devel-2.9.1-6.0.1.el7_2.3.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] Updating / installing... 1:libxml2-devel-2.9.1-6.0.1.el7_2.3################################# [100%] |
다시 설치(libxml2-devel을 설치했기 때문에 --with-xml2config 옵션을 안넣어줘도 돌아감)
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 32 33 34 35 36 37 38 39 40 41 | # su - postgres $ cd postgis-2.5.3 $ ./configure . . PostGIS is now configured for x86_64-pc-linux-gnu -------------- Compiler Info ------------- C compiler: gcc -g -O2 SQL preprocessor: /bin/cpp -traditional-cpp -w -P -------------- Additional Info ------------- Interrupt Tests: DISABLED use: --with-interrupt-tests to enable -------------- Dependencies -------------- GEOS config: /bin/geos-config GEOS version: 3.7.3 GDAL config: /usr/local/bin/gdal-config GDAL version: 2.4.2 PostgreSQL config: /usr/pgsql-10/bin/pg_config PostgreSQL version: PostgreSQL 10.10 PROJ4 version: 49 Libxml2 config: /bin/xml2-config Libxml2 version: 2.9.1 JSON-C support: no protobuf-c support: no PCRE support: no Perl: /bin/perl --------------- Extensions --------------- PostGIS Raster: enabled PostGIS Topology: enabled SFCGAL support: disabled Address Standardizer support: disabled -------- Documentation Generation -------- xsltproc: /bin/xsltproc xsl style sheets: dblatex: convert: mathml2.dtd: http://www.w3.org/Math/DTD/mathml2/mathml2.dtd |
제대로 설치가 됨
make 실행
1 | $ make |
make install 실행
1 2 3 4 5 6 7 8 9 10 11 12 | $ make install . . make -f Makefile.comments install make[2]: Entering directory `/home/postgres/postgis-2.5.3/doc' /bin/mkdir -p '/usr/pgsql-10/share/contrib/postgis-2.5' /bin/mkdir: cannot create directory ??/usr/pgsql-10/share/contrib/postgis-2.5??: Permission denied make[2]: *** [installdirs] Error 1 make[2]: Leaving directory `/home/postgres/postgis-2.5.3/doc' make[1]: *** [comments-install] Error 2 make[1]: Leaving directory `/home/postgres/postgis-2.5.3/doc' make: *** [comments-install] Error 2 |
경로를 만들수 없다는 에러 발생
root 계정으로 수동으로 경로 생성 후 다시 진행
1 2 3 4 5 6 7 8 9 10 11 12 13 | # mkdir -p /usr/pgsql-10/share/contrib/postgis-2.5 # chown -R postgres:postgres /usr/pgsql-10/share/contrib/postgis-2.5 # su - postgres Last login: Tue Oct 29 01:41:05 KST 2019 on pts/0 $ cd postgis-2.5.3/ $ make install . . libtool: install: /bin/install -c .libs/liblwgeom-2.5.so.0.0.0 /usr/local/lib/liblwgeom-2.5.so.0.0.0 /bin/install: cannot create regular file '/usr/local/lib/liblwgeom-2.5.so.0.0.0': Permission denied make[1]: *** [install-liblwgeom] Error 1 make[1]: Leaving directory `/home/postgres/postgis-2.5.3/liblwgeom' make: *** [install] Error 1 |
이번엔 /usr/local/lib에 해당 파일을 생성할수 없다는 에러인데 이경로에 postgres 계정 권한을 줄수가없어서
root로 make install 을 진행함
1 2 | # cd /home/postgres/postgis-2.5.3 # make install |
postgresql 서비스 재시작
1 2 3 4 5 | $ $PGHOME/bin/pg_ctl -D $PGDATA -l logfile restart waiting for server to shut down.... done server stopped waiting for server to start.... done server started |
psql 접속 후 설치 확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | $ psql --username=postgres --dbname=postgres psql (10.10) Type "help" for help. postgres=# select version(); version ---------------------------------------------------------------------------------------------------------- PostgreSQL 10.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit (1 row) postgres=# SELECT name, default_version,installed_version postgres-# FROM pg_available_extensions WHERE name LIKE 'postgis%' or name LIKE 'address%'; name | default_version | installed_version ------------------------+-----------------+------------------- postgis | 2.5.3 | postgis_tiger_geocoder | 2.5.3 | postgis_topology | 2.5.3 | (3 rows) |
PostgreSQL 10 과 PostGIS 2.5.3 이 정상적으로 설치된 모습을 볼 수있음
PostGIS 풀버전 확인
1 2 3 4 5 | # SELECT PostGIS_Full_Version(); ERROR: function postgis_full_version() does not exist LINE 1: SELECT PostGIS_Full_Version(); ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. |
제대로 나오지 않는걸 보니 제대로 설치되지 않았음
=> https://positivemh.tistory.com/464
제대로 설치 완료함
참조 : https://positivemh.tistory.com/459
'PostgreSQL > Install' 카테고리의 다른 글
PostgreSQL 10 환경에서 collate ko_kr.utf-8 로 database 생성하기 (0) | 2019.11.05 |
---|---|
PostgreSQL 10, oracle fdw extension 생성방법 (0) | 2019.10.28 |
linux7.6에 PostgreSQL 10 + PostGIS 2.5.3 구성하기(성공) (4) | 2019.10.28 |
Postgresql 과 PostGIS의 지원 매트릭스 문서 (0) | 2019.10.25 |
linux7.6에 PostgreSQL 12 + PostGIS 3.0 구성하기(실패) (0) | 2019.10.19 |