Architecture
Requirements
There should be two Seaweed File Systems running, possibly across data centers. Each should have its filer, master, and volume servers.
Configuration
- Configure notification. use "
weed scaffold -config=filer
" to see the notification section.
[notification.log]
enabled = false
[notification.kafka]
enabled = true
hosts = [
"localhost:9092"
]
topic = "seaweedfs_filer1_to_filer2"
Setup Kafka. Possibly you need to create the Kafka topic if auto topic creation is not enabled.
Configure replication. use "
weed scaffold -config=replication
" to see the notification section.
[source.filer]
enabled = true
grpcAddress = "localhost:18888"
directory = "/buckets" # all files under this directory tree are replicated
[notification.kafka]
enabled = true
hosts = [
"localhost:9092"
]
topic = "seaweedfs_filer1_to_filer2"
[sink.filer]
enabled = true
grpcAddress = "localhost:18888"
directory = "/backup" # all replicated files are under this directory tree
replication = ""
collection = ""
ttlSec = 0
Please read the source.filer and sink.filer configurations carefully and make sure you fully understand its intention. This is actually using one filer and replicate files from one folder to another folder.
- Start the Kafka.
- Start the replication. "
weed filer.replicate
" - Start the filer. "
weed filer
"
Replicate existing files
The weed filer.replicate
only replicates files that have been updated. If there are already a lot of files, very likely you would need to copy them too.
To do this, use echo 'fs.meta.notify' | weed shell
, which will iterate all files and generate one "file creation" event for each file to the message queue. Thus, all files will be replicated.