aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-12-22 11:32:43 -0800
committerchrislu <chris.lu@gmail.com>2023-12-22 11:32:43 -0800
commit6df44d3c95219d695bf13a90c21f01cb9d5108aa (patch)
tree862613bde1e2317f129f32aea1cf15ad5596e60d
parent7a0d1e7fc19b0abce4a5b42e05b6cd7f051bf2f7 (diff)
downloadseaweedfs-6df44d3c95219d695bf13a90c21f01cb9d5108aa.tar.xz
seaweedfs-6df44d3c95219d695bf13a90c21f01cb9d5108aa.zip
option to filer.copy with public volume server url
fix https://github.com/seaweedfs/seaweedfs/issues/5126
-rw-r--r--weed/command/filer_copy.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go
index 4cef053fc..e1a8999f3 100644
--- a/weed/command/filer_copy.go
+++ b/weed/command/filer_copy.go
@@ -46,6 +46,7 @@ type CopyOptions struct {
ttlSec int32
checkSize *bool
verbose *bool
+ volumeServerAccess *string
}
func init() {
@@ -61,6 +62,7 @@ func init() {
copy.concurrentChunks = cmdFilerCopy.Flag.Int("concurrentChunks", 8, "concurrent chunk copy goroutines for each file")
copy.checkSize = cmdFilerCopy.Flag.Bool("check.size", false, "copy when the target file size is different from the source file")
copy.verbose = cmdFilerCopy.Flag.Bool("verbose", false, "print out details during copying")
+ copy.volumeServerAccess = cmdMount.Flag.String("volumeServerAccess", "direct", "access volume servers by [direct|publicUrl|filerProxy]")
}
var cmdFilerCopy = &Command{
@@ -580,6 +582,9 @@ func (worker *FileCopyWorker) WithFilerClient(streamingMode bool, fn func(filer_
}
func (worker *FileCopyWorker) AdjustedUrl(location *filer_pb.Location) string {
+ if *worker.options.volumeServerAccess == "publicUrl" {
+ return location.PublicUrl
+ }
return location.Url
}