oceanbasea[ERROR] OBD-1007: (127.0.0.1) The value of the ulimit parameter "open files" must not be less than 20000 (Current value: 1024)
一、# 切换到 root 用户(若已为 root 可跳过)
sudo su -
[ERROR] OBD-1007: (127.0.0.1) The value of the ulimit parameter "open files" must not be less than 20000 (Current value: 1024), Please execute `echo -e "* soft nofile 20000\n* hard nofile 20000" >> /etc/security/limits.d/nofile.conf` as root in 127.0.0.1. if it dosen't work, please check whether UsePAM is yes in /etc/ssh/sshd_config.
# 执行 OBD 建议的命令,添加 nofile 配置
echo -e "* soft nofile 20000\n* hard nofile 20000" >> /etc/security/limits.d/nofile.conf
# 验证配置是否写入成功
cat /etc/security/limits.d/nofile.conf
* soft nofile 20000
* hard nofile 20000
# 编辑 sshd_config 文件
vi /etc/ssh/sshd_config
# 找到 UsePAM 这一行,确保值为 yes(去掉注释,修改值)
UsePAM yes
# 保存退出后,重启 sshd 服务使配置生效
systemctl restart sshd
# 退出当前 root 会话
exit
# 重新登录服务器(或重新 ssh 连接),然后检查配置是否生效
ulimit -n
# 正确输出应为 20000
方法一不成功可以使用方法二
二、
1. 全维度配置 limits(root 用户执行,一步到位)
2. 必须重启服务器(最后手段)
二、解决内存不足问题(Free:6G < Need:7G)
1. 编辑集群配置文件
2. 修改内存相关参数(关键)
# 1. 停止所有 OceanBase 相关进程(避免占用) pkill -9 observer || true # 2. 配置 /etc/security/limits.conf(系统核心配置) cat >> /etc/security/limits.conf << EOF # OceanBase 配置 root soft nofile 655350 root hard nofile 655350 * soft nofile 655350 * hard nofile 655350 * soft core unlimited * hard core unlimited * soft stack unlimited * hard stack unlimited EOF # 3. 配置 /etc/security/limits.d/nofile.conf(覆盖默认配置) cat > /etc/security/limits.d/nofile.conf << EOF * soft nofile 655350 * hard nofile 655350 EOF # 4. 配置 PAM 确保 limits 生效(Ubuntu 关键) sed -i '/session\s*required\s*pam_limits.so/s/^#//g' /etc/pam.d/common-session echo "session required pam_limits.so" >> /etc/pam.d/common-session # 5. 重启系统服务(强制加载配置) systemctl restart systemd-logind systemctl restart sshd # 6. 验证配置文件(确认内容正确) grep -E "nofile|core|stack" /etc/security/limits.conf grep -E "nofile" /etc/security/limits.d/nofile.conf

浙公网安备 33010602011771号