详细部署过程参考https://github.com/chrislusf/seaweedfs
1、首先去官网下载对应版本的软件包seaweedfs下载地址
2、下载好软件包上传到需要安装的服务器解压,并创建相关目录
tar -zxvf linux_amd64.tar.gz #解压
mkdir seaweedfs
mkdir -p ./seaweedfs/data ./seaweedfs/volume #创建目录存储日志文件
mv weed seaweedfs
cd seaweedfs
执行./weed -h查看seaweedfs的各种指令说明
3、配置master端并执行
nohup ./weed master -ip=172.16.30.24 -port=9333 -mdir=./data -peers=172.16.30.24:9333 > ./data/master.log 2>&1 & #ip改成自己ip
执行./weed master -h查看master服务指令
4、配置volume端并执行
nohup ./weed volume -dataCenter dc1 -rack rack1 -dir ./volume -ip 172.16.30.24 -port 9222 -ip.bind 172.16.30.24 -max 20 -mserver 172.16.30.24:9333 -publicUrl 172.16.30.24:9222 > ./volume/volume.log 2>&1 & #ip改成自己ip
执行./weed volume -h查看master服务指令
5、访问 http://172.16.30.24:9333/
6、安装filer服务
cd seaweedfs #进入目录
mkdir filer_path #新建filer_path存储目录
vim filer.toml #输入如下保存退出,注意跟filer_path同级目录
# A sample TOML config file for SeaweedFS filer store
# Used with "weed filer" or "weed server -filer"
# Put this file to one of the location, with descending priority
# ./filer.toml
# $HOME/.seaweedfs/filer.toml
# /etc/seaweedfs/filer.toml
####################################################
# Customizable filer server options
####################################################
[filer.options]
# with http DELETE, by default the filer would check whether a folder is empty.
# recursive_delete will delete all sub folders and files, similar to "rm -Rf"
recursive_delete = false
# directories under this folder will be automatically creating a separate bucket
buckets_folder = "/buckets"
buckets_fsync = [ # a list of buckets with all write requests fsync=true
"important_bucket",
"should_always_fsync",
]
####################################################
# The following are filer store options
####################################################
[leveldb2]
# local on disk, mostly for simple single-machine setup, fairly scalable
# faster than previous leveldb, recommended.
enabled = true
dir = "/root/seaweedfs/filer_path" # directory to store level db files
[mysql] # or tidb
# CREATE TABLE IF NOT EXISTS filemeta (
# dirhash BIGINT COMMENT 'first 64 bits of MD5 hash value of directory field',
# name VARCHAR(1000) COMMENT 'directory or file name',
# directory TEXT COMMENT 'full path to parent directory',
# meta LONGBLOB,
# PRIMARY KEY (dirhash, name)
# ) DEFAULT CHARSET=utf8;
enabled = false
hostname = "localhost"
port = 3306
username = "root"
password = ""
database = "" # create or use an existing database
connection_max_idle = 2
connection_max_open = 100
interpolateParams = false
[postgres] # or cockroachdb
# CREATE TABLE IF NOT EXISTS filemeta (
# dirhash BIGINT,
# name VARCHAR(65535),
# directory VARCHAR(65535),
# meta bytea,
# PRIMARY KEY (dirhash, name)
# );
enabled = false
hostname = "localhost"
port = 5432
username = "postgres"
password = ""
database = "" # create or use an existing database
sslmode = "disable"
connection_max_idle = 100
connection_max_open = 100
[cassandra]
# CREATE TABLE filemeta (
# directory varchar,
# name varchar,
# meta blob,
# PRIMARY KEY (directory, name)
# ) WITH CLUSTERING ORDER BY (name ASC);
enabled = false
keyspace="seaweedfs"
hosts=[
"localhost:9042",
]
[redis2]
enabled = false
address = "localhost:6379"
password = ""
database = 0
[redis_cluster2]
enabled = false
addresses = [
"localhost:30001",
"localhost:30002",
"localhost:30003",
"localhost:30004",
"localhost:30005",
"localhost:30006",
]
password = ""
# allows reads from slave servers or the master, but all writes still go to the master
readOnly = true
# automatically use the closest Redis server for reads
routeByLatency = true
[etcd]
enabled = false
servers = "localhost:2379"
timeout = "3s"
[mongodb]
enabled = false
uri = "mongodb://localhost:27017"
option_pool_size = 0
database = "seaweedfs"
执行
nohup ./weed filer -master="172.16.30.24:9333" -ip=172.16.30.24 &
访问 http://172.16.30.24:8888/ 如图