在CentOS 6.5 下安装完TFS部署的过程中,执行“./scripts/stfs format 1”命令时,出现错误:
ERROR create_block (blockfile_manager.cpp:1315) [140688549848864] allocate space error. ret: -1, error: 28, error desc: No space left on device
部署参考文档:https://github.com/alibaba/tfs/blob/master/DEPLOY.md;
根据提示可以知道是:设备上没有剩余空间;
完整的命令输出如下:
# /home/tfs/scripts/stfs format 1 format ds 1 FAIL ... CHECK IT mount name: /data/tfs1 max mount size: 94072120 base fs type: 1 superblock reserve offset: 0 main block size: 75497472 extend block size: 4194304 block ratio: 0.5 file system version: 1 avg inner file size: 15360 hash slot ratio: 0.5 [2016-07-19 12:52:16] INFO blockfile_manager.cpp:1091 [140688549848864] super block mount point: /data/tfs1. [2016-07-19 12:52:16] INFO blockfile_manager.cpp:1171 [140688549848864] cal block count. avail data space: 95830728704, main block count: 1142, ext block count: 2284 tag TAOBAO mount time 1468903936 mount desc /data/tfs1 max use space 96329850880 base filesystem 1 superblock reserve 0 bitmap start offset 324 avg inner file size 15360 block type ratio 0.5 main block count 1142 main block size 75497472 extend block count 2284 extend block size 4194304 used main block count 0 used extend block count 0 hash slot ratio 0.5 hash slot size 2730 first mmap size 122880 mmap size step 4096 max mmap size 3686400 version 1 [2016-07-19 12:52:16] INFO blockfile_manager.cpp:1213 [140688549848864] cal bitmap count. item count: 3427, slot count: 429 [2016-07-19 12:52:16] ERROR create_block (blockfile_manager.cpp:1315) [140688549848864] allocate space error. ret: -1, error: 28, error desc: No space left on device create tfs file system fail. ret: -1
设备上没有剩余空间;既然和空间有关,去看部署参考文档后面的FAQ:
Q: format TFS数据目录的过程中失败了? A: 可能的原因:你对这个目录写权限;目录空间不足,先检查mount_maxsize的配置;目录已经被格式化过,先clear,再format;磁盘换了;我就去修改 ds.conf 文件中关于空间大小的配置,包括“ mount_maxsize ”等,但是尝试了很多次都不行,再看文档,找到关键了:
mount_maxsize=961227000 KB, 磁盘实际使用的空间,应该小于df命令Available一项的输出按说明修改后,再格式化就成功了。
完整的输出如下:
# /home/tfs/scripts/stfs format 1 format ds 1 SUCCESSFULLY mount name: /data/tfs1 max mount size: 9407212 base fs type: 1 superblock reserve offset: 0 main block size: 75497472 extend block size: 4194304 block ratio: 0.5 file system version: 1 avg inner file size: 15360 hash slot ratio: 0.5 [2016-07-19 14:23:19] INFO blockfile_manager.cpp:1091 [140220020225824] super block mount point: /data/tfs1. [2016-07-19 14:23:19] INFO blockfile_manager.cpp:1171 [140220020225824] cal block count. avail data space: 9583073280, main block count: 114, ext block count: 228 tag TAOBAO mount time 1468909399 mount desc /data/tfs1 max use space 9632985088 base filesystem 1 superblock reserve 0 bitmap start offset 324 avg inner file size 15360 block type ratio 0.5 main block count 114 main block size 75497472 extend block count 228 extend block size 4194304 used main block count 0 used extend block count 0 hash slot ratio 0.5 hash slot size 2730 first mmap size 122880 mmap size step 4096 max mmap size 3686400 version 1 [2016-07-19 14:23:19] INFO blockfile_manager.cpp:1213 [140220020225824] cal bitmap count. item count: 343, slot count: 43