Macos PostgreSQL server赢得';系统恢复后不能启动;OSX山狮

Macos PostgreSQL server赢得';系统恢复后不能启动;OSX山狮,macos,postgresql,osx-mountain-lion,Macos,Postgresql,Osx Mountain Lion,我以前使用EnterpriseDB安装程序在Mac上安装了PostgreSQL 9.2。因此,我将.bash_profile修改为导出路径=/opt/local/lib/postgresql92/bin:$PATH,一切正常 然后我的硬盘坏了,不得不重新格式化我的电脑并重新安装OSX。起初,我不得不重新安装雪豹(这是我拥有的恢复光盘的版本),然后重新升级到山狮(我在崩溃前运行的)。然后,我使用带有迁移助手的Time Machine备份来恢复我的用户、应用程序和“其他文件” 环顾四周,一切似乎都回

我以前使用EnterpriseDB安装程序在Mac上安装了PostgreSQL 9.2。因此,我将
.bash_profile
修改为
导出路径=/opt/local/lib/postgresql92/bin:$PATH
,一切正常

然后我的硬盘坏了,不得不重新格式化我的电脑并重新安装OSX。起初,我不得不重新安装雪豹(这是我拥有的恢复光盘的版本),然后重新升级到山狮(我在崩溃前运行的)。然后,我使用带有迁移助手的Time Machine备份来恢复我的用户、应用程序和“其他文件”

环顾四周,一切似乎都回到了坠机前的状态。但是,现在,当我尝试执行任何与PostgreSQL相关的操作时,会出现以下错误:

psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
通过在线阅读,我发现这可能只是因为在执行系统恢复时,我的PostgreSQL server尚未启动。官方文件说要使用以下命令:

$postgres-D/usr/local/pgsql/data

但是我在
/usr/local/pgsql
没有文件夹;我能找到的唯一包含
数据的目录是
/Library/PostgreSQL/9.2/data
。因此,我通过执行
sudo su postgres
切换到
postgres
,并再次尝试
postgres-D/Library/PostgreSQL/9.2/data
,得到:

2013-08-18 11:38:09 SGT FATAL:  could not create shared memory segment: Invalid argument
2013-08-18 11:38:09 SGT DETAIL:  Failed system call was shmget(key=5432001, size=32374784, 03600).
2013-08-18 11:38:09 SGT 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 32374784 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
    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.
我该怎么办?这整件事有点奇怪;我不记得最初安装PostgreSQL时需要启动服务器

EDIT:我还尝试了
initdb-D/Library/PostgreSQL/9.2/data
,以防数据库集群丢失,但得到了:

initdb: directory "/Library/PostgreSQL/9.2/data" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/Library/PostgreSQL/9.2/data" or run initdb
with an argument other than "/Library/PostgreSQL/9.2/data".

所以它应该仍然存在,与我系统上的大多数其他东西一起恢复,对吗?

您的内核参数需要调整。以下是关于的相关文档。根据您的系统规格(内存)进行配置,您应该很好


作为一个脚注,我想补充一点,从Postgresql 9.3开始,上述调整将。

您是否有一个零散的
postmaster.pid
文件在任何地方游荡?@muistooshort,我在
/Library/Postgresql/9.0/data
中有一个,但以前卸载了该版本的Postgresql(由于属于
postgres
而不是我的普通用户,
data
目录是
9.0
中唯一剩下的目录)但是,
9.2/data
中没有这样的文件。我实际上可以通过运行卸载程序,然后重新安装PostgreSQL来解决这个问题,但是谢谢你的回答。我相信它在将来会很有用。