double master question

71 views
Skip to first unread message

Andy Chen

unread,
Sep 9, 2014, 6:03:59 AM9/9/14
to weed-fil...@googlegroups.com

I setup 2 master node and 2 data node on 2 different machines, each machine have 1 master and 1 data node. Assume that 2 machines are in different data centre.

Setting is as follows:

Topology file:

<Configuration>
<Topology>
<DataCenter name="dc1">
<Rack name="rack1">
<Ip>19.168.1.1</Ip>
</Rack>
</DataCenter> <DataCenter name="dc2">
<Rack name="rack1">
<Ip>192.168.1.2
</Rack>
</DataCenter>
</Topology>
</Configuration>

machine1 (192.168.1.1):

$ weed master -ip=192.168.1.1 -port=9333 -mdir=/home/test/dev/weed-fs/master -defaultReplication=100 $ weed volume -dir=/home/test/dev/weed-fs/data -ip=192.168.1.1 -port=8080 -mserver=192.168.1.1:9333

machine2 (192.168.1.2):

$ weed master -ip=192.168.1.2 -port=9333 -mdir=/home/test/dev/weed-fs/master -defaultReplication=100 -peers=192.168.1.1:9333 $ weed volume -dir=/home/test/dev/weed-fs/data -ip=192.168.1.2 -port=8080 -mserver=192.168.1.2:9333

It was quite smooth for upload and download at first. Replication did well as well. But after switching the leader node from machine 1 to machine 2, machine 2 did not take over as the leader.

Could you please help me to check if my setting was wrong?

Chris Lu

unread,
Sep 9, 2014, 10:42:08 AM9/9/14
to weed-fil...@googlegroups.com

How did you "switching the leader node from machine 1 to machine"?

--
You received this message because you are subscribed to the Google Groups "Weed File System" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weed-file-syst...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andy Chen

unread,
Sep 9, 2014, 10:11:52 PM9/9/14
to weed-fil...@googlegroups.com
means that when a server(leader) crash(or stop), let the other acts as a leader, automatically.

Chris Lu

unread,
Sep 10, 2014, 4:03:14 AM9/10/14
to weed-fil...@googlegroups.com
The leader election is based on Raft protocol. With only 2 masters, it would not be enough to select a leader, since no one can get "majority" votes. You would need to have 3 masters.

Chris

Andy Chen

unread,
Sep 11, 2014, 2:58:33 AM9/11/14
to weed-fil...@googlegroups.com
谢谢你的回复,我还是用中文吧,呵呵.
已经起了3个master, 现在master能够自动切换了, 但是有个问题, 就是当leader master停止的时候, volume不能自动连接到新的leader master,查看状态的时候(/dir/status?pretty=y), 显示的volume不全,有的有显示,有的没显示, 如果把停止的master重新启动的话, 就可以显示所有的volume了, 请问这个怎么来解决?

Chris Lu

unread,
Sep 11, 2014, 4:17:19 AM9/11/14
to weed-fil...@googlegroups.com

You will need some wait time before the volumes updates their statues on master leader.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages