PostgreSQL 启动失败 No space left on device

PostgreSQL 启动失败

>FATAL: could not create semaphores: No space left on device
< 2015-10-07 22:00:26.817 CST >DETAIL: Failed system call was semget(1, 17, 03600)

上述的空间不够不是指的是磁盘空间不够,而是创建semaphores时空间参数不够,系统调用参数semget报错,但是错误信息感觉有些迷惑……解决办法通常是减小max_connections,或者增大内核参数,如semmni,semmns等,在/proc/sys/kernel/sem里面调整,如
[root@localhost ~]# sysctl -w kernel.sem="500 64000 50 150"
kernel.sem = 500 64000 50 150
[root@localhost ~]# cat /proc/sys/kernel/sem
500 64000 50 150

发表评论