aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-10-06 13:08:38 -0700
committerChris Lu <chris.lu@gmail.com>2018-10-06 13:08:38 -0700
commit84d4a2c8a067518f403a3777790c67955d64ade3 (patch)
tree6f8a2fa21d0005aa87b21c90ed89346b9a62cc19
parentf8c2704d2b3afdaf77d5fa7be290fbee9e54e8dc (diff)
downloadseaweedfs-84d4a2c8a067518f403a3777790c67955d64ade3.tar.xz
seaweedfs-84d4a2c8a067518f403a3777790c67955d64ade3.zip
add filer replication to google cloud storage
-rw-r--r--weed/command/scaffold.go10
-rw-r--r--weed/replication/sink/gcssink/gcs_sink.go5
2 files changed, 5 insertions, 10 deletions
diff --git a/weed/command/scaffold.go b/weed/command/scaffold.go
index fbe6934e1..e7e20e56f 100644
--- a/weed/command/scaffold.go
+++ b/weed/command/scaffold.go
@@ -179,7 +179,7 @@ ttlSec = 0
[sink.s3]
# experimental
-# See https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/sessions.html
+# read credentials doc at https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/sessions.html
# default loads credentials from the shared credentials file (~/.aws/credentials).
enabled = false
aws_access_key_id = "" # if empty, loads from the shared credentials file (~/.aws/credentials).
@@ -189,13 +189,11 @@ bucket = "your_bucket_name" # an existing bucket
directory = "" # destination directory (do not prefix or suffix with "/")
[sink.google_cloud_storage]
-# experimental
-# see https://cloud.google.com/docs/authentication/getting-started
+# read credentials doc at https://cloud.google.com/docs/authentication/getting-started
enabled = false
google_application_credentials = "/path/to/x.json" # path to json credential file
-projectId = "your_project_id"
-bucket = "your_bucket_name" # an existing bucket
-directory = "/" # destination directory
+bucket = "your_bucket_seaweedfs" # an existing bucket
+directory = "/" # destination directory
`
)
diff --git a/weed/replication/sink/gcssink/gcs_sink.go b/weed/replication/sink/gcssink/gcs_sink.go
index 2e0cf10f8..db71aa1f9 100644
--- a/weed/replication/sink/gcssink/gcs_sink.go
+++ b/weed/replication/sink/gcssink/gcs_sink.go
@@ -17,7 +17,6 @@ import (
type GcsSink struct {
client *storage.Client
- projectId string
bucket string
dir string
filerSource *source.FilerSource
@@ -38,7 +37,6 @@ func (g *GcsSink) GetSinkToDirectory() string {
func (g *GcsSink) Initialize(configuration util.Configuration) error {
return g.initialize(
configuration.GetString("google_application_credentials"),
- configuration.GetString("projectId"),
configuration.GetString("bucket"),
configuration.GetString("directory"),
)
@@ -48,8 +46,7 @@ func (g *GcsSink) SetSourceFiler(s *source.FilerSource) {
g.filerSource = s
}
-func (g *GcsSink) initialize(google_application_credentials, projectId, bucketName, dir string) (error) {
- g.projectId = projectId
+func (g *GcsSink) initialize(google_application_credentials, bucketName, dir string) (error) {
g.bucket = bucketName
g.dir = dir