MooseFS 2.x ChunkServer维护模式
2015-05-22 by dongnan
环境
操作系统: CentOS 6.6 amd64
配置
ChunkServer: 物理机 4Core CPU/16GB Mem/单磁盘 1TB/1GB NIC
Master: VM 4Core CPU/4GB Mem/100GB Disk/1GB NIC
Client: VM 4Core CPU/4GB Mem/50GB Disk/1GB NIC
IP
master: 172.27.244.69
client: 172.27.244.99
chunk1: 172.27.244.31
chunk2: 172.27.244.32
chunk3: 172.27.244.33
目标
了解及测试 ChunkServer
维护模式。
之前
假如 ChunkServer
没有进入维护模式直接关闭,Master 会认为此 ChunkServer
故障,
为保证副本数量(示例为:2
)将 chunk
复制到其它的 ChunkServer
例如:
Master日志
May 22 09:25:27 test6 mfsmaster[21404]: chunkserver disconnected - ip: 172.27.244.31 / port: 9422, usedspace: 644682653696 (600.41 GiB), totalspace: 905398321152 (843.22 GiB)
May 22 09:25:41 test6 mfsmaster[21404]: server ip: 172.27.244.31 / port: 9422 has been fully removed from data structures
将chunk1
服务器关闭后,大约有600万的chunk
副本数变为 1
:
由于副本数量设置为2
,Master 会要求将这些chunk
复制到其它的 chunkserver
上。
注意:chunk
数量在变化。
之后
有意思的是,如果我将关闭的 chunk1
开启,将会有多出的副本删除直至恢复正常。
日志
# master
May 22 09:53:53 test6 mfsmaster[21404]: csdb: found cs using ip:port and csid (172.27.244.31:9422,1)
May 22 09:53:53 test6 mfsmaster[21404]: chunkserver register begin (packet version: 6) - ip: 172.27.244.31 / port: 9422, usedspace: 0 (0.00 GiB), totalspace: 0 (0.00 GiB)
May 22 09:53:54 test6 mfsmaster[21404]: chunkserver register end (packet version: 6) - ip: 172.27.244.31 / port: 9422
# chunk1
May 22 09:53:24 chunk1 mfschunkserver[1580]: monotonic clock function: clock_gettime
May 22 09:53:24 chunk1 mfschunkserver[1580]: monotonic clock speed: 243308 ops / 10 mili seconds
May 22 09:53:24 chunk1 mfschunkserver[1580]: hdd space manager: folder /mfs/chunk1/ will be scanned
May 22 09:53:24 chunk1 mfschunkserver[1580]: hdd space manager: setting open chunks limit to: 10922
May 22 09:53:24 chunk1 mfschunkserver[1580]: main server module: listen on *:9422
May 22 09:53:24 chunk1 mfschunkserver[1580]: connecting ...
May 22 09:53:24 chunk1 mfschunkserver[1580]: stats file has been loaded
May 22 09:53:24 chunk1 mfschunkserver[1580]: connected to Master
May 22 09:53:32 chunk1 mfschunkserver[1580]: scanning folder /mfs/chunk1/: 1% (8s)
May 22 09:53:33 chunk1 mfschunkserver[1580]: scanning folder /mfs/chunk1/: 2% (9s)
#...省略
May 22 09:55:06 chunk1 mfschunkserver[1580]: scanning folder /mfs/chunk1/: 99% (102s)
May 22 09:55:07 chunk1 mfschunkserver[1580]: scanning folder /mfs/chunk1/: complete (103s)
多余的副本
注意: chunk 数量
使用"维护模式"
在维护模式下关闭 chunkserver
,可以避免 chunkserver
间复制。
路径:通过 CGI -> Server -> Switch on/off 切换模式: