How to achievd HA of seaweedfs volume server?

1.3k views Asked by At

I have two volume server in the same rack. And my replication is 001, if one of the volume server has down, Since the replication is 001, So the upload function will not be available. How to ensure high availability of volume server? If I have fix the crash nodes up, will the data be automatically synchronized? if so, During the synchronizeing, Does the request will automatically switch to another good node when the request come in.

I have run to volume server in kubernetes in the same rack. one of the pod always restart. And There are no obvious errors in the log.

System Setup master:

/usr/bin/weed master -ip=weedfs-master -port=9333 -defaultReplication="001" -mdir=/data -volumePreallocate -volumeSizeLimitMB=1024
ports: - containerPort: 9333 args: - master - -ip=weedfs-master - -port=9333 - -defaultReplication="001" env: - name: TZ value: Asia/Hong_Kong

volume server1:

/usr/bin/weed volume -mserver=weedfs-master:9333 -max=500 -publicUrl=https://file-storage-exhibition.ssiid.com -ip=weedfs-volume-1 -port=8080 -rack=rack1 -dir=/data -max=0
ports: - containerPort: 8080 args: - volume - -mserver=weedfs-master:9333 - -max=500 - -publicUrl=https://file-storage-exhibition.ssiid.com - -ip=weedfs-volume-1 - -port=8080 - -rack=rack1 env: - name: TZ

volume server2:

/usr/bin/weed volume -mserver=weedfs-master:9333 -max=500 -publicUrl=https://file-storage-exhibition.ssiid.com -ip=weedfs-volume-2 -port=8080 -rack=rack1 -dir=/data -max=0
ports: - containerPort: 8080 args: - volume - -mserver=weedfs-master:9333 - -max=500 - -publicUrl=https://file-storage-exhibition.ssiid.com - -ip=weedfs-volume-2 - -port=8080 - -rack=rack1 env: - name: TZ

OS version version 30GB 1.75 linux amd6

enter image description here

the log of the pods which always start:

I0513 11:03:04     1 file_util.go:20] Folder /data Permission: -rwxr-xr-x
I0513 11:03:04     1 volume_loading.go:104] loading index /data/5.idx to memory
I0513 11:03:04     1 disk_location.go:81] data file /data/5.idx, replicaPlacement=001 v=3 size=8 ttl=
I0513 11:03:04     1 volume_loading.go:104] loading index /data/6.idx to memory
I0513 11:03:04     1 disk_location.go:81] data file /data/6.idx, replicaPlacement=001 v=3 size=8 ttl=
I0513 11:03:04     1 volume_loading.go:104] loading index /data/7.idx to memory
I0513 11:03:04     1 disk_location.go:81] data file /data/7.idx, replicaPlacement=001 v=3 size=8 ttl=
I0513 11:03:04     1 volume_loading.go:104] loading index /data/2.idx to memory
I0513 11:03:04     1 volume_loading.go:104] loading index /data/3.idx to memory
I0513 11:03:04     1 disk_location.go:81] data file /data/3.idx, replicaPlacement=001 v=3 size=8 ttl=
I0513 11:03:04     1 volume_loading.go:104] loading index /data/4.idx to memory
I0513 11:03:04     1 disk_location.go:81] data file /data/4.idx, replicaPlacement=001 v=3 size=8 ttl=
I0513 11:03:04     1 disk_location.go:81] data file /data/2.idx, replicaPlacement=001 v=3 size=8 ttl=
I0513 11:03:04     1 disk_location.go:117] Store started on dir: /data with 6 volumes max 0
I0513 11:03:04     1 disk_location.go:120] Store started on dir: /data with 0 ec shards
I0513 11:03:04     1 volume.go:279] Start Seaweed volume server 30GB 1.75 at 0.0.0.0:8080
I0513 11:03:04     1 volume_grpc_client_to_master.go:27] Volume server start with seed master nodes: [weedfs-master:9333]
I0513 11:03:04     1 volume_grpc_client_to_master.go:71] Heartbeat to: weedfs-master:9333
I0513 11:03:04     1 disk.go:11] read disk size: dir:"/data" all:527253700608 used:6518046720 free:520735653888 percent_free:98.76377 percent_used:1.2362258 
I0513 11:03:04     1 store.go:430] disk /data max 483 unclaimedSpace:490468MB, unused:6143MB volumeSizeLimit:1024MB
I0513 11:05:24     1 volume.go:205] graceful stop cluster http server, elapsed [0]
volume server has be killed
I0513 11:05:24     1 volume.go:210] graceful stop gRPC, elapsed [0]
I0513 11:05:24     1 volume_server.go:104] Shutting down volume server...
I0513 11:05:24     1 volume_server.go:106] Shut down successfully!
I0513 11:05:24     1 volume.go:215] stop volume server, elapsed [0]
1

There are 1 answers

0
chrislusf On

How to ensure high availability of volume server?

Add more than two volume servers.

If I have fix the crash nodes up, will the data be automatically synchronized?

The writes will fail. But the write request should get a new assignment from the master and go to the other volume servers to write. Nothing need to synchronize.