386 字 | 1 分钟

tendisadmin [operation] [arg]

Available since 1.0.0.

命令说明

Tendis存储版的管理命令

命令参数

目前支持的值有

  1. sleep
  2. lockdb
  3. recovery

tendisadmin sleep [second]

用于模拟Redisdebug sleep操作,整个实例sleep若干秒。如果执行这个,会对所有kvstore上X锁,阻塞所有数据操作。但Gossip线程池并不阻塞。

tendisadmin lockdb [second]

类似于tendisadmin sleep [second],但同时阻塞Gossip线程池,这样就完全等价于Redisdebug sleep,主要用于测试用例。

tendisadmin recovery

一旦rocksdb出现后台错误,例如磁盘满,整个rocksdb会处于read only状态。如果想解决异常状态,例如释放一些空间,需要执行tendisadmin recovery命令来修复异常状态。详细可查看Background Error Handling

  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
  3. 127.0.0.1:8903> info rocksdbBgError
  4. # RocksdbBgError
  5. 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
  6. 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
  7. 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
  8. 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
  9. 127.0.0.1:8903> tendisadmin recovery
  10. OK
  11. 127.0.0.1:8903> set a b
  12. OK

命令返回

Simple string reply: OK when the configuration was set properly. Otherwise an error is returned.

Examples

如上