服务器自动重启和ipcs [英] server auto-restarts and ipcs

查看:145
本文介绍了服务器自动重启和ipcs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



电源故障导致使用7.4.6失败的postmaster重启(参见下面的输出

)。短期修复通常是删除pid文件并重新启动。


我常常想知道为什么ipcs似乎永远不会显示共享内存

阻塞问题?我使用了错误的命令吗? pgsql提到的密钥

是否映射到ipcs输出中的密钥?如果

共享段根本不存在,那么pgsql是否有可能用a / ap来表示ala Apache,搜索进程表,然后继续

并重新启动,如果它没有看到postmaster已经运行?我确定这个

已被询问和回答,我只是无法通过谷歌找到它...


TIA。


Ed


数据库和流程是pg746dba ...


$ cat logs-pg746-7.4。 6 / server_log.Mon

pg_ctl:另一位邮局管理员可能正在运行。无论如何都试图启动postmaster。

2004-11-08 17:17:22.398 [18038]致命:预先存在的共享内存块(密钥9746001,ID 658210829)仍在使用中

提示:如果您确定没有旧服务器进程仍在运行,请使用命令ipcrm删除共享内存块,或者只删除文件/ users / pg746dba / dbclusters / pg746 / postgresql-7.4.6 / data / postmaster.pid" ;.

pg_ctl:无法启动postmaster

检查日志输出。


$ ipcs


------共享内存段--------

键shmid所有者perms字节nattch status

0x00000000 32768 ed 777 393216 2 dest

0x00000000 131073 root 644 110592 4 dest

0x00000000 3538946 ed 777 393216 2 dest

0x00000000 3670019 ed 777 393216 2 dest

0x00000000 4685828 ed 777 393216 2 dest

0x00000000 4816901 ed 777 393216 2 dest

0x00000000 4915206 ed 777 393216 2 dest

0x00000000 4980743 ed 777 393216 2 dest

0x00000000 5046280 ed 777 393216 2 dest

0x00000000 5111817 ed 777 393216 2 dest

0x00000000 5537802 root 644 110592 3 dest

0x00000000 6651915 ed 777 393216 2 dest

0x00000000 19595276 ed 666 14400 1 dest

0x00000000 11272205 root 644 110592 2 dest


------ Semaphore Arrays --------

关键semid所有者perms nsems


--- ---消息队列--------

密钥msqid owne r perms used-bytes messages


---------------------------(播出结束) ---------------------------

提示5:您是否检查了我们广泛的常见问题解答?

http://www.postgresql.org/docs/faqs /FAQ.html

解决方案

cat logs-pg746-7.4.6 / server_log.Mon

pg_ctl:另一个邮局主管可能正在运行。无论如何都试图启动postmaster。

2004-11-08 17:17:22.398 [18038]致命:预先存在的共享内存块(密钥9746001,ID 658210829)仍在使用中

提示:如果您确定没有旧服务器进程仍在运行,请使用命令ipcrm删除共享内存块,或者只删除文件/ users / pg746dba / dbclusters / pg746 / postgresql-7.4.6 / data / postmaster.pid" ;.

pg_ctl:无法启动postmaster

检查日志输出。


ipcs


------共享内存段--------

关键shmid所有者烫发bytes nattch status

0x00000000 32768 ed 777 393216 2 dest

0x00000000 131073 root 644 110592 4 dest

0x00000000 3538946 ed 777 393216 2 dest

0x00000000 3670019 ed 777 393216 2 dest

0x00000000 4685828 ed 777 393216 2 dest

0x00000000 4816901 ed 777 393216 2 dest

0x00000000 4915206 ed 777 393216 2 dest

0x00000000 4980743 ed 777 393216 2 dest

0x00000000 5046280 ed 777 393216 2 dest

0x00000000 5111817 ed 777 393216 2 dest

0x00000000 5537802 root 644 110592 3 dest

0x00000000 6651915 ed 777 393216 2 dest

0x00000000 19595276 ed 666 14400 1 dest

0x00000000 11272205 root 644 110592 2 dest


------信号量数组--------

关键semid所有者perms nsems


------消息队列--------

键msqid所有者perms使用的字节消息


---------------------------(广播结束) )---------------------------

提示5:您是否查看了我们广泛的常见问题解答?

http://www.postgresql.org/docs/ faqs / FAQ.html


" Ed L." < PG *** @ bluepolka.net>写道:

电源故障导致使用7.4.6失败的postmaster重启(参见下面的输出
)。短期修复通常是删除pid文件并重新启动。
我经常想知道为什么ipcs似乎永远不会显示有问题的共享内存?




共享内存块肯定不会存在之后一个系统

重启,所以我们这里有一个误导性的错误信息。看看

代码,最合理的解释似乎是

shmctl(IPC_STAT)失败(它应该)并返回一些错误

代码与EINVAL不同(我们期望看到这种情况)。

你在什么平台上,它的shmctl(2)手册页文件是什么

作为错误条件?


问候,tom lane


---------------- -----------(播出结束)---------------------------

提示9:如果您的

加入列的数据类型不匹配,计划员将忽略您选择索引扫描的愿望



A power failure led to failed postmaster restart using 7.4.6 (see output
below). The short-term fix is usually to delete the pid file and restart.

I often wonder why ipcs never seems to show the shared memory
block in question? Am I using the wrong command? Does the key
mentioned by pgsql map to the key in the ipcs output? And if the
shared segment is simply not there, would it be possible for pgsql to
figure that out ala Apache, search the process table, and go ahead
and restart if it didn''t see a postmaster already running? I''m sure this
has been asked and answered, I just couldn''t find it via google...

TIA.

Ed

Database and process is pg746dba...

$ cat logs-pg746-7.4.6/server_log.Mon
pg_ctl: Another postmaster may be running. Trying to start postmaster anyway.
2004-11-08 17:17:22.398 [18038] FATAL: pre-existing shared memory block (key 9746001, ID 658210829) is still in use
HINT: If you''re sure there are no old server processes still running, remove the shared memory block with the command "ipcrm", or just delete the file "/users/pg746dba/dbclusters/pg746/postgresql-7.4.6/data/postmaster.pid".
pg_ctl: cannot start postmaster
Examine the log output.

$ ipcs

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 32768 ed 777 393216 2 dest
0x00000000 131073 root 644 110592 4 dest
0x00000000 3538946 ed 777 393216 2 dest
0x00000000 3670019 ed 777 393216 2 dest
0x00000000 4685828 ed 777 393216 2 dest
0x00000000 4816901 ed 777 393216 2 dest
0x00000000 4915206 ed 777 393216 2 dest
0x00000000 4980743 ed 777 393216 2 dest
0x00000000 5046280 ed 777 393216 2 dest
0x00000000 5111817 ed 777 393216 2 dest
0x00000000 5537802 root 644 110592 3 dest
0x00000000 6651915 ed 777 393216 2 dest
0x00000000 19595276 ed 666 14400 1 dest
0x00000000 11272205 root 644 110592 2 dest

------ Semaphore Arrays --------
key semid owner perms nsems

------ Message Queues --------
key msqid owner perms used-bytes messages

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

解决方案

cat logs-pg746-7.4.6/server_log.Mon
pg_ctl: Another postmaster may be running. Trying to start postmaster anyway.
2004-11-08 17:17:22.398 [18038] FATAL: pre-existing shared memory block (key 9746001, ID 658210829) is still in use
HINT: If you''re sure there are no old server processes still running, remove the shared memory block with the command "ipcrm", or just delete the file "/users/pg746dba/dbclusters/pg746/postgresql-7.4.6/data/postmaster.pid".
pg_ctl: cannot start postmaster
Examine the log output.


ipcs

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 32768 ed 777 393216 2 dest
0x00000000 131073 root 644 110592 4 dest
0x00000000 3538946 ed 777 393216 2 dest
0x00000000 3670019 ed 777 393216 2 dest
0x00000000 4685828 ed 777 393216 2 dest
0x00000000 4816901 ed 777 393216 2 dest
0x00000000 4915206 ed 777 393216 2 dest
0x00000000 4980743 ed 777 393216 2 dest
0x00000000 5046280 ed 777 393216 2 dest
0x00000000 5111817 ed 777 393216 2 dest
0x00000000 5537802 root 644 110592 3 dest
0x00000000 6651915 ed 777 393216 2 dest
0x00000000 19595276 ed 666 14400 1 dest
0x00000000 11272205 root 644 110592 2 dest

------ Semaphore Arrays --------
key semid owner perms nsems

------ Message Queues --------
key msqid owner perms used-bytes messages

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


"Ed L." <pg***@bluepolka.net> writes:

A power failure led to failed postmaster restart using 7.4.6 (see output
below). The short-term fix is usually to delete the pid file and restart. I often wonder why ipcs never seems to show the shared memory
block in question?



The shared memory block would certainly not still exist after a system
reboot, so what we have here is a misleading error message. Looking at
the code, the most plausible explanation appears to be that
shmctl(IPC_STAT) is failing (which it ought to) and returning some errno
code different from EINVAL (which is the case we are expecting to see).
What platform are you on, and what does its shmctl(2) man page document
as error conditions?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column''s datatypes do not match


这篇关于服务器自动重启和ipcs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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