当ulimit -n 设置最大打开文件数不生效时,可以调整系统默认的DefaultLimitNOFILE值

vim /etc/systemd/system.conf

reboot 重启系统使配置生效。