Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

两个filer分别起了两个mount服务挂载,结果两个路径显示的文件列表不一致 #1423

Closed
Leif160519 opened this issue Aug 13, 2020 · 8 comments

Comments

@Leif160519
Copy link

Leif160519 commented Aug 13, 2020

Sponsors SeaweedFS via Patreon https://www.patreon.com/seaweedfs
Report issues here. Ask questions here https://stackoverflow.com/questions/tagged/seaweedfs

example of a good issue report:
#1005
example of a bad issue report:
#1008

Describe the bug
为了实现filer的高可用,我启动了两个filer服务,然后每个filer我也分别启动了mount服务,分别挂载到了本地,但是当我在其中一个挂载点里新建文件时,另外一个挂载点并不能同步第一个挂载点里新增的那个文件,但如果是在浏览器中随机选择一个filer进行上传文件的话,两个挂载点都能看到相同的文件列表。两个filer用的都是redis作为元数据的存储介质,然而在浏览器端查看两个filer,他们的数据列表都是一致的

System Setup
filer1.service

/usr/local/bin/weed -logdir=/seaweedfs/log/filer1 filer -master=10.5.2.222:9331,10.5.2.222:9332,10.5.2.222:9333 -port=8888 -defaultReplicaPlacement=001

filer2.service

/usr/local/bin/weed -logdir=/seaweedfs/log/filer2 filer -master=10.5.2.222:9331,10.5.2.222:9332,10.5.2.222:9333 -port=8889 -defaultReplicaPlacement=001

mount1.service

/usr/local/bin/weed -logdir=/seaweedfs/log/mount1 mount -filer=10.5.2.222:8888 -dir=/seaweedfs/mount1

mount2,service

/usr/local/bin/weed -logdir=/seaweedfs/log/mount2 mount -filer=10.5.2.222:8889 -dir=/seaweedfs/mount2
root@ubuntu:/seaweedfs/mount1# ll
total 0
drwxr-xr-- 1 root root 0 Aug 11 20:50 topics/
drwxr-xr-x 1 root root 0 Aug 12 03:52 1/
drwxr-xr-x 1 root root 0 Aug 12 03:55 2/

root@ubuntu:/seaweedfs/mount2# ll
total 20K
drwxr-xr-- 1 root root    0 Aug 11 20:50  topics/
drwxr-xr-x 1 root root    0 Aug 12 03:55  2/
  • Ubuntu 18.04
  • 1.87 a6b59d5
  • if using filer, show the content of filer.toml
/etc/seaweedfs/filer.toml

# 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 = false
dir = "."					# 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 = true
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"

Expected behavior
不同的挂载点,文件列表显示一致

Screenshots
由于网络策略限制,我无法上传图片

Additional context

@chrislusf
Copy link
Collaborator

this is not supported yet.

Use one filer for multiple mounts for now.

@Leif160519
Copy link
Author

this is not supported yet.

Use one filer for multiple mounts for now.

那请问一下,filer服务的高可用没有别的方案了吗,如果数以千万计的文件服务,下面还有数百个Linux需要挂载它,如果只有一个filer,挂掉的话就很难办了

@chrislusf
Copy link
Collaborator

you can mount different sub folders.

@Leif160519
Copy link
Author

您可以装载不同的子文件夹。

那您的意思就是,整个seaweedfs只提供一个filer,然后可以用多个mount服务去挂载不同的路径对嘛

@chrislusf
Copy link
Collaborator

you can start multiple filers. But each mount only mount one folder not shared with each other.

@Leif160519
Copy link
Author

您可以启动多个文件管理器。但是每个挂载只挂载一个不共享的文件夹。

好的,我明白了您的意思,谢谢!

@xpader
Copy link

xpader commented Apr 17, 2024

2024 年了,现在可以共享挂载了吗?

@lfhy
Copy link
Contributor

lfhy commented Apr 17, 2024

2024 年了,现在可以共享挂载了吗?

视图是一致的吧,mount服务会订阅filer变更,当触发元数据更新的时候也会更新mount本地的元数据缓存

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants