存储小文件,占用空间小,性能比 fastDfs 好
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
Check System Status:
curl "http://10.0.2.15:9333/cluster/status?pretty=y"
curl "http://localhost:9333/dir/status?pretty=y"
检查 volume 是否被移动过:
curl "http://localhost:9333/dir/lookup?volumeId=3&pretty=y"
curl "http://localhost:9333/dir/lookup?volumeId=3,01637037d6"
curl "http://localhost:9333/dir/lookup?volumeId=3&collection=turbo”
Force garbage collection:
curl "http://localhost:9333/vol/vacuum"
curl "http://localhost:9333/vol/vacuum?garbageThreshold=0.4"
Pre-Allocate Volumes:
# 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"
Upload File Directly
curl -F file=@/home/chris/myphoto.jpg http://localhost:9333/submit
filer
mount挂载
With "weed mount", the files can be operated as a local file.
Weed Mount Architecture
benchmark
backup
compact
filer
fix
server
master
filer
s3
upload
download
shell
version
volume
export
mount