linux刚重启就报资源不可用,linux – su:/ bin / bash:资源暂时不可用

无法将用户切换为postgres.

postgres用户的ulimit设置设置了合理的限制.我们没有达到最高限度.

/ var / log / messages中没有错误.

错误:

BETA -bash-4.2# sudo su - postgres

su: /bin/bash: Resource temporarily unavailable

设置:

BETA -bash-4.2# ps -auxww | grep -i postgr | wc -l

503

BETA -bash-4.2# lsof | grep -i postgr | wc -l

35225

BETA -bash-4.2#

适用于postgres流程的Ulimit.

BETA -bash-4.2# cat /proc/26230/limits

Limit Soft Limit Hard Limit Units

Max cpu time unlimited unlimited seconds

Max file size unlimited unlimited bytes

Max data size unlimited unlimited bytes

Max stack size 8388608 unlimited bytes

Max core file size 0 unlimited bytes

Max resident set unlimited unlimited bytes

Max processes 256580 256580 processes

Max open files 1024 4096 files

Max locked memory 65536 65536 bytes

Max address space unlimited unlimited bytes

Max file locks unlimited unlimited locks

Max pending signals 256580 256580 signals

Max msgqueue size 819200 819200 bytes

Max nice priority 0 0

Max realtime priority 0 0

Max realtime timeout unlimited unlimited us

用netstat

BETA -bash-4.2# netstat -plan | grep -i post | grep ESTABLISHED | wc -l

496

BETA -bash-4.2#

Ulimit设置

BETA -bash-4.2# cat /etc/security/limits.d/postgres_limits.conf

# Limits settings for postgres

postgres soft nofile 4096

postgres hard nofile 4096

postgres soft nproc 400

postgres hard nproc 400

在我重新开始postgres之后,我能够进入.

postgres用户的资源工具.

BETA -bash-4.2# netstat -plan | grep -i post | grep ESTABLISHED | wc -l

1

BETA -bash-4.2#

BETA -bash-4.2# lsof | grep -i postgr | wc -l

309

BETA -bash-4.2# ps -auxww | grep -i postgr | wc -l

8

BETA -bash-4.2#

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值