seaweedfs使用总结

2019-06-10  本文已影响0人  时间道

优势:

存储小文件,占用空间小,性能比 fastDfs 好

在逻辑上Seaweedfs的几个概念:

安装:

yum info golang
wget https://github.com/chrislusf/seaweedfs/releases/download/0.96/linux_amd64.tar.gz
tar -zxf linux_amd64.tar.gz

启动

./weed -h  查看帮助
启动 master
nohup /home/dev/go/gopath/weed master -mdir=/home/dev/go/sea/data -port=9333 -defaultReplication="001" -ip="10.66.220.*" &>> /home/dev/go/sea/logs/master.log &

启动三个 volume
nohup /home/dev/go/gopath/weed volume -dir=/home/dev/go/sea/vol/vol1 -mserver="10.66.220.*:9333" -port=8081 -ip="10.66.220.*" &>>/home/dev/go/sea/logs/vol1.log &
nohup /home/dev/go/gopath/weed volume -dir=/home/dev/go/sea/vol/vol2 -mserver="10.66.220.*:9333" -port=8082 -ip="10.66.220.*" &>>/home/dev/go/sea/logs/vol2.log &
nohup /home/dev/go/gopath/weed volume -dir=/home/dev/go/sea/vol/vol3 -mserver="10.66.220.*:9333" -port=8083 -ip="10.66.220.*" &>>/home/dev/go/sea/logs/vol3.log &

上传文件:

 curl http://10.66.220.38:9333/dir/assign
 curl -F "file=/home/dev/mail.py" 10.66.220.38:8082/2,01f9865716

其他api

# specify a specific replication

curl "http://localhost:9333/vol/grow?replication=000&count=4"

{"count":4}

# specify a collection

curl "http://localhost:9333/vol/grow?collection=turbo&count=4"

# specify data center

curl "http://localhost:9333/vol/grow?dataCenter=dc1&count=4"

# specify ttl

curl "http://localhost:9333/vol/grow?ttl=5d&count=4"

* Check Volume Server Status

    curl "[http://localhost:8080/status?pretty=y](http://localhost:8080/status?pretty=y)”
curl "http://localhost:9333/dir/lookup?volumeId=3&pretty=y"

# Other usages:

# You can actually use the file id to lookup, if you are lazy to parse the file id.

curl "http://localhost:9333/dir/lookup?volumeId=3,01637037d6"

# If you know the collection, specify it since it will be a little faster

curl "http://localhost:9333/dir/lookup?volumeId=3&collection=turbo"

With "weed mount", the files can be operated as a local file.
Weed Mount Architecture

SeaweedFS命令集:

benchmark
backup  
compact
filer
fix
server
master
filer
s3
upload
download
shell
version
volume
export
mount
上一篇 下一篇

猜你喜欢

热点阅读