I am having trouble installing postgresql on a centos 5.4 server with linux 2.6.18-164.el5 as kernel ( vmware node ) using yum. It seems it is unable to create the configuration files while running initdb. I checked pgstartup.log and found following error :
creating conversions ... FATAL: could not load library "/usr/pgsql-9.0/lib/utf8_and_johab.so": /usr/pgsql-9.0/lib/utf8_and_johab.so: failed to map segment from shared object: Cannot allocate memory
Server has 4GB ram, so this is not an issue of low memory and this server is not so busy server. The above error is showing for version for each of the following postgresql repos :
pgdg-centos-9.0-2.noarch
pgdg-centos-8.4-2.noarch
pgdg-centos-8.3-7.noarch
The default CentOS base repo which installs postgresql-8.1.x on using yum works fine and starts the postgresql service without any problem.
Server INFO
=========================================
root@server1 [/etc/yum.repos.d]# cd
root@server1 [~]# cat /etc/redhat-release
CentOS release 5.4 (Final)
root@server1 [~]# uname -a
Linux vds02.100percentuptimenetwork.com 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
root@server1 [~]#
Here is the exact steps showing the error:
========================================================================
root@vserver1 [/opt]# cd /var/lib/rpm
root@vserver1 [/opt]# rm -f __db*
root@vserver1 [/opt]# rpm --rebuilddb -vv
( truncated )
root@vserver1 [/var/lib/rpm]# updatedb
root@vserver1 [/opt]# wget http://yum.pgsqlrpms.org/reporpms/9.0/pgdg-centos-9.0-2.noarch.rpm
root@vserver1 [/opt]# rpm -Uvh pgdg-centos-9.0-2.noarch.rpm
Preparing... ########################################### [100%]
1:pgdg-centos ########################################### [100%]
root@vserver1 [/opt]# rpm -qa | grep postgre*
root@vserver1 [/opt]#
root@vserver1 [/opt]# yum install postgresql postgresql-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirror.highspeedweb.net
* base: hpc.arc.georgetown.edu
* extras: mirror.umoss.org
* updates: mirror.rackspace.com
Excluding Packages in global exclude list
Finished
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package postgresql.x86_64 0:9.0-alpha4_1PGDG.rhel5 set to be updated
--> Processing Dependency: postgresql-libs = 9.0-alpha4_1PGDG.rhel5 for package: postgresql
--> Processing Dependency: libpq.so.5()(64bit) for package: postgresql
---> Package postgresql-server.x86_64 0:9.0-alpha4_1PGDG.rhel5 set to be updated
--> Running transaction check
---> Package postgresql-libs.x86_64 0:9.0-alpha4_1PGDG.rhel5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================
Installing:
postgresql x86_64 9.0-alpha4_1PGDG.rhel5 pgdg90 1.3 M
postgresql-server x86_64 9.0-alpha4_1PGDG.rhel5 pgdg90 4.5 M
Installing for dependencies:
postgresql-libs x86_64 9.0-alpha4_1PGDG.rhel5 pgdg90 199 k
Transaction Summary
==============================================================================================================================================================
Install 3 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 6.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): postgresql-libs-9.0-alpha4_1PGDG.rhel5.x86_64.rpm | 199 kB 00:00
(2/3): postgresql-9.0-alpha4_1PGDG.rhel5.x86_64.rpm | 1.3 MB 00:01
(3/3): postgresql-server-9.0-alpha4_1PGDG.rhel5.x86_64.rpm | 4.5 MB 00:04
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 866 kB/s | 6.0 MB 00:07
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : postgresql-libs 1/3
Installing : postgresql 2/3
Installing : postgresql-server 3/3
Installed:
postgresql.x86_64 0:9.0-alpha4_1PGDG.rhel5 postgresql-server.x86_64 0:9.0-alpha4_1PGDG.rhel5
Dependency Installed:
postgresql-libs.x86_64 0:9.0-alpha4_1PGDG.rhel5
Complete!
root@vserver1 [/opt]#
root@vserver1 [/opt]# /etc/init.d/postgresql-9.0 initdb
Initializing database: [FAILED]
root@vserver1 [/opt]# cd /var/lib/pgsql/
root@vserver1 [/var/lib/pgsql]# ll
total 20
drwx------ 3 postgres postgres 4096 Apr 21 20:49 ./
drwxr-xr-x 21 root root 4096 Apr 21 20:49 ../
drwx------ 4 postgres postgres 4096 Apr 21 20:51 9.0/
-rw-r--r-- 1 postgres postgres 85 Mar 5 04:57 .bash_profile
root@vserver1 [/var/lib/pgsql]# cd 9.0/
root@vserver1 [/var/lib/pgsql/9.0]# ll
total 20
drwx------ 4 postgres postgres 4096 Apr 21 20:51 ./
drwx------ 3 postgres postgres 4096 Apr 21 20:49 ../
drwx------ 2 postgres postgres 4096 Mar 5 04:57 backups/
drwx------ 3 postgres postgres 4096 Apr 21 20:51 data/
-rw------- 1 postgres postgres 1232 Apr 21 20:51 pgstartup.log
root@vserver1 [/var/lib/pgsql/9.0]# tail pgstartup.log
creating template1 database in /var/lib/pgsql/9.0/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... FATAL: could not load library "/usr/pgsql-9.0/lib/utf8_and_johab.so": /usr/pgsql-9.0/lib/utf8_and_johab.so: failed to map segment from shared object: Cannot allocate memory
STATEMENT: CREATE OR REPLACE FUNCTION johab_to_utf8 (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$libdir/utf8_and_johab', 'johab_to_utf8' LANGUAGE C STRICT;
child process exited with exit code 1
initdb: removing contents of data directory "/var/lib/pgsql/9.0/data"
root@vserver1 [/var/lib/pgsql/9.0]# ls /usr/pgsql-9.0/lib/utf8_and_johab.so
/usr/pgsql-9.0/lib/utf8_and_johab.so*
root@vserver1 [/var/lib/pgsql/9.0]#
Here is the logs showing successful installation of postgresql--8.1.x using yum on the same server
==============================================================================
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirror.highspeedweb.net
* base: hpc.arc.georgetown.edu
* extras: mirror.umoss.org
* updates: mirror.rackspace.com
Excluding Packages in global exclude list
Finished
Setting up Install Process
No package rh-postgresql available.
No package rh-postgresql-devel available.
No package rh-postgresql-libs available.
No package rh-postgresql-server available.
Resolving Dependencies
--> Running transaction check
---> Package postgresql.x86_64 0:8.1.18-2.el5_4.1 set to be updated
---> Package postgresql-devel.i386 0:8.1.18-2.el5_4.1 set to be updated
---> Package postgresql-devel.x86_64 0:8.1.18-2.el5_4.1 set to be updated
---> Package postgresql-libs.i386 0:8.1.18-2.el5_4.1 set to be updated
---> Package postgresql-libs.x86_64 0:8.1.18-2.el5_4.1 set to be updated
---> Package postgresql-server.x86_64 0:8.1.18-2.el5_4.1 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================
Installing:
postgresql x86_64 8.1.18-2.el5_4.1 updates 2.9 M
postgresql-devel i386 8.1.18-2.el5_4.1 updates 1.2 M
postgresql-devel x86_64 8.1.18-2.el5_4.1 updates 1.2 M
postgresql-libs i386 8.1.18-2.el5_4.1 updates 196 k
postgresql-libs x86_64 8.1.18-2.el5_4.1 updates 196 k
postgresql-server x86_64 8.1.18-2.el5_4.1 updates 3.9 M
Transaction Summary
==============================================================================================================================================================
Install 6 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 9.5 M
Downloading Packages:
(1/6): postgresql-libs-8.1.18-2.el5_4.1.x86_64.rpm | 196 kB 00:00
(2/6): postgresql-libs-8.1.18-2.el5_4.1.i386.rpm | 196 kB 00:00
(3/6): postgresql-devel-8.1.18-2.el5_4.1.i386.rpm | 1.2 MB 00:00
(4/6): postgresql-devel-8.1.18-2.el5_4.1.x86_64.rpm | 1.2 MB 00:00
(5/6): postgresql-8.1.18-2.el5_4.1.x86_64.rpm | 2.9 MB 00:00
(6/6): postgresql-server-8.1.18-2.el5_4.1.x86_64.rpm | 3.9 MB 00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 6.8 MB/s | 9.5 MB 00:01
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : postgresql-libs 1/6
Installing : postgresql 2/6
Installing : postgresql-libs 3/6
Installing : postgresql-devel 4/6
Installing : postgresql-server 5/6
Installing : postgresql-devel 6/6
Installed:
postgresql.x86_64 0:8.1.18-2.el5_4.1 postgresql-devel.i386 0:8.1.18-2.el5_4.1 postgresql-devel.x86_64 0:8.1.18-2.el5_4.1
postgresql-libs.i386 0:8.1.18-2.el5_4.1 postgresql-libs.x86_64 0:8.1.18-2.el5_4.1 postgresql-server.x86_64 0:8.1.18-2.el5_4.1
Complete!
Stopping postgresql service: [FAILED]
postmaster: no process killed
postmaster: no process killed
Initializing database: [ OK ]
Starting postgresql service: [ OK ]
You should now configure PostgreSQL from WHM!
root@server1 [/etc/yum.repos.d]#
Please advise.
Thanks