aboutsummaryrefslogtreecommitdiff
path: root/weed/command/scaffold.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-09-17 00:27:56 -0700
committerChris Lu <chris.lu@gmail.com>2018-09-17 00:27:56 -0700
commit788acdf5275dfb7610afe9144c17d9128d1737f6 (patch)
tree55e6701210157981eecd8a4f72d8c9eefa01c457 /weed/command/scaffold.go
parent865a0179369601e496d385e47bdbda93dcc3f243 (diff)
downloadseaweedfs-788acdf5275dfb7610afe9144c17d9128d1737f6.tar.xz
seaweedfs-788acdf5275dfb7610afe9144c17d9128d1737f6.zip
add WIP filer.replicate
Diffstat (limited to 'weed/command/scaffold.go')
-rw-r--r--weed/command/scaffold.go32
1 files changed, 31 insertions, 1 deletions
diff --git a/weed/command/scaffold.go b/weed/command/scaffold.go
index a5df2d18d..17d8b1884 100644
--- a/weed/command/scaffold.go
+++ b/weed/command/scaffold.go
@@ -19,7 +19,7 @@ var cmdScaffold = &Command{
var (
outputPath = cmdScaffold.Flag.String("output", "", "if not empty, save the configuration file to this directory")
- config = cmdScaffold.Flag.String("config", "filer", "the configuration file to generate")
+ config = cmdScaffold.Flag.String("config", "filer", "[filer|replication] the configuration file to generate")
)
func runScaffold(cmd *Command, args []string) bool {
@@ -28,6 +28,8 @@ func runScaffold(cmd *Command, args []string) bool {
switch *config {
case "filer":
content = FILER_TOML_EXAMPLE
+ case "replication":
+ content = REPLICATION_TOML_EXAMPLE
}
if content == "" {
println("need a valid -config option")
@@ -140,4 +142,32 @@ hosts = [
topic = "seaweedfs_filer"
`
+ REPLICATION_TOML_EXAMPLE = `
+# A sample TOML config file for replicating SeaweedFS filer store
+
+
+[source.filer]
+enabled = true
+grpcAddress = "localhost:18888"
+# id is to identify the notification source, avoid reprocessing the same events
+id = "filer1"
+# all files under this directory tree and not from this source.filer.id is replicated
+directory = "/"
+
+[notification.kafka]
+enabled = true
+hosts = [
+ "localhost:9092"
+]
+topic = "seaweedfs_filer"
+
+[sink.filer]
+enabled = true
+grpcAddress = "localhost:18888"
+# id is to identify the notification source, avoid reprocessing the same events
+id = "filer2"
+# all files under this directory tree and not from this source.filer.id is replicated
+directory = "/"
+
+`
)