OS환경 : Oracle Linux 7.6 (64bit)
DB 환경 : PostgreSQL 12 + PostGIS 3.0
방법 : linux7.6에 PostgreSQL 12 + PostGIS 3.0 구성하기(실패)
코드에서 #은 root 유저이고 $은 postgres 유저를 나타냄
1 2 3 4 | # whoami root $ whoami postgres |
yum 을 이용한 PostgreSQL 12 자동 설치
https://www.postgresql.org/download/linux/redhat/ 에 가면 설치 방법이 나와있음
간단하게 설명하자면
1. repository RPM 설치
1 | # yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm |
2. client 패키지 설치
1 | # yum install postgresql12 |
3. 서버 패키지 설치
1 | # yum install postgresql12-server |
rpm 파일을 이용한 PostgreSQL 12 수동 설치
https://www.postgresql.org 사이트에서 아래의 4개 파일을 다운로드 받음
(https://yum.postgresql.org/12/redhat/rhel-7-x86_64/repoview/postgresqldbserver12.group.html)
postgresql12-libs-12.0-1PGDG.rhel7.x86_64.rpm
postgresql12-12.0-1PGDG.rhel7.x86_64.rpm
postgresql12-server-12.0-1PGDG.rhel7.x86_64.rpm
postgresql12-contrib-12.0-1PGDG.rhel7.x86_64.rpm
다운받은 이후 순서대로 설치
1 2 3 4 | # rpm -ivh postgresql12-libs-12.0-1PGDG.rhel7.x86_64.rpm # rpm -ivh postgresql12-12.0-1PGDG.rhel7.x86_64.rpm # rpm -ivh postgresql12-server-12.0-1PGDG.rhel7.x86_64.rpm # rpm -ivh postgresql12-contrib-12.0-1PGDG.rhel7.x86_64.rpm |
설치되는 경로 : /usr/pgsql-12
postgresql12-libs는 바로 설치가 되었지만 postgresql12 는 문제가 발생함
1 2 3 4 | # rpm -ivh postgresql12-12.0-1PGDG.rhel7.x86_64.rpm warning: postgresql12-12.0-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY error: Failed dependencies: python36-libs is needed by postgresql12-12.0-1PGDG.rhel7.x86_64 |
의존성 문제인데 먼저 python36-libs를 설치해야 한다는 내용임
그래서 https://pkgs.org/download/python36-libs 에 접속해서 해당 패키지를 다운로드 받음
하지만 python36-libs을 설치하기 위해선 아래 3가지를 먼저 설치해야함
python3, version : 3.6.8-10.0.1.el7 설치링크 : https://pkgs.org/download/python3
python3-pip, version : 9.0.3-5.el7 설치링크 : https://pkgs.org/download/python3-pip
python3-setuptools, version : 39.2.0-10.el7 설치링크 : https://pkgs.org/download/python3-setuptools
해당 패키지 먼저 설치
1 2 3 | # rpm -ivh python3-3.6.8-10.el7.x86_64.rpm # rpm -ivh python3-pip-9.0.3-5.el7.noarch.rpm # rpm -ivh python3-setuptools-39.2.0-10.el7.noarch.rpm |
이후 python36 설치
1 | # rpm -ivh python36-3.6.8-1.el7.x86_64.rpm |
이후 다시 postgresql12 설치
1 2 3 4 5 | # rpm -ivh postgresql12-12.0-1PGDG.rhel7.x86_64.rpm warning: postgresql12-12.0-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ################################# [100%] Updating / installing... 1:postgresql12-12.0-1PGDG.rhel7 ################################# [100%] |
그리고 postgresql12-server 설치
1 2 3 4 5 | # rpm -ivh postgresql12-server-12.0-1PGDG.rhel7.x86_64.rpm warning: postgresql12-server-12.0-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ################################# [100%] Updating / installing... 1:postgresql12-server-12.0-1PGDG.rh################################# [100%] |
그리고 남은 postgresql12-contrib 설치
1 2 3 4 | # rpm -ivh postgresql12-contrib-12.0-1PGDG.rhel7.x86_64.rpm Preparing... ################################# [100%] Updating / installing... 1:postgresql12-contrib-12.0-1PGDG.r################################# [100%] |
정상적으로 설치됨
5432 포트 방화벽 허용(기본 포트)
1 2 | # firewall-cmd --zone=public --add-port=5432/tcp success |
postgres 유저 생성 및 패스워드 변경
1 2 3 4 5 6 7 | # useradd postgres # passwd postgres Changing password for user postgres. New password: //postgres 입력 BAD PASSWORD: The password contains the user name in some form Retype new password: //postgres 입력 passwd: all authentication tokens updated successfully. |
1 2 | # su - postgres Last login: Thu Oct 24 22:02:30 KST 2019 on pts/1 |
.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-12/lib export PATH=$PATH:/usr/pgsql-12/bin export PGHOME=/usr/pgsql-12 export PGDATA=/home/postgres/DATA export PGDATABASE=postgres export PGUSER=postgres export PGPORT=5432 #pg export setting# |
vi 로 .bash_profile 열어서 위 구문 추가 후 저장
적용 . ./.bash_profile
1 2 | -bash-4.2$ . ./.bash_profile // 기존:-bash-4.2$가 나옴 [postgres@PG ~]$ // 변경후: 유저명@hostname이나옴 |
데이터베이스 저장소 생성
(.bash_profile 에 지정한 PGDATA=/home/postgres/DATA 여기에 생성됨)
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. fixing permissions on existing directory /home/postgres/DATA ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Seoul creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: 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-12/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' |
(해당 계정의 실행/쓰기 권한이 있는 temporary 경로를 넣어주면됨)
외부 접속을 위한 보안 설정
1 2 3 4 5 6 7 8 9 10 | $ vi $PGDATA/pg_hba.conf # "local" is for Unix domain socket connections only #local all all trust //이부분을 주석처리하고 local all all md5 이렇게 변경(추가) # 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 //이렇게 변경(추가) |
1 2 3 4 | $ $PGHOME/bin/pg_ctl -D $PGDATA -l logfile start waiting for server to start.... stopped waiting pg_ctl: could not start server Examine the log output. |
1 2 3 4 5 6 7 8 9 | $ vi $PGDATA/pgsql.log 2019-10-24 22:44:15.312 KST [18806] LOG: starting PostgreSQL 12.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit 2019-10-24 22:44:15.312 KST [18806] LOG: could not bind IPv4 address "0.0.0.0": Address already in use 2019-10-24 22:44:15.312 KST [18806] HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. 2019-10-24 22:44:15.313 KST [18806] LOG: could not bind IPv6 address "::": Address already in use 2019-10-24 22:44:15.313 KST [18806] HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. 2019-10-24 22:44:15.313 KST [18806] WARNING: could not create listen socket for "*" 2019-10-24 22:44:15.313 KST [18806] FATAL: could not create any TCP/IP sockets 2019-10-24 22:44:15.313 KST [18806] LOG: database system is shut down |
1 2 3 4 5 6 7 | $ cat $PGDATA/pg_hba.conf # "local" is for Unix domain socket connections only local all all md5 # IPv4 local connections: host all all 0.0.0.0/0l md5 # IPv6 local connections: host all all ::1/128 md5 |
1 2 3 | $ $PGHOME/bin/pg_ctl -D $PGDATA -l $PGDATA/pgsql.log start waiting for server to start.... done server started |
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"? |
1 2 3 4 5 6 | $ cd /var/run/postgresql/ $ ls -al total 0 drwxr-xr-x. 2 postgres postgres 60 Oct 24 23:19 . drwxr-xr-x. 27 root root 840 Oct 24 22:46 .. srwxrwxrwx. 1 postgres postgres 0 Oct 24 22:46 .s.PGSQL.5432 |
1 2 3 4 5 6 | $ mv .s.PGSQL.5432 .s.PGSQL.5432bak $ ls -al total 0 drwxr-xr-x. 2 postgres postgres 80 Oct 24 23:24 . drwxr-xr-x. 27 root root 840 Oct 24 22:46 .. srwxrwxrwx. 1 postgres postgres 0 Oct 24 22:46 .s.PGSQL.5432bak |
1 2 3 4 5 6 7 | $ ln -s $PGDATA/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432 $ ls -al total 0 drwxr-xr-x. 2 postgres postgres 80 Oct 24 23:24 . drwxr-xr-x. 27 root root 840 Oct 24 22:46 .. lrwxrwxrwx. 1 postgres postgres 33 Oct 24 23:24 .s.PGSQL.5432 -> /home/postgres/DATA/.s.PGSQL.5432 srwxrwxrwx. 1 postgres postgres 0 Oct 24 22:46 .s.PGSQL.5432bak |
1 2 3 | $ psql Password for user postgresql: //postgres 입력 psql: error: could not connect to server: FATAL: password authentication failed for user "postgresql" |
1 2 3 4 5 6 7 | $ vi $PGDATA/pg_hba.conf # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 0.0.0.0/0 md5 # IPv6 local connections: host all all ::1/128 md5 |
1 2 3 4 5 | $ $PGHOME/bin/pg_ctl -D $PGDATA -l $PGDATA/pgsql.log restart waiting for server to shut down.... done server stopped waiting for server to start.... done server started |
1 2 | $ psql psql: error: could not connect to server: FATAL: role "postgresql" does not exist |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | $ psql --username=postgres --dbname=postgres psql (12.0) 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) |
1 2 3 4 | postgres=# \password postgres Enter new password: //postgres 입력 Enter it again: //postgres 입력 postgres=# \q |
1 2 3 4 5 | postgres=# create user scott postgres-# \password scott Enter new password: //tiger 입력 Enter it again: //tiger 입력 ERROR: role "scott" does not exist |
1 2 3 4 5 6 7 | postgres=# create role scott login; CREATE ROLE postgres=# create user scott; ERROR: role "scott" already exists postgres=# \password scott Enter new password: //tiger 입력 Enter it again: //tiger 입력 |
yum 을 이용한 PostgreGIS 자동 설치
1 2 3 4 | # yum install epel-release # yum install postgis24_10.x86_64 # su - postgres $ $PGHOME/bin/pg_ctl -D $PGDATA -l $PGDATA/pgsql.log restart |
tar.gz 파일을 이용한 PostgreGIS 수동 설치
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%] |
root 계정으로 postgis-3.0.0.tar.gz 파일 postgres 계정의 home 경로로 이동시킨 후 권한 부여
1 2 | # mv postgis-3.0.0.tar.gz /home/postgres/ # chown postgres:postgres /home/postgres/postgis-3.0.0.tar.gz |
1 2 3 | # su - postgres Last login: Fri Oct 25 00:18:24 KST 2019 on pts/1 $ tar xvfz postgis-3.0.0.tar.gz |
1 2 3 4 5 6 7 8 9 10 11 12 | $ cd postgis-3.0.0 $ ./configure checking for a BSD-compatible install... /bin/install -c checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking how to print strings... printf checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/home/postgres/postgis-3.0.0': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details |
1 2 3 4 5 6 7 8 | gcc gcc-c++ make proj 4.9 이상 geos 3.7 이상 libxml2 2.5이상 json-c 0.9이상 gdal 1.9이상 |
1 2 3 | # yum install gcc -y # yum install gcc-c++ -y # yum install make -y |
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-39.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-39.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. |
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 |
1 | # tar -xvf geos-3.7.3.tar.bz2 |
1 | # yum install bzip2 -y |
1 2 | # cd geos-3.7.3 # ./configure --prefix=$LOCALDESTDIR && make && make install |
1 2 | # geos-config --version 3.7.3 |
1 2 3 4 5 6 7 8 9 | # yum install libxml2 -y Loaded plugins: ulninfo Package libxml2-2.9.1-6.0.1.el7_2.3.x86_64 already installed and latest version Nothing to do # yum install json-c -y Loaded plugins: ulninfo Package json-c-0.11-4.el7_0.x86_64 already installed and latest version Nothing to do |
1 2 3 4 5 6 7 8 9 | # yun install -y gdal . . Error: Package: gdal-libs-1.11.4-12.rhel7.x86_64 (pgdg10) Requires: libdapclient.so.6()(64bit) Error: Package: gdal-libs-1.11.4-12.rhel7.x86_64 (pgdg10) Requires: libhdf5.so.8()(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest |
1 | # tar -xvf gdal-2.2.2.tar.gz |
1 2 | # cd gdal-2.2.2 # ./configure && make && make install |
1 2 3 4 5 6 7 8 | # su - postgres Last login: Sun Oct 27 16:34:00 KST 2019 on pts/1 $ cd postgis-3.0.0 $ ./configure . . checking for perl... no configure: error: Perl was not found. Building PostGIS requires Perl. |
1 | # yum install perl -y |
1 2 3 4 5 6 7 8 | # su - postgres Last login: Sun Oct 27 16:40:40 KST 2019 on pts/1 $ cd postgis-3.0.0 $ ./configure . . checking for pg_config... /usr/pgsql-12/bin/pg_config configure: error: the PGXS Makefile /usr/pgsql-12/lib/pgxs/src/makefiles/pgxs.mk cannot be found. Please install the PostgreSQL server development packages and re-run configure. |
알아보니 dev 버전을 다운로드 하면 해당 파일이 생긴하고 하는데
dev버전은 9.2 버전밖에 존재하지 않음..
https://pkgs.org/download/postgresql-devel
일단 9.2버전은 yum으로 설치함
1 | # yum install postgresql-devel |
다시 PostGIS 설치
1 2 3 4 5 6 7 8 | # su - postgres $ cd postgis-3.0.0 $ ./configure . . checking for pg_config... /bin/pg_config checking PostgreSQL version... PostgreSQL 9.2.24 configure: error: PostGIS requires PostgreSQL >= 9.5 |
pgxs 문제는 넘어갔지만
postgresql 버전을 12가 아닌 9.2로 인식해서 설치되지 않음
차선책으로
postgres 계정으로 접속 후 pg_config 명령으로 pgxs.mk 파일을 에러 메세지에 나온 곳으로 복사함
1 2 3 4 | # mkdir -p /usr/pgsql-12/lib/pgxs/src/makefiles/ # su - postgres $ pg_config PGXS = /usr/lib64/pgsql/pgxs/src/makefiles/pgxs.mk |
1 | # cp /usr/lib64/pgsql/pgxs/src/makefiles/pgxs.mk /usr/pgsql-12/lib/pgxs/src/makefiles/ |
1 | # yum remove postgresql-devel |
1 2 3 4 5 6 7 | # su - postgres $ cd postgis-3.0.0 $ ./configure --with-pgconfig=/usr/pgsql-12/bin/pg_config . . checking for libpq-fe.h... no configure: error: could not find libpq-fe.h |
1 2 3 4 5 6 7 8 | # yum install postgresql-devel -y # su - postgres $ cd postgis-3.0.0 $ ./configure --with-pgconfig=/usr/pgsql-12/bin/pg_config . . 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. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # yum install libxml2-devel -y # su - postgres $ cd postgis-3.0.0 $ ./configure --with-pgconfig=/usr/pgsql-12/bin/pg_config . . checking for JSONC... no configure: error: Package requirements (json-c) were not met: No package 'json-c' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables JSONC_CFLAGS and JSONC_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. |
1 2 3 4 5 6 7 8 9 | # su - postgres $ cd postgis-3.0.0 $ ./configure --with-pgconfig=/usr/pgsql-12/bin/pg_config --with-jsondir=/usr/lib64/libjson.so.0 . . Using user-specified json-c directory: /usr/lib64/libjson.so.0 checking for "/usr/lib64/libjson.so.0/include/json-c/json.h"... no checking for "/usr/lib64/libjson.so.0/include/json/json.h"... no configure: error: Could not find header: json.h |
1 2 3 4 5 6 7 | $ ./configure --with-pgconfig=/usr/pgsql-12/bin/pg_config --with-jsondir=/usr/lib64 . . Using user-specified json-c directory: /usr/lib64 checking for "/usr/lib64/include/json-c/json.h"... no checking for "/usr/lib64/include/json/json.h"... no configure: error: Could not find header: json.h |
1 2 | # find /usr/ -name "json.h" /usr/include/pgsql/server/utils/json.h |
1 2 3 4 | # mkdir -p /usr/lib64/include/json/ # mkdir -p /usr/lib64/include/json-c/ # cp /usr/include/pgsql/server/utils/json.h /usr/lib64/include/json/ # cp /usr/include/pgsql/server/utils/json.h /usr/lib64/include/json-c/ |
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 42 43 44 45 46 47 48 49 | $ ./configure --with-pgconfig=/usr/pgsql-12/bin/pg_config --with-jsondir=/usr/lib64 . . PostGIS is now configured for x86_64-pc-linux-gnu -------------- Compiler Info ------------- C compiler: gcc -std=gnu99 -g -O2 -fno-math-errno -fno-signed-zeros CPPFLAGS: -I/include -I/usr/include/libxml2 -I/usr/lib64/include/json-c 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.2.2 PostgreSQL config: /usr/pgsql-12/bin/pg_config PostgreSQL version: PostgreSQL 12.0 PROJ4 version: 49 Libxml2 config: /bin/xml2-config Libxml2 version: 2.9.1 JSON-C support: no protobuf support: no PCRE support: yes Perl: /bin/perl Wagyu: no --------------- Extensions --------------- PostGIS Raster: enabled PostGIS Topology: enabled SFCGAL support: disabled Address Standardizer support: enabled -------- Documentation Generation -------- xsltproc: /bin/xsltproc xsl style sheets: dblatex: convert: mathml2.dtd: http://www.w3.org/Math/DTD/mathml2/mathml2.dtd configure: WARNING: configure: WARNING: | You are building using --with-jsondir. This option isn't standard and | configure: WARNING: | might be incompatible with future releases of json-c. | configure: WARNING: | You can instead adjust the PKG_CONFIG_PATH environment variable if you | configure: WARNING: | installed software in a non-standard prefix. | configure: WARNING: | Alternatively, you may set the environment variables JSONC_CFLAGS and | configure: WARNING: | JSONC_LIBS to avoid the need to call pkg-config. | |
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 |
1 2 | $ psql --username=postgres --dbname=postgres psql: symbol lookup error: psql: undefined symbol: pqsignal |
1 2 3 4 5 6 7 8 | # cp /usr/pgsql-12/bin/psql /usr/ # cp /usr/pgsql-12/bin/psql /usr/bin/ # su - postgres $ psql --username=postgres --dbname=postgres psql (12.0) Type "help" for help. postgres=# |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | $ psql --username=postgres --dbname=postgres psql (12.0) Type "help" for help. postgres=# SELECT version(); version --------------------------------------------------------------------------------------------------------- PostgreSQL 12.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit (1 row) postgres=# 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. |
백업방법
$ pg_dump -h localhost -U postgres -Fc postgres > imsi01.dmp
참조 : https://m.blog.naver.com/kharma77/221272584481
https://www.postgresql.org/download/linux/redhat/
http://www.gisdeveloper.co.kr/?p=5087
https://waspro.tistory.com/378https://askubuntu.com/questions/50621/cannot-connect-to-postgresql-on-port-5432
https://postgis.net/docs/manual-3.0/postgis_installation.html#install_requirements
http://postgis.net/docs/manual-3.0/postgis-ko_KR.html#install_requirements
https://m.blog.naver.com/tommybee/50173880352
http://mwultong.blogspot.com/2007/07/tarbz2-tarbz2-bzip2.html
'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 |
linux7.6에 PostgreSQL 10 + PostGIS 2.5.3 구성하기(실패) (0) | 2019.10.28 |
Postgresql 과 PostGIS의 지원 매트릭스 문서 (0) | 2019.10.25 |