Tendis存储版 磁盘满如何处理?

Tendis存储版在使用过程中,磁盘空间满了,整个实例会处于readonly状态,无法进行任何写入操作。

  1. 127.0.0.1:8903> set a b
  2. (error) ERR:3,msg:IO error: No space left on deviceWhile appending to file: ./db/5/000084.sst: No space left on device

可以通过info rocksdbbgerror来查看错误原因

  1. 127.0.0.1:8903> info rocksdbBgError
  2. # RocksdbBgError
  3. rocksdb2:bgerror=IO error: No space left on deviceWhile appending to file: ./db/2/000093.sst: No space left on device,reason=Compaction,count=1
  4. rocksdb4:bgerror=IO error: No space left on deviceWhile appending to file: ./db/4/000092.sst: No space left on device,reason=Compaction,count=1
  5. rocksdb5:bgerror=IO error: No space left on deviceWhile appending to file: ./db/5/000089.sst: No space left on device,reason=Compaction,count=1
  6. rocksdb6:bgerror=IO error: No space left on deviceWhile appending to file: ./db/6/000086.sst: No space left on device,reason=Compaction,count=1

当磁盘空间清理后,并且通过tendisadmin recovery进行恢复,同时也可以通过重启进程恢复。

  1. 127.0.0.1:8903> set a b
  2. (error) ERR:3,msg:IO error: No space left on device While appending to file: ./db/5/000084.sst: No space left on device
  3. 127.0.0.1:8903> tendisadmin recovery
  4. OK
  5. 127.0.0.1:8903> set a b
  6. OK