Browse Source

option to filer.copy with public volume server url

fix https://github.com/seaweedfs/seaweedfs/issues/5126
pull/5132/head
chrislu 1 year ago
parent
commit
6df44d3c95
  1. 5
      weed/command/filer_copy.go

5
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
}

Loading…
Cancel
Save