postgres install + postgis install(-)

postgres 安装+gis安装,以下采用 tarball 作为安装介质(rpm包不好用,可控性太小),由于需要配置gis,依赖非常多,且版本要求严格,搞了好久终于搞定了所有错误,记录下安装过程遇到的所有问题,不然下次又不记得了。

采用postgres-9.3.5(以下所有依赖同样适用于postgres-9.4.0版本)
gis采用 postgis-2.1.7 版本

先贴出来版本对应要求:








----注意:以下为安装记录过程,没有按照正确的顺序重新梳理一遍,也是为了说明下产生错误的原因以及解决办法。
1、安装postgresql
[root@cdh3 data]# tar -xvzf /root/rpm\(64\)/postgresql-9.3.5.tar.gz
[root@cdh3 data]# cd postgresql-9.3.5/
[root@cdh3 postgresql-9.3.5]# ./configure --prefix=/data/postgresql-9.3.5
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking which template to use... linux
checking whether to build with 64-bit integer date/time support... yes
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for WAL segment size... 16MB
checking for gcc... no
checking for cc... no
configure: error: in `/data/postgresql-9.3.5':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
[root@cdh3 postgresql-9.3.5]#

---C compiler错误,安装系统包

[root@cdh3 postgresql-9.3.5]# yum install gcc-4.4.7-3.el6.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
CentOS6.4                                                                                             | 4.0 kB     00:00     
Setting up Install Process
Resolving Dependencies
--&gt Running transaction check
---&gt Package gcc.x86_64 0:4.4.7-3.el6 will be installed
--&gt Processing Dependency: cpp = 4.4.7-3.el6 for package: gcc-4.4.7-3.el6.x86_64
--&gt Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.4.7-3.el6.x86_64
--&gt Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-3.el6.x86_64
--&gt Running transaction check
---&gt Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed
--&gt Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
--&gt Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
---&gt Package cpp.x86_64 0:4.4.7-3.el6 will be installed
--&gt Processing Dependency: libmpfr.so.1()(64bit) for package: cpp-4.4.7-3.el6.x86_64
---&gt Package glibc-devel.x86_64 0:2.12-1.107.el6 will be installed
--&gt Processing Dependency: glibc-headers = 2.12-1.107.el6 for package: glibc-devel-2.12-1.107.el6.x86_64
--&gt Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.107.el6.x86_64
--&gt Running transaction check
---&gt Package glibc-headers.x86_64 0:2.12-1.107.el6 will be installed
--&gt Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.107.el6.x86_64
--&gt Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.107.el6.x86_64
---&gt Package mpfr.x86_64 0:2.4.1-6.el6 will be installed
---&gt Package ppl.x86_64 0:0.10.2-11.el6 will be installed
--&gt Running transaction check
---&gt Package kernel-headers.x86_64 0:2.6.32-358.el6 will be installed
--&gt Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
 Package                         Arch                    Version                            Repository                  Size
=============================================================================================================================
Installing:
 gcc                             x86_64                  4.4.7-3.el6                        CentOS6.4                   10 M
Installing for dependencies:
 cloog-ppl                       x86_64                  0.15.7-1.2.el6                     CentOS6.4                   93 k
 cpp                             x86_64                  4.4.7-3.el6                        CentOS6.4                  3.7 M
 glibc-devel                     x86_64                  2.12-1.107.el6                     CentOS6.4                  974 k
 glibc-headers                   x86_64                  2.12-1.107.el6                     CentOS6.4                  604 k
 kernel-headers                  x86_64                  2.6.32-358.el6                     CentOS6.4                  2.3 M
 mpfr                            x86_64                  2.4.1-6.el6                        CentOS6.4                  157 k
 ppl                             x86_64                  0.10.2-11.el6                      CentOS6.4                  1.3 M

Transaction Summary
=============================================================================================================================
Install       8 Package(s)

Total download size: 19 M
Installed size: 38 M
Is this ok [y/N]: y
Downloading Packages:
(1/8): kernel-headers-2.6.32-358.el6.x86_64.rpm                                                       | 2.3 MB     00:00     
(2/8): glibc-devel-2.12-1.107.el6.x86_64.rpm                                                          | 974 kB     00:00     
(3/8): gcc-4.4.7-3.el6.x86_64.rpm                                                                     |  10 MB     00:00     
(4/8): mpfr-2.4.1-6.el6.x86_64.rpm                                                                    | 157 kB     00:00     
(5/8): cpp-4.4.7-3.el6.x86_64.rpm                                                                     | 3.7 MB     00:00     
(6/8): ppl-0.10.2-11.el6.x86_64.rpm                                                                   | 1.3 MB     00:00     
(7/8): cloog-ppl-0.15.7-1.2.el6.x86_64.rpm                                                            |  93 kB     00:00     
(8/8): glibc-headers-2.12-1.107.el6.x86_64.rpm                                                        | 604 kB     00:00     
-----------------------------------------------------------------------------------------------------------------------------
Total                                                                                         30 MB/s |  19 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : ppl-0.10.2-11.el6.x86_64                                                                                  1/8
  Installing : cloog-ppl-0.15.7-1.2.el6.x86_64                                                                           2/8
  Installing : mpfr-2.4.1-6.el6.x86_64                                                                                   3/8
  Installing : cpp-4.4.7-3.el6.x86_64                                                                                    4/8
  Installing : kernel-headers-2.6.32-358.el6.x86_64                                                                      5/8
  Installing : glibc-headers-2.12-1.107.el6.x86_64                                                                       6/8
  Installing : glibc-devel-2.12-1.107.el6.x86_64                                                                         7/8
  Installing : gcc-4.4.7-3.el6.x86_64                                                                                    8/8
Unable to connect to dbus
  Verifying  : kernel-headers-2.6.32-358.el6.x86_64                                                                      1/8
  Verifying  : glibc-devel-2.12-1.107.el6.x86_64                                                                         2/8
  Verifying  : gcc-4.4.7-3.el6.x86_64                                                                                    3/8
  Verifying  : mpfr-2.4.1-6.el6.x86_64                                                                                   4/8
  Verifying  : cpp-4.4.7-3.el6.x86_64                                                                                    5/8
  Verifying  : ppl-0.10.2-11.el6.x86_64                                                                                  6/8
  Verifying  : cloog-ppl-0.15.7-1.2.el6.x86_64                                                                           7/8
  Verifying  : glibc-headers-2.12-1.107.el6.x86_64                                                                       8/8

Installed:
  gcc.x86_64 0:4.4.7-3.el6                                                                                                   

Dependency Installed:
  cloog-ppl.x86_64 0:0.15.7-1.2.el6        cpp.x86_64 0:4.4.7-3.el6                  glibc-devel.x86_64 0:2.12-1.107.el6   
  glibc-headers.x86_64 0:2.12-1.107.el6    kernel-headers.x86_64 0:2.6.32-358.el6    mpfr.x86_64 0:2.4.1-6.el6             
  ppl.x86_64 0:0.10.2-11.el6              

Complete!
[root@cdh3 postgresql-9.3.5]#
[root@cdh3 postgresql-9.3.5]#

[root@cdh3 postgresql-9.3.5]# ./configure --prefix=/data/postgresql-9.3.5
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking which template to use... linux
checking whether to build with 64-bit integer date/time support... yes
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for WAL segment size... 16MB
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc supports -Wdeclaration-after-statement... yes
checking whether gcc supports -Wendif-labels... yes
checking whether gcc supports -Wmissing-format-attribute... yes
checking whether gcc supports -Wformat-security... yes
checking whether gcc supports -fno-strict-aliasing... yes
checking whether gcc supports -fwrapv... yes
checking whether gcc supports -fexcess-precision=standard... no
checking whether gcc supports -funroll-loops... yes
checking whether gcc supports -ftree-vectorize... yes
checking whether the C compiler still works... yes
checking how to run the C preprocessor... gcc -E
checking allow thread-safe client libraries... yes
checking whether to build with Tcl... no
checking whether to build Perl modules... no
checking whether to build Python modules... no
checking whether to build with GSSAPI support... no
checking whether to build with Kerberos 5 support... no
checking whether to build with PAM support... no
checking whether to build with LDAP support... no
checking whether to build with Bonjour support... no
checking whether to build with OpenSSL support... no
checking whether to build with SELinux support... no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for ranlib... ranlib
checking for strip... strip
checking whether it is possible to strip libraries... yes
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for tar... /bin/tar
checking whether ln -s works... yes
checking for gawk... gawk
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for bison... no
configure: WARNING:
*** Without Bison you will not be able to build PostgreSQL from Git nor
*** change any of the parser definition files.  You can obtain Bison from
*** a GNU mirror site.  (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this, because the Bison
*** output is pre-generated.)
checking for flex... no
configure: WARNING:
*** Without Flex you will not be able to build PostgreSQL from Git nor
*** change any of the scanner definition files.  You can obtain Flex from
*** a GNU mirror site.  (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this because the Flex
*** output is pre-generated.)
checking for perl... /usr/bin/perl
configure: using perl 5.10.1
checking for main in -lm... yes
checking for library containing setproctitle... no
checking for library containing dlopen... -ldl
checking for library containing socket... none required
checking for library containing shl_load... no
checking for library containing getopt_long... none required
checking for library containing crypt... -lcrypt
checking for library containing fdatasync... none required
checking for library containing gethostbyname_r... none required
checking for library containing shmget... none required
checking for library containing readline... no
configure: error: readline library not found
If you have readline already installed, see config.log for details on the
failure.  It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.
[root@cdh3 postgresql-9.3.5]#
[root@cdh3 postgresql-9.3.5]#

--缺少 readline 系统包

[root@cdh3 postgresql-9.3.5]# yum install readline-devel-6.0-4.el6.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--&gt Running transaction check
---&gt Package readline-devel.x86_64 0:6.0-4.el6 will be installed
--&gt Processing Dependency: ncurses-devel for package: readline-devel-6.0-4.el6.x86_64
--&gt Running transaction check
---&gt Package ncurses-devel.x86_64 0:5.7-3.20090208.el6 will be installed
--&gt Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
 Package                        Arch                   Version                               Repository                 Size
=============================================================================================================================
Installing:
 readline-devel                 x86_64                 6.0-4.el6                             CentOS6.4                 134 k
Installing for dependencies:
 ncurses-devel                  x86_64                 5.7-3.20090208.el6                    CentOS6.4                 642 k

Transaction Summary
=============================================================================================================================
Install       2 Package(s)

Total download size: 776 k
Installed size: 2.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): readline-devel-6.0-4.el6.x86_64.rpm                                                            | 134 kB     00:00     
(2/2): ncurses-devel-5.7-3.20090208.el6.x86_64.rpm                                                    | 642 kB     00:00     
-----------------------------------------------------------------------------------------------------------------------------
Total                                                                                         22 MB/s | 776 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : ncurses-devel-5.7-3.20090208.el6.x86_64                                                                   1/2
  Installing : readline-devel-6.0-4.el6.x86_64                                                                           2/2
Unable to connect to dbus
  Verifying  : readline-devel-6.0-4.el6.x86_64                                                                           1/2
  Verifying  : ncurses-devel-5.7-3.20090208.el6.x86_64                                                                   2/2

Installed:
  readline-devel.x86_64 0:6.0-4.el6                                                                                          

Dependency Installed:
  ncurses-devel.x86_64 0:5.7-3.20090208.el6                                                                                  

Complete!
[root@cdh3 postgresql-9.3.5]#

[root@cdh3 postgresql-9.3.5]# ./configure --prefix=/data/postgresql-9.3.5
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking which template to use... linux
checking whether to build with 64-bit integer date/time support... yes
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for WAL segment size... 16MB
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc supports -Wdeclaration-after-statement... yes
checking whether gcc supports -Wendif-labels... yes
checking whether gcc supports -Wmissing-format-attribute... yes
checking whether gcc supports -Wformat-security... yes
checking whether gcc supports -fno-strict-aliasing... yes
checking whether gcc supports -fwrapv... yes
checking whether gcc supports -fexcess-precision=standard... no
checking whether gcc supports -funroll-loops... yes
checking whether gcc supports -ftree-vectorize... yes
checking whether the C compiler still works... yes
checking how to run the C preprocessor... gcc -E
checking allow thread-safe client libraries... yes
checking whether to build with Tcl... no
checking whether to build Perl modules... no
checking whether to build Python modules... no
checking whether to build with GSSAPI support... no
checking whether to build with Kerberos 5 support... no
checking whether to build with PAM support... no
checking whether to build with LDAP support... no
checking whether to build with Bonjour support... no
checking whether to build with OpenSSL support... no
checking whether to build with SELinux support... no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for ranlib... ranlib
checking for strip... strip
checking whether it is possible to strip libraries... yes
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for tar... /bin/tar
checking whether ln -s works... yes
checking for gawk... gawk
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for bison... no
configure: WARNING:
*** Without Bison you will not be able to build PostgreSQL from Git nor
*** change any of the parser definition files.  You can obtain Bison from
*** a GNU mirror site.  (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this, because the Bison
*** output is pre-generated.)
checking for flex... no
configure: WARNING:
*** Without Flex you will not be able to build PostgreSQL from Git nor
*** change any of the scanner definition files.  You can obtain Flex from
*** a GNU mirror site.  (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this because the Flex
*** output is pre-generated.)
checking for perl... /usr/bin/perl
configure: using perl 5.10.1
checking for main in -lm... yes
checking for library containing setproctitle... no
checking for library containing dlopen... -ldl
checking for library containing socket... none required
checking for library containing shl_load... no
checking for library containing getopt_long... none required
checking for library containing crypt... -lcrypt
checking for library containing fdatasync... none required
checking for library containing gethostbyname_r... none required
checking for library containing shmget... none required
checking for library containing readline... -lreadline
checking for inflate in -lz... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking crypt.h usability... yes
checking crypt.h presence... yes
checking for crypt.h... yes
checking dld.h usability... no
checking dld.h presence... no
checking for dld.h... no
checking fp_class.h usability... no
checking fp_class.h presence... no
checking for fp_class.h... no
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking ieeefp.h usability... no
checking ieeefp.h presence... no
checking for ieeefp.h... no
checking ifaddrs.h usability... yes
checking ifaddrs.h presence... yes
checking for ifaddrs.h... yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking sys/pstat.h usability... no
checking sys/pstat.h presence... no
checking for sys/pstat.h... no
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/sem.h usability... yes
checking sys/sem.h presence... yes
checking for sys/sem.h... yes
checking sys/shm.h usability... yes
checking sys/shm.h presence... yes
checking for sys/shm.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking sys/tas.h usability... no
checking sys/tas.h presence... no
checking for sys/tas.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking ucred.h usability... no
checking ucred.h presence... no
checking for ucred.h... no
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking for net/if.h... yes
checking for sys/ucred.h... no
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for netinet/tcp.h... yes
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking readline/history.h usability... yes
checking readline/history.h presence... yes
checking for readline/history.h... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for quiet inline (no complaint if unreferenced)... yes
checking for preprocessor stringizing operator... yes
checking for flexible array members... yes
checking for signed types... yes
checking for working volatile... yes
checking for __func__... yes
checking for _Static_assert... no
checking for __builtin_types_compatible_p... yes
checking for __builtin_constant_p... yes
checking for __builtin_unreachable... yes
checking for __VA_ARGS__... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... yes
checking for tzname... yes
checking for union semun... no
checking for struct sockaddr_un... yes
checking for struct sockaddr_storage... yes
checking for struct sockaddr_storage.ss_family... yes
checking for struct sockaddr_storage.__ss_family... no
checking for struct sockaddr_storage.ss_len... no
checking for struct sockaddr_storage.__ss_len... no
checking for struct sockaddr.sa_len... no
checking for struct addrinfo... yes
checking for intptr_t... yes
checking for uintptr_t... yes
checking for long long int... yes
checking for locale_t... yes
checking for struct cmsgcred... no
checking for struct option... yes
checking for z_streamp... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of off_t... 8
checking for int timezone... yes
checking types of arguments for accept()... int, int, struct sockaddr *, socklen_t *
checking whether gettimeofday takes only one argument... no
checking for cbrt... yes
checking for dlopen... yes
checking for fdatasync... yes
checking for getifaddrs... yes
checking for getpeerucred... no
checking for getrlimit... yes
checking for mbstowcs_l... no
checking for memmove... yes
checking for poll... yes
checking for pstat... no
checking for readlink... yes
checking for setproctitle... no
checking for setsid... yes
checking for sigprocmask... yes
checking for symlink... yes
checking for sync_file_range... yes
checking for towlower... yes
checking for utime... yes
checking for utimes... yes
checking for wcstombs... yes
checking for wcstombs_l... no
checking for fseeko... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for posix_fadvise... yes
checking whether posix_fadvise is declared... yes
checking whether fdatasync is declared... yes
checking whether strlcat is declared... no
checking whether strlcpy is declared... no
checking whether F_FULLFSYNC is declared... no
checking for struct sockaddr_in6... yes
checking for PS_STRINGS... no
checking for snprintf... yes
checking for vsnprintf... yes
checking whether snprintf is declared... yes
checking whether vsnprintf is declared... yes
checking for isinf... yes
checking for crypt... yes
checking for fls... no
checking for getopt... yes
checking for getrusage... yes
checking for inet_aton... yes
checking for mkdtemp... yes
checking for random... yes
checking for rint... yes
checking for srandom... yes
checking for strerror... yes
checking for strlcat... no
checking for strlcpy... no
checking for unsetenv... yes
checking for getpeereid... no
checking for getaddrinfo... yes
checking for getopt_long... yes
checking for sigsetjmp... yes
checking whether sys_siglist is declared... yes
checking for syslog... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for opterr... yes
checking for optreset... no
checking for strtoll... yes
checking for strtoull... yes
checking for builtin locking functions... yes
checking for rl_completion_append_character... yes
checking for rl_completion_matches... yes
checking for rl_filename_completion_function... yes
checking for append_history... yes
checking for history_truncate_file... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking whether pthreads work with -pthreads... no
checking whether pthreads work with -mthreads... no
checking for the pthreads library -lpthread... yes
checking whether pthreads work with --thread-safe... no
checking whether pthreads work with -mt... no
checking for the pthreads library -lpthreadGC2... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for strerror_r... yes
checking for getpwuid_r... yes
checking for gethostbyname_r... yes
checking whether getpwuid_r takes a fifth argument... yes
checking whether strerror_r returns int... no
checking test program... ok
checking whether long int is 64 bits... yes
checking size of void *... 8
checking size of size_t... 8
checking size of long... 8
checking whether to build with float4 passed by value... yes
checking whether to build with float8 passed by value... yes
checking alignment of short... 2
checking alignment of int... 4
checking alignment of long... 8
checking alignment of double... 8
checking for int8... no
checking for uint8... no
checking for int64... no
checking for uint64... no
checking for sig_atomic_t... yes
checking for POSIX signal interface... yes
checking for working memcmp... yes
checking for onsgmls... no
checking for nsgmls... no
checking for openjade... no
checking for jade... no
checking for DocBook V4.2... no
checking for DocBook stylesheets... no
checking for collateindex.pl... no
checking for xsltproc... xsltproc
checking for osx... no
checking for sgml2xml... no
checking for sx... no
checking thread safety of required library functions... yes
checking whether gcc supports -Wl,--as-needed... yes
configure: using compiler=gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
configure: using CFLAGS=-O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv
configure: using CPPFLAGS= -D_GNU_SOURCE
configure: using LDFLAGS=  -Wl,--as-needed
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating src/Makefile.global
config.status: creating src/include/pg_config.h
config.status: creating src/include/pg_config_ext.h
config.status: creating src/interfaces/ecpg/include/ecpg_config.h
config.status: linking src/backend/port/tas/dummy.s to src/backend/port/tas.s
config.status: linking src/backend/port/dynloader/linux.c to src/backend/port/dynloader.c
config.status: linking src/backend/port/sysv_sema.c to src/backend/port/pg_sema.c
config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c
config.status: linking src/backend/port/unix_latch.c to src/backend/port/pg_latch.c
config.status: linking src/backend/port/dynloader/linux.h to src/include/dynloader.h
config.status: linking src/include/port/linux.h to src/include/pg_config_os.h
config.status: linking src/makefiles/Makefile.linux to src/Makefile.port
[root@cdh3 postgresql-9.3.5]#

configure通过 ,不过有警告,缺少flex,后续补上

[root@cdh3 postgresql-9.3.5]# make
make -C src all
make[1]: Entering directory `/data/postgresql-9.3.5/src'
make -C common all
make[2]: Entering directory `/data/postgresql-9.3.5/src/common'
make -C ../backend submake-errcodes
make[3]: Entering directory `/data/postgresql-9.3.5/src/backend'
prereqdir=`cd 'utils/' >/dev/null && pwd` && \
          cd '../../src/include/utils/' && rm -f errcodes.h && \
          ln -s "$prereqdir/errcodes.h" .
