mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-27 20:59:42 +08:00
Fix Bash
parent
b0f12206fe
commit
f21fd486bb
@ -8,21 +8,25 @@ Luckily, it's not too difficult to enable Weed File System with failover master
|
|||||||
|
|
||||||
This section is a quick way to start 3 master servers and 3 volume servers. All done!
|
This section is a quick way to start 3 master servers and 3 volume servers. All done!
|
||||||
|
|
||||||
```
|
```bash
|
||||||
> weed server -master.port=9333 -dir=./1 -volume.port=8080 -master.peers=localhost:9333,localhost:9334,localhost:9335
|
weed server -master.port=9333 -dir=./1 -volume.port=8080 \
|
||||||
> weed server -master.port=9334 -dir=./2 -volume.port=8081 -master.peers=localhost:9333,localhost:9334,localhost:9335
|
-master.peers=localhost:9333,localhost:9334,localhost:9335
|
||||||
> weed server -master.port=9335 -dir=./3 -volume.port=8082 -master.peers=localhost:9333,localhost:9334,localhost:9335
|
weed server -master.port=9334 -dir=./2 -volume.port=8081 \
|
||||||
|
-master.peers=localhost:9333,localhost:9334,localhost:9335
|
||||||
|
weed server -master.port=9335 -dir=./3 -volume.port=8082 \
|
||||||
|
-master.peers=localhost:9333,localhost:9334,localhost:9335
|
||||||
```
|
```
|
||||||
|
|
||||||
Or, you can use this "-peers" settings to add master servers one by one.
|
Or, you can use this "-peers" settings to add master servers one by one.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
> weed server -master.port=9333 -dir=./1 -volume.port=8080
|
> weed server -master.port=9333 -dir=./1 -volume.port=8080
|
||||||
> weed server -master.port=9334 -dir=./2 -volume.port=8081 -master.peers=localhost:9333
|
> weed server -master.port=9334 -dir=./2 -volume.port=8081 -master.peers=localhost:9333
|
||||||
> weed server -master.port=9335 -dir=./3 -volume.port=8082 -master.peers=localhost:9334
|
> weed server -master.port=9335 -dir=./3 -volume.port=8082 -master.peers=localhost:9334
|
||||||
```
|
```
|
||||||
|
|
||||||
## How it works
|
## How it works
|
||||||
|
|
||||||
The master servers are coordinated by Raft protocol, to elect a leader. The leader took over all the work to manage volumes, assign file ids. All other master servers just simply forward requests to the leader.
|
The master servers are coordinated by Raft protocol, to elect a leader. The leader took over all the work to manage volumes, assign file ids. All other master servers just simply forward requests to the leader.
|
||||||
|
|
||||||
If the leader dies, another leader will be elected. And all the volume servers will send their heartbeat together with their volumes information to the new leader. The new leader will take the full responsibility.
|
If the leader dies, another leader will be elected. And all the volume servers will send their heartbeat together with their volumes information to the new leader. The new leader will take the full responsibility.
|
||||||
@ -35,14 +39,14 @@ Now let's start the master and volume servers separately, the usual way.
|
|||||||
|
|
||||||
Usually you would start several (3 or 5) master servers, then start the volume servers:
|
Usually you would start several (3 or 5) master servers, then start the volume servers:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
> weed master -port=9333 -mdir=./1
|
weed master -port=9333 -mdir=./1
|
||||||
> weed master -port=9334 -mdir=./2 -peers=localhost:9333
|
weed master -port=9334 -mdir=./2 -peers=localhost:9333
|
||||||
> weed master -port=9335 -mdir=./3 -peers=localhost:9334
|
weed master -port=9335 -mdir=./3 -peers=localhost:9334
|
||||||
//now start the volume servers, specifying any one of the master server
|
# now start the volume servers, specifying any one of the master server
|
||||||
> weed volume -dir=./1 -port=8080
|
weed volume -dir=./1 -port=8080
|
||||||
> weed volume -dir=./2 -port=8081 -mserver=localhost:9334
|
weed volume -dir=./2 -port=8081 -mserver=localhost:9334
|
||||||
> weed volume -dir=./3 -port=8082 -mserver=localhost:9335
|
weed volume -dir=./3 -port=8082 -mserver=localhost:9335
|
||||||
```
|
```
|
||||||
|
|
||||||
These 6 commands will actually functioning the same as the previous 3 commands from the cheatsheet.
|
These 6 commands will actually functioning the same as the previous 3 commands from the cheatsheet.
|
||||||
@ -53,10 +57,10 @@ Even though we only specified one peer in "-peers" option to bootstrap, the mast
|
|||||||
|
|
||||||
If you need to restart the master servers, just run the master servers WITHOUT the "-peers" option.
|
If you need to restart the master servers, just run the master servers WITHOUT the "-peers" option.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
> weed master -port=9333 -mdir=./1
|
weed master -port=9333 -mdir=./1
|
||||||
> weed master -port=9334 -mdir=./2
|
weed master -port=9334 -mdir=./2
|
||||||
> weed master -port=9335 -mdir=./3
|
weed master -port=9335 -mdir=./3
|
||||||
```
|
```
|
||||||
|
|
||||||
To understand why, remember that the cluster information is "sticky", meaning it is stored on disk. If you restart the server, the cluster information stay the same, so the "-peers" option is not needed again.
|
To understand why, remember that the cluster information is "sticky", meaning it is stored on disk. If you restart the server, the cluster information stay the same, so the "-peers" option is not needed again.
|
||||||
|
Loading…
Reference in New Issue
Block a user