- A+
所属分类:服务相关
原因
线上rabbitmq集群,发现rabbitmq描述符最多1024,还好暂时无用户量,赶紧修改
修改步骤
第一:修改系统文件描述符
cat /proc/sys/fs/file-max
/etc/sysctl.conf新增fs.file-max=1610391
然后sysctl -p
第二:修改用户系统描述符
1 2 3 4 5 |
vim /etc/security/limits.conf * soft nofile 100001 * hard nofile 100002 root soft nofile 100001 root hard nofile 100002 |
第三:centos7修改
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
[Unit] Description=RabbitMQ broker After=syslog.target network.target [Service] Type=notify User=rabbitmq Group=rabbitmq NotifyAccess=all TimeoutStartSec=3600 LimitNOFILE=65535 #添加这个 # The following setting will automatically restart RabbitMQ # in the event of a failure. systemd service restarts are not a # replacement for service monitoring. Please see # http://www.rabbitmq.com/monitoring.html Restart=on-failure RestartSec=10 WorkingDirectory=/var/lib/rabbitmq ExecStart=/usr/sbin/rabbitmq-server ExecStop=/usr/sbin/rabbitmqctl stop ExecStop=/bin/sh -c "while ps -p $MAINPID >/dev/null 2>&1; do sleep 1; done" # See rabbitmq/rabbitmq-server-release#51 SuccessExitStatus=69 [Install] WantedBy=multi-user.target |
然后重启rabbitmq
1 2 |
systemctl daemon-reload systemctl restart rabbitmq-server.service |
再次查看已经正常
注意:
系统描述符>用户描述符>rabbitmq的限制
- 我的微信
- 这是我的微信扫一扫
- 我的微信公众号
- 我的微信公众号扫一扫