make[3]: Leaving directory `/data/pos
。。。。。。。。。。。
make -C config all
make[1]: Entering directory `/data/postgresql-9.3.5/config'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/data/postgresql-9.3.5/config'
All of PostgreSQL successfully made. Ready to install.

make通过

[root@cdh3 postgresql-9.3.5]# make install
make -C src install
make[1]: Entering directory `/data/postgresql-9.3.5/src'
make -C common install
。。。。。。
make[1]: Leaving directory `/data/postgresql-9.3.5/config'
PostgreSQL installation complete.

make install通过

[root@cdh3 postgresql-9.3.5]# useradd postgres
[root@cdh3 postgresql-9.3.5]# passwd postgres
更改用户 postgres 的密码 。
新的 密码:
无效的密码: WAY 过短
无效的密码: 是回文
重新输入新的 密码:
passwd: 所有的身份验证令牌已经成功更新。
[root@cdh3 postgresql-9.3.5]#
[root@cdh3 postgresql-9.3.5]# chown -R postgres:postgres /data/postgresql-9.3.5/
[root@cdh3 postgresql-9.3.5]#
[root@cdh3 postgresql-9.3.5]# su - postgres

[postgres@cdh3 ~]$ vi .bash_profile

export PGHOME=/data/postgresql-9.3.5
export PGDATA=$PGHOME/data
export PATH=$PGHOME/bin:$PATH

