diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-10-03 23:36:52 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-10-03 23:36:52 -0700 |
| commit | e8ef501f02217d29e35f4a52c86be3d93939ae6f (patch) | |
| tree | 8f2785b8dc1187c4a1b5a7336d189dc43ec35009 /weed/command/filer_replication.go | |
| parent | 56a5d5af8d627e513cbfa3c89f6159646fb07d49 (diff) | |
| download | seaweedfs-e8ef501f02217d29e35f4a52c86be3d93939ae6f.tar.xz seaweedfs-e8ef501f02217d29e35f4a52c86be3d93939ae6f.zip | |
add s3 replication sink
Diffstat (limited to 'weed/command/filer_replication.go')
| -rw-r--r-- | weed/command/filer_replication.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/weed/command/filer_replication.go b/weed/command/filer_replication.go index b19597245..5e41cbb55 100644 --- a/weed/command/filer_replication.go +++ b/weed/command/filer_replication.go @@ -6,6 +6,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/server" "github.com/spf13/viper" "strings" + "github.com/chrislusf/seaweedfs/weed/replication/sink" ) func init() { @@ -57,7 +58,21 @@ func runFilerReplicate(cmd *Command, args []string) bool { } } - replicator := replication.NewReplicator(config.Sub("source.filer"), config.Sub("sink.filer")) + var dataSink sink.ReplicationSink + for _, sk := range sink.Sinks { + if config.GetBool("sink." + sk.GetName() + ".enabled") { + viperSub := config.Sub("sink." + sk.GetName()) + if err := sk.Initialize(viperSub); err != nil { + glog.Fatalf("Failed to initialize sink for %s: %+v", + sk.GetName(), err) + } + glog.V(0).Infof("Configure sink to %s", sk.GetName()) + dataSink = sk + break + } + } + + replicator := replication.NewReplicator(config.Sub("source.filer"), dataSink) for { key, m, err := notificationInput.ReceiveMessage() |
