SaeweedFS操作

# mdir 存储元数据的数据目录 # port 监听端口 # peers 主节点ip:端口 # defaultReplication 备份策略 # ip 服务器ip # garbageThreshold 清空和回收空间的阈值 # maxCpu 最大cpu数量,0是所有 # pulseSeconds 心跳检测的时间间隔单位为秒 # ip.bind 绑定ip,不填默认用-ip # volumeSizeLimitMB volumes超载量,最大30G,即一个卷可以存多少数据,当然一个卷不代表一个磁盘,这点在下面的volume节点上再写 #启动master weed master -mdir=D:\weed\m1 -ip=192.168.1.75 -ip.bind=0.0.0.0 -defaultReplication=000 ./weed master -mdir=/weed/m1 -ip=192.168.1.13 nohup ./weed master -mdir=/mnt/weed/m1 -ip=192.168.1.13 > weed.log & #启动volume Server weed volume -dir=D:\weed\s1\data,D:\weed\s2\data -max=3,1 -mserver="192.168.1.75:9333" -port=9000 -index=leveldb -fileSizeLimitMB=6000 nohup ./weed volume -dir=/weed/s1,/weed/s2 -max=2,1 -mserver=192.168.1.13:9333 -port=9000 -index=leveldb -fileSizeLimitMB=4000 > weed.log & nohup ./weed volume -dir=/mnt/weed/s1,/mnt/weed/s2 -max=2,1 -mserver=192.168.1.13:9333 -port=9000 -index=leveldb -fileSizeLimitMB=4000 > weed.log & #fileSizeLimitMB 允许上传的最大文件大小,默认256MB,超过报file over the limited 268435456 bytes #API 获取一个fid:http://192.168.1.75:9333/dir/assign http://192.168.1.75:9333/dir/assign?collection=pictures 获取一个带有效期的fid:http://192.168.1.75:9333/dir/assign?ttl=1m 上传一个文件:http://192.168.1.75:9000/1,019f1dbef0 从主服务器上传一个文件:http://192.168.1.75:9333/submit 查看文件:http://192.168.1.75:9333/dir/lookup?volumeId=1 #从主服务器根据volume id查询volumeIP 删除一个文件:http://192.168.1.75:9333/1,019f1dbef0 强制垃圾回收:http://192.168.1.75:9333/vol/vacuum #删除文件后定时释放空间,调用后强制释放空间 volume server的状态:http://192.168.1.75:9000/status?pretty=y http://192.168.1.75:9333/admin/volume/delete?volume=3
posted @ 2023-07-19 17:36  金江  阅读(57)  评论(0编辑  收藏  举报