postgresql数据库服务器启动失败

查看原文:http://www.sijitao.net/1426.html
这周postgresql终于发布了9.3正式版,公司领导让我在新服务器上安装9.3。安装过程一切顺利,然后按照我们现在的配置修改了下postgresql.conf文件。但是重启的时候却出现如下错误:

[code language="shell"]

postgres@newdata:~$ /opt/PostgreSQL/9.3/bin/pg_ctl start -D /data1/pgsql93
server starting
postgres@newdata:~$ 2013-09-11 13:01:21 CST [3042]: [1-1] user=,db=,host= FATAL: could not create semaphores: No space left on device
2013-09-11 13:01:21 CST [3042]: [2-1] user=,db=,host= DETAIL: Failed system call was semget(3555120, 17, 03600).
2013-09-11 13:01:21 CST [3042]: [3-1] user=,db=,host= HINT: This error does *not* mean that you have run out of disk space. It occurs when either the system limit for the maximum number of semaphore sets (SEMMNI), or the system wide maximum number of semaphores (SEMMNS), would be exceeded. You need to raise the respective kernel parameter. Alternatively, reduce PostgreSQL's consumption of semaphores by reducing its max_connections parameter.
The PostgreSQL documentation contains more information about configuring your system for PostgreSQL.

[/code]

could not create semaphores: No space left on device”,按照字面上的意思感觉是说我的磁盘空间不足,其实不然。我把postgresql.conf配置文件又换成和初始状态一样,重启是正常的。参考资料,这句话的意思原来是你的内核的System V信号灯的限制小于 PostgreSQL 想创建的数量。我在postgresql.conf文件中修改最大连接数是2500个,即max_connections = 2500,默认值是100。

最后修改/etc/sysctl.conf系统内核文件,在后面添加如下代码解决postgresql服务器启动连接数错误的问题。

[code language="shell"]

# added for postgresql
kernel.shmmax = 203243925504
kernel.shmall = 49620099
kernel.sem = 5010 1282560 5010 256
kernel.sched_migration_cost = 5000000
kernel.sched_autogroup_enabled = 0

[/code]

参考网址:

http://www.php100.com/manual/PostgreSQL8/postmaster-start.html#POSTMASTER-START-FAILURES

http://www.php100.com/manual/PostgreSQL8/kernel-resources.html#SYSVIPC

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值