# 1. 修复 open files 最大文件数(解决 ERROR) echo "* soft nofile 65535" | sudo tee /etc/security/limits.d/99-oceanbase.conf echo "* hard nofile 65535" | sudo tee -a /etc/security/limits.d/99-oceanbase.conf # 2. 修复 fs.aio-max-nr(解决 WARN) echo "fs.aio-max-nr = 1048576" | sudo tee /etc/sysctl.d/99-oceanbase.conf # 3. 让内核参数立即生效 sudo sysctl -p /etc/sysctl.d/99-oceanbase.conf # 4. 非常重要!重启 SSH/终端,让 limits 生效 su - root
# 查看文件数 ulimit -n
# 查看 aio 参数 sysctl fs.aio-max-nr
obd cluster deploy xxx # 或者你原来的安装命令
# 1. 创建文件数限制配置(永久生效) cat >> /etc/security/limits.conf << EOF * soft nofile 65535 * hard nofile 65535 root soft nofile 65535 root hard nofile 65535 EOF # 2. 给 systemd 服务也强制加大文件数(关键!OceanBase 靠这个生效) mkdir -p /etc/systemd/system.conf.d cat > /etc/systemd/system.conf.d/limits.conf << EOF [Manager] DefaultLimitNOFILE=65535 EOF # 3. 修复 aio 警告 echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf sysctl -p # 4. 重启系统(必须!不重启不生效) reboot
ulimit -n
sysctl fs.aio-max-nr