Postgres因“无法打开关系映射文件" global/pg_filenode.map"而失败. ' [英] Postgres is failing with 'could not open relation mapping file "global/pg_filenode.map" '

查看:2546
本文介绍了Postgres因“无法打开关系映射文件" global/pg_filenode.map"而失败. '的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发环境中安装postgres时遇到问题,我需要一些诊断它的帮助.我还没有运气来寻找解决方案.

I'm having an issue with my install of postgres in my development environment and I need some help diagnosing it. I haven't yet had any luck in tracking down a solution.

  1. 我安装了自制软件的Postgres 9.0.4
  2. 我正在OS X 10.6.8(Snow Leopard)上运行

我可以启动和停止服务器

I can start and stop the server

$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
server starting

如果我想停下来

$ pg_ctl -D /usr/local/var/postgres stop -s -m fast
pg_ctl: PID file "/usr/local/var/postgres/postmaster.pid" does not exist
Is server running?

好了,这不见了

$ ls -l /usr/local/var/postgres/ | grep postmaster
$

但是它肯定正在运行

$ ps aux | grep postgres
pschmitz   303   0.9  0.0  2445860   1428   ??  Ss    3:12PM   0:02.46 postgres: autovacuum launcher process       
pschmitz   304   0.9  0.0  2441760    428   ??  Ss    3:12PM   0:02.57 postgres: stats collector process       
pschmitz   302   0.0  0.0  2445728    508   ??  Ss    3:12PM   0:00.56 postgres: wal writer process       
pschmitz   301   0.0  0.0  2445728    560   ??  Ss    3:12PM   0:00.78 postgres: writer process       
pschmitz   227   0.0  0.1  2445728   2432   ??  S     3:11PM   0:00.42 /usr/local/Cellar/postgresql/9.0.3/bin/postgres -D /usr/local/var/postgres -r /usr/local/var/postgres/server.log

如果我尝试访问或使用它,我会得到这个.

And if I try to access or use it I get this.

$psql
psql: FATAL:  could not open relation mapping file "global/pg_filenode.map": No such file or directory

但是global/pg_filenode.map确实存在于

But global/pg_filenode.map definitely exists in

$ls -l /usr/local/var/postgres/

...
-rw-------  1 pschmitz  staff   8192 Sep 16 15:48 pg_control
-rw-------  1 pschmitz  staff    512 Sep 16 15:48 pg_filenode.map
-rw-------  1 pschmitz  staff  12092 Sep 16 15:48 pg_internal.init

我已尝试卸载并重新安装,但没有任何效果.关于如何解决这个问题有什么想法吗? 它几乎阻止了我今天做任何事情.

I have attempted to uninstall and reinstall to no effect. Any ideas on how I can solve this? It has pretty much prevented me from getting anything done today.

已解决修改

我不确定9.0.3最初的问题源是什么,因为我遇到了这个问题

I am not sure what the source of my original problem was with 9.0.3 because I was getting this problem

psql: FATAL:  could not open relation mapping file "global/pg_filenode.map": No such file or directory

但是如上所述,事实证明运行过程是针对我以前的Postgres安装9.0.3

However as stated above it turns out the running process was for my previous postgres install of 9.0.3

我相信我在〜/Library/LaunchAgents/

I believe I had an old version org.postgresql.postgres.plist in ~/Library/LaunchAgents/

我必须:

  1. 删除并重新添加启动代理
  2. 杀死9.0.3的流程
  3. 初始化数据库initdb /usr/local/var/postgres
  4. 重新启动计算机
  1. Remove and re-add the launch agent
  2. Kill the processes for 9.0.3
  3. Initialize the db initdb /usr/local/var/postgres
  4. Restart my computer

现在我可以正常使用了.

and now I have it up and working.

推荐答案

我不确定9.0.3最初的问题来源是什么,因为我遇到了这个问题:

I am not sure what the source of my original problem was with 9.0.3 because I was getting this problem:

psql: FATAL:  could not open relation mapping file "global/pg_filenode.map": No such file or directory

但是如上所述,事实证明正在运行的过程是针对我以前的Postgres安装9.0.3

However as stated above it turns out that the running process was for my previous postgres install of 9.0.3

我相信我在〜/Library/LaunchAgents/

I believe I had an old version org.postgresql.postgres.plist in ~/Library/LaunchAgents/

我必须:

  1. 删除并重新添加启动代理
  2. 杀死9.0.3的流程
  3. 初始化数据库initdb /usr/local/var/postgres
  4. 重新启动计算机
  1. Remove and re-add the launch agent
  2. Kill the processes for 9.0.3
  3. Initialize the db initdb /usr/local/var/postgres
  4. Restart my computer

现在我可以正常使用了.

and now I have it up and working.

这篇关于Postgres因“无法打开关系映射文件" global/pg_filenode.map"而失败. '的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