[ANN] bully: a leader election program

63 views
Skip to first unread message

Monnand

unread,
Mar 13, 2013, 11:17:41 PM3/13/13
to golan...@googlegroups.com, golang中文组
Hi all,

Since we need a simple leader election program in our project and I do
not mind to use Go to implement yet-another leader election program,
then here we go:

http://github.com/monnand/bully

The program is go-get-able and the usage is described in details in
README.md.

Quick example:

Suppose we want to run the program on two machines whose IPs are
192.168.1.67 and 192.168.1.68, respectively.

Run the following command on both machines:

bully -port=8117 -nodes="192.168.1.67:8117,192.168.1.68:8117"
-http=0.0.0.0:8080

To know who is the leader, use HTTP to connect one of the machines with
path /leader:

curl http://192.168.1.67:8080/leader

The leader's IP address will be replied through the HTTP connection.

To know more: https://github.com/monnand/bully

Regards,
-Monnand

Monnand

unread,
Mar 14, 2013, 2:55:24 AM3/14/13
to David Anderson, golan...@googlegroups.com, golang中文组
Thanks, David. They are really good points.

Here are the answers:

On 03/14/2013 12:22 AM, David Anderson wrote:
> The first questions that come to mind:
> what is the election algorithm used?

From the name, you may know the answer: Bully algorithm.

> How does it behave in a network partition? Does each partition get
> a leader (potentially corrupting state), or does no partition get a
> leader (potentially halting all progress) ?

In a network partition, each partition will get a leader.

> Both these outcomes are useful, but knowing the availability and
failure tolerance semantics of
> a leader election system is critical to using it correctly.
>

True. I will add more information in README later. Thank you!

Regards,
-Monnand
>
> On Wed, Mar 13, 2013 at 8:17 PM, Monnand <mon...@gmail.com
> <mailto:mon...@gmail.com>> wrote:
>
> Hi all,
>
> Since we need a simple leader election program in our project and I
> do not mind to use Go to implement yet-another leader election
> program, then here we go:
>
> http://github.com/monnand/__bully <http://github.com/monnand/bully>
>
> The program is go-get-able and the usage is described in details in
> README.md.
>
> Quick example:
>
> Suppose we want to run the program on two machines whose IPs are
> 192.168.1.67 and 192.168.1.68, respectively.
>
> Run the following command on both machines:
>
> bully -port=8117 -nodes="192.168.1.67:8117
> <http://192.168.1.67:8117>,192.__168.1.68:8117
> <http://192.168.1.68:8117>" -http=0.0.0.0:8080 <http://0.0.0.0:8080>
>
> To know who is the leader, use HTTP to connect one of the machines
> with path /leader:
>
> curl http://192.168.1.67:8080/__leader <http://192.168.1.67:8080/leader>
>
> The leader's IP address will be replied through the HTTP connection.
>
> To know more: https://github.com/monnand/__bully
> <https://github.com/monnand/bully>
>
> Regards,
> -Monnand
>
> --
> You received this message because you are subscribed to the Google
> Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to golang-nuts+unsubscribe@__googlegroups.com
> <mailto:golang-nuts%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/__groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
>
>

Reply all
Reply to author
Forward
0 new messages