我最近从Maverick升级到Natty,除了在dist升级期间,一切都进行得很好,PostgreSQL出了点问题。从那以后,我试着重新安装,删除,甚至通过'sudo apt-获取清除postgresql‘清除它,但是不管我做什么,它仍然会产生相同的错误。见下文。它在升级前运转良好。任何帮助都将不胜感激。谢谢!
Setting up postgresql-common (114) ...
* Starting PostgreSQL 8.4 database server * The PostgreSQL server failed to start. Please check the log output:
2011-05-19 11:49:41 EDT LOG: could not bind IPv4 socket: Address already in use
2011-05-19 11:49:41 EDT HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2011-05-19 11:49:41 EDT WARNING: could not create listen socket for "127.0.0.1"
2011-05-19 11:49:41 EDT FATAL: could not create shared memory segment: Invalid argument
2011-05-19 11:49:41 EDT DETAIL: Failed system call was shmget(key=5432001, size=37879808, 03600).
2011-05-19 11:49:41 EDT HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 37879808 bytes), reduce PostgreSQL's shared_buffers parameter (currently 4096) and/or its max_connections parameter (currently 103).
If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
The PostgreSQL documentation contains more information about shared memory configuration.
[fail]
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing postgresql-common (--configure):
subprocess installed post-installation script returned error exit status 1发布于 2011-05-22 06:55:59
您需要增加共享内存Linux内核允许一次分配的最大大小(称为SHMMAX参数)。
您需要编辑/etc/sysctl.conf并添加以下行:
kernel.shmmax = 41943040(其中41943040是以字节为单位的内存大小,即40兆字节。在生产系统中,您可能希望将此值设置得更高一些-- Postgres文档建议从1/4可用内存开始)
那就跑
sudo sysctl -p重新启动postgres。
或者,您可以编辑/etc/postgresql/<version>/main/postgresql.conf并减少shared_buffers参数的值。
这是一个bug,这里有更多的信息
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/264336
(也有/etc/sysctl.d/30-postgresql-shm.conf文件,它应该用于此目的,但它似乎不包含在主配置中,所以编辑它没有效果)
发布于 2011-05-22 03:30:52
旧的Postgres很有可能还在运行。
正如“自由思想家”所指出的,正确的想法是对端口上运行的内容进行验证。
一旦你知道是Postrgres,你可能会想杀了它:
# Find PID
ps axf | grep post
kill PID然后您可以启动新版本:
/etc/init.d/postgresql start我很困惑为什么包管理器不能阻止旧版本。
https://askubuntu.com/questions/44373
复制相似问题