OceanBase数据库 出现错误 / not enough disk space. (Avail: 24G, Need: 34G), Please reduce the `datafile_size` or `datafile_disk_percentage`

执行

obd cluster start remote_cluster

出现

[ERROR] OBD-2003: (192.168.1.145) / not enough disk space. (Avail: 24G, Need: 33G), Please reduce the `datafile_size` or `datafile_disk_percentage`

 这个错误提示表明在远程集群 上磁盘空间不足,无法启动 OceanBase 集群。

 解决方案:减少 datafile_size 或 datafile_disk_percentage 配置

调整配置文件

第一步 查看集群信息

obd cluster list

 可以看到集群的文件位置

 找到配置文件 config.yaml 并修改它 在 oceanbase-ce 中的 global  节点下 加入

datafile_size: 5G  # ":" 后必须有一个空格

vi的常用命令

#按  i  键 进入 插入模式(Insert mode)
#按 Esc 键 转到 命令行模式(command mode)
:wq      #保存并退出
:q!      #不保存强制退出 

config.yaml 完整代码

oceanbase-ce:
  servers:
    - name: server1
      ip: 192.168.1.145   # 改为服务器实际IP(非127.0.0.1)
      ssh_port: 22
      username: root
  global:
    home_path: /data/oceanbase
    data_dir: /data/ob
    redo_dir: /data/redo
    datafile_size: 5G           # 使用空间5G
    mysql_port: 2881
    rpc_port: 2882
    zone: zone1
    cluster_id: 1
    root_password: "YourStrong@Password123"     # 设置复杂密码
    memory_limit: 8G                   # 根据服务器内存调整
    system_memory: 2G
    # 关键远程访问配置
    enable_ssl: false                     # 生产环境建议true
    skip_networking: false             # 必须为false

obproxy-ce:
  servers:
    - 192.168.1.145                     # 与OceanBase同IP或独立代理服务器
  global:
    home_path: /data/obproxy-ce
    listen_port: 2883                                  # 代理服务端口
    rs_list: "192.168.1.145:2881"               # 指向OceanBase地址
    skip_proxy_sys_private_check: true      # 允许远程连接

修改完成后

重新部署

obd cluster deploy remote_cluster -c config.yaml
obd cluster start remote_cluster   #启动集群

 出现 active 说明启动成功

 执行

obd cluster list

 尝试连接数据库

 查看密码命令

 cat config.yaml | grep root_password

连接OceanBase数据库

mysql -h192.168.1.145 -P2881 -uroot@sys -p"YourStrong@Password123"

 说明连接成功

 执行简单 SQL 测试

SHOW DATABASES;

 

posted @ 2025-06-03 11:18  海乐学习  阅读(194)  评论(0)    收藏  举报