[postgres@cdh3 ~]$ . .bash_profile
[postgres@cdh3 ~]$
[postgres@cdh3 ~]$ 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 "zh_CN.UTF-8".
The default database encoding has accordingly been set to "UTF8".
initdb: could not find suitable text search configuration for locale "zh_CN.UTF-8"
The default text search configuration will be set to "simple".

Data page checksums are disabled.

creating directory /data/postgresql-9.3.5/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
creating configuration files ... ok
creating template1 database in /data/postgresql-9.3.5/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating collations ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... 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:

    postgres -D /data/postgresql-9.3.5/data
or
    pg_ctl -D /data/postgresql-9.3.5/data -l logfile start

[postgres@cdh3 ~]$

[postgres@cdh3 ~]$ pg_ctl start
server starting
[postgres@cdh3 ~]$ LOG:  database system was shut down at 2015-05-07 16:05:19 CST
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started

[postgres@cdh3 ~]$ ps -ef|grep postgre
postgres   495     1  0 16:05 pts/1    00:00:00 /data/pgsql-9.3.5/bin/postgres
postgres   497   495  0 16:05 ?        00:00:00 postgres: checkpointer process   
postgres   498   495  0 16:05 ?        00:00:00 postgres: writer process      
postgres   499   495  0 16:05 ?        00:00:00 postgres: wal writer process   
postgres   500   495  0 16:05 ?        00:00:00 postgres: autovacuum launcher process   
postgres   501   495  0 16:05 ?        00:00:00 postgres: stats collector process   
postgres   503 49138  0 16:06 pts/1    00:00:00 ps -ef
postgres   504 49138  0 16:06 pts/1    00:00:00 grep postgre
root     49137 35487  0 16:01 pts/1    00:00:00 su - postgres
postgres 49138 49137  0 16:01 pts/1    00:00:00 -bash

[postgres@cdh3 ~]$
[postgres@cdh3 ~]$ psql -h 127.0.0.1 -d postgres -U postgres
psql (9.3.5)
Type "help" for help.

postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-----------+----------+----------+-------------+-------------+-----------------------
 postgres  | postgres | UTF8     | zh_CN.UTF-8 | zh_CN.UTF-8 |
 template0 | postgres | UTF8     | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
(3 rows)

postgres=# \q
[postgres@cdh3 ~]$
[postgres@cdh3 ~]$

至此postgresql已经安装完成。

接下来开始安装gis,麻烦的开始。。。
详见续篇  postgres install + postgis install(二)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10037372/viewspace-1630684/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10037372/viewspace-1630684/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值