aboutsummaryrefslogtreecommitdiff
path: root/weed/command/mount_std.go
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2021-05-24 12:28:19 +0500
committerGitHub <noreply@github.com>2021-05-24 12:28:19 +0500
commit84dce32a5781268f6dbd0101e3bab65c04e0a1c7 (patch)
tree5eb4f327c53e2525d372d19bce62984539c62e71 /weed/command/mount_std.go
parentbb4263352251fb7ad02cfeb7f340b5b961d0d55a (diff)
parent359a08ecbad0b010811af367c2a2677fadfb53ae (diff)
downloadseaweedfs-84dce32a5781268f6dbd0101e3bab65c04e0a1c7.tar.xz
seaweedfs-84dce32a5781268f6dbd0101e3bab65c04e0a1c7.zip
Merge branch 'master' into head_check_all_chunks
Diffstat (limited to 'weed/command/mount_std.go')
-rw-r--r--weed/command/mount_std.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go
index 2474cf7dd..e72a2f2cf 100644
--- a/weed/command/mount_std.go
+++ b/weed/command/mount_std.go
@@ -51,9 +51,9 @@ func runMount(cmd *Command, args []string) bool {
func RunMount(option *MountOptions, umask os.FileMode) bool {
- filer := *option.filer
+ filers := strings.Split(*option.filer, ",")
// parse filer grpc address
- filerGrpcAddress, err := pb.ParseServerToGrpcAddress(filer)
+ filerGrpcAddresses, err := pb.ParseServersToGrpcAddresses(filers)
if err != nil {
glog.V(0).Infof("ParseFilerGrpcAddress: %v", err)
return true
@@ -64,22 +64,22 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client")
var cipher bool
for i := 0; i < 10; i++ {
- err = pb.WithGrpcFilerClient(filerGrpcAddress, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
+ err = pb.WithOneOfGrpcFilerClients(filerGrpcAddresses, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
if err != nil {
- return fmt.Errorf("get filer grpc address %s configuration: %v", filerGrpcAddress, err)
+ return fmt.Errorf("get filer grpc address %v configuration: %v", filerGrpcAddresses, err)
}
cipher = resp.Cipher
return nil
})
if err != nil {
- glog.V(0).Infof("failed to talk to filer %s: %v", filerGrpcAddress, err)
+ glog.V(0).Infof("failed to talk to filer %v: %v", filerGrpcAddresses, err)
glog.V(0).Infof("wait for %d seconds ...", i+1)
time.Sleep(time.Duration(i+1) * time.Second)
}
}
if err != nil {
- glog.Errorf("failed to talk to filer %s: %v", filerGrpcAddress, err)
+ glog.Errorf("failed to talk to filer %v: %v", filerGrpcAddresses, err)
return true
}
@@ -145,7 +145,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
options := []fuse.MountOption{
fuse.VolumeName(mountName),
- fuse.FSName(filer + ":" + filerMountRootPath),
+ fuse.FSName(*option.filer + ":" + filerMountRootPath),
fuse.Subtype("seaweedfs"),
// fuse.NoAppleDouble(), // include .DS_Store, otherwise can not delete non-empty folders
fuse.NoAppleXattr(),
@@ -181,8 +181,8 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
seaweedFileSystem := filesys.NewSeaweedFileSystem(&filesys.Option{
MountDirectory: dir,
- FilerAddress: filer,
- FilerGrpcAddress: filerGrpcAddress,
+ FilerAddresses: filers,
+ FilerGrpcAddresses: filerGrpcAddresses,
GrpcDialOption: grpcDialOption,
FilerMountRootPath: mountRoot,
Collection: *option.collection,
@@ -218,7 +218,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
c.Close()
})
- glog.V(0).Infof("mounted %s%s to %s", filer, mountRoot, dir)
+ glog.V(0).Infof("mounted %s%s to %v", *option.filer, mountRoot, dir)
server := fs.New(c, nil)
seaweedFileSystem.Server = server
err = server.Serve(seaweedFileSystem)