mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 16:47:24 +08:00
mount: outsideContainerClusterMode changed to use volume server publicUrl
This commit is contained in:
@@ -48,7 +48,7 @@ func init() {
|
|||||||
mountOptions.allowOthers = cmdMount.Flag.Bool("allowOthers", true, "allows other users to access the file system")
|
mountOptions.allowOthers = cmdMount.Flag.Bool("allowOthers", true, "allows other users to access the file system")
|
||||||
mountOptions.umaskString = cmdMount.Flag.String("umask", "022", "octal umask, e.g., 022, 0111")
|
mountOptions.umaskString = cmdMount.Flag.String("umask", "022", "octal umask, e.g., 022, 0111")
|
||||||
mountOptions.nonempty = cmdMount.Flag.Bool("nonempty", false, "allows the mounting over a non-empty directory")
|
mountOptions.nonempty = cmdMount.Flag.Bool("nonempty", false, "allows the mounting over a non-empty directory")
|
||||||
mountOptions.outsideContainerClusterMode = cmdMount.Flag.Bool("outsideContainerClusterMode", false, "allows other users to access the file system")
|
mountOptions.outsideContainerClusterMode = cmdMount.Flag.Bool("outsideContainerClusterMode", false, "allows other users to access volume servers with publicUrl")
|
||||||
mountOptions.uidMap = cmdMount.Flag.String("map.uid", "", "map local uid to uid on filer, comma-separated <local_uid>:<filer_uid>")
|
mountOptions.uidMap = cmdMount.Flag.String("map.uid", "", "map local uid to uid on filer, comma-separated <local_uid>:<filer_uid>")
|
||||||
mountOptions.gidMap = cmdMount.Flag.String("map.gid", "", "map local gid to gid on filer, comma-separated <local_gid>:<filer_gid>")
|
mountOptions.gidMap = cmdMount.Flag.String("map.gid", "", "map local gid to gid on filer, comma-separated <local_gid>:<filer_gid>")
|
||||||
|
|
||||||
@@ -72,11 +72,5 @@ var cmdMount = &Command{
|
|||||||
|
|
||||||
On OS X, it requires OSXFUSE (http://osxfuse.github.com/).
|
On OS X, it requires OSXFUSE (http://osxfuse.github.com/).
|
||||||
|
|
||||||
If the SeaweedFS system runs in a container cluster, e.g. managed by kubernetes or docker compose,
|
|
||||||
the volume servers are not accessible by their own ip addresses.
|
|
||||||
In "outsideContainerClusterMode", the mount will use the filer ip address instead, assuming:
|
|
||||||
* All volume server containers are accessible through the same hostname or IP address as the filer.
|
|
||||||
* All volume server container ports are open external to the cluster.
|
|
||||||
|
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,6 @@
|
|||||||
package filesys
|
package filesys
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb"
|
"github.com/chrislusf/seaweedfs/weed/pb"
|
||||||
@@ -27,14 +24,8 @@ func (wfs *WFS) WithFilerClient(fn func(filer_pb.SeaweedFilerClient) error) erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (wfs *WFS) AdjustedUrl(location *filer_pb.Location) string {
|
func (wfs *WFS) AdjustedUrl(location *filer_pb.Location) string {
|
||||||
if !wfs.option.OutsideContainerClusterMode {
|
if wfs.option.OutsideContainerClusterMode {
|
||||||
return location.Url
|
return location.PublicUrl
|
||||||
}
|
}
|
||||||
commaIndex := strings.Index(location.Url, ":")
|
return location.Url
|
||||||
if commaIndex < 0 {
|
|
||||||
return location.Url
|
|
||||||
}
|
|
||||||
filerCommaIndex := strings.Index(wfs.option.FilerGrpcAddress, ":")
|
|
||||||
return fmt.Sprintf("%s:%s", wfs.option.FilerGrpcAddress[:filerCommaIndex], location.Url[commaIndex+1:])
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user