马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
Seaweedfs 安装 安装Go1、下载go 2、解压 tar xfgo1.11.10.linux-amd64.tar.gz -C /usr/local/ 3、修改/etc/profile vim /etc/profile export GOPATH=/opt/go exportGOROOT=/usr/local/go export GOOS=linux exportGOBIN=$GOROOT/bin exportGOTOOLS=$GOROOT/pkg/tool/ exportPATH=$PATH:$GOBIN:$GOTOOLS source /etc/profile 安装weed1、Github下载指定版本 2、上传并解压 tar xflinux_amd64.tar.gz -C /usr/local/ 3、创建安装目录 mkdir -p /data/seaweedfs/logs mkdir -p /data/seaweedfs/data mkdir -p /data/seaweedfs/vol/vol01 mkdir -p /data/seaweedfs/vol/vol1/ 4、添加启动脚本 vim/data/seaweedfs/weedfs.sh #!/bin/bash nohup /data/seaweedfs/weedmaster -mdir="/data/seaweedfs/data/" -ip="192.168.120.47" -ip.bind="192.168.120.47"-port=9333 -peers="192.168.120.47:9333,192.168.120.47:9333,192.168.120.47:9333"-defaultReplication="200" &>> /data/seaweedfs/logs/master.log& nohup /data/seaweedfs/weedvolume -dataCenter=Center1 -rack rack1 -ip=192.168.120.47 -port=9991 -ip.bind192.168.120.47 -max 20 -dir=/data/seaweedfs/vol/vol1/ -mserver=192.168.120.47:9333-publicUrl 192.168.120.47:9222 &>> /data/seaweedfs/logs/vol1.log & nohup ./weed volume-dataCenter dc1 -rack rack1 -dir ./seaweedfs/volume -ip 192.168.88.129 -port9222 -ip.bind 192.168.88.129 -max 20 -mserver192.168.88.129:9333,192.168.88.130:9333,192.168.88.131:9333 -publicUrl192.168.88.129:9222 > ./seaweedfs/volume/volume.log & nohup /data/weedmaster -mdir="/data/seaweedfs/data/" -ip="192.168.120.47"-ip.bind="192.168.120.47" -port=9333-peers="192.168.120.47:9333,192.168.120.47:9333,192.168.120.47:9333"-defaultReplication="200" >> /data/seaweedfs/logs/master.log2>&1 & nohup /data/weedvolume -dataCenter=Center1 -ip=192.168.120.47 -port=9991-dir=/data/seaweedfs/vol/vol1/ -mserver=192.168.120.47:9333 >>/data/seaweedfs/logs/vol1.log 2>&1 & chmod +x/data/seaweedfs/weedfs.sh 5、创建启动程序 vim/usr/lib/systemd/system/weedmaster.service [Unit] Description=weedmaster After=network.target rc-local.service [Service] Type=forking PrivateTmp=true ExecStart=/data/seaweedfs/weedfs.sh [Install] WantedBy=multi-user.target 6、启动seaweedfs systemctl enableweedmaster systemctl startweedmaster http://192.168.120.47:9333/ 调试: nohup /data/seaweedfs/weed master -ip=192.168.120.47-port=9333 -mdir=/data/seaweedfs/data -peers=192.168.120.47:9333,192.168.120.47:9333,192.168.120.47:9333>> /data/seaweedfs/data/master.log & nohup /data/seaweedfs/weed volume -dataCenter dc1-rack rack1 -dir /data/seaweedfs/volume -ip 192.168.120.47 -port 9222 -ip.bind192.168.120.47 -max 20 -mserver 192.168.120.47:9333,192.168.120.47:9333,192.168.120.47:9333-publicUrl 192.168.120.47:9222 >> /data/seaweedfs/volume/volume.log & 测试: {"fid":"1,01592b640e","url":"192.168.120.47:9222","publicUrl":"192.168.120.47:9222","count":1}[root@seaweedfs~]# [root@seaweedfs ~]# curl -Ffile=/data/seaweedfs/volume/volume.log 192.168.120.47:9222/1,01592b640e {"size":33,"eTag":"d7a0738f"}[root@seaweedfs~]# [root@seaweedfs ~]# curl -Ffile=@/usr/src/linux_amd64.tar.gz 192.168.120.47:9222/1,01592b640e {"name":"linux_amd64.tar.gz","size":35348455,"eTag":"0747f50b"}[root@seaweedfs~]# 配置运行Filer并挂载到本地目录 Filer允许以另一种方式上传文件 1 J. N! D5 w V) a
- 安装启动
( ~% D! J8 i3 i$ D) k mkdir -p /data/seaweedfs cd /data/seaweedfs 创建filter文件: touch filer.toml mkdir -p /data/module/filer_path/level 将 /data/seaweedfs/weed scaffold filer-output="" >filer.toml 打印出的内容写入到 filer.toml中, 并且修改其中的配置 dir = "/data/module/filer_path/level"
2 V3 S4 [# T2 |: }* H - 启动1 c, B1 Z& i6 \) ` C) [
nohup /data/seaweedfs/weed filer-master=192.168.120.47:9333,192.168.120.47:9333,192.168.120.47:9333-ip=192.168.120.47 -port=8888 &
1 L( x1 W( P) V0 ^ - 上传文件2 S7 |6 n% ^: ^( U8 `) Q7 y
[root@seaweedfs ~]# curl -F "filename=@/usr/src/go1.11.10.linux-amd64.tar.gz" "http://192.168.120.47:8888/path/to/sources/"3 j5 c$ m7 ?. b: o
{"name":"go1.11.10.linux-amd64.tar.gz","size":121074848}[root@seaweedfs~]#
7 T# b% W8 ] \1 U - 返回结果9 G+ `( V8 g: M4 A/ x' z
{"name":"volume.log","size":1656,"fid":"13,0da7c2b7ff","url":"http://192.168.88.130:9222/13,0da7c2b7ff"}
6 ]8 ?, J) G" } Y6 A0 w 可以看到,前面的上传需要两步,现在用filer上传,只需要一步,并且可以指定文件夹,这里的/path/to/sources/就是文件路径) K1 @. n4 Z6 l% d& e. a
- 可直接输入http://192.168.120.47:8888/ 地址进行访问.下载和前面的流程一样.# @* s6 r7 w' h' ~& X/ J" ?
mount挂载
8 E% k4 l6 S9 r( F$ A4 y( G0 Y) Z% b - [root@seaweedfs ~]# mkdir -p /data/seaweedfs/seaweedfs/data/mount
$ |( Y' T( w: `( q0 |; x9 V - 指定文件管理器挂载到/seaweedfs/data/mount目录下& `3 |/ f1 N- o4 W. N a0 x8 D
nohup /data/seaweedfs/weed mount-filer=192.168.120.47:8888 -dir=/data/seaweedfs/seaweedfs/data/mount/ & 执行命令后,便可看到通过filer上传的文件已经挂载到了本地/data/seaweedfs/seaweedfs/data/mount/ path/to/sources目录下.9 y3 W* W& f! I" G5 q/ H
具体信息以官方wiki为主.
( e- V. T; S4 R' ?7 v, o' V; | |