[sheepdog] writing cluster driver

Liu Yuan namei.unix at gmail.com
Tue Mar 10 10:33:18 CET 2015


On Tue, Mar 10, 2015 at 12:07:30PM +0300, Vasiliy Tolstov wrote:
> Hello. I'm ready to write etcd cluster driver, but i have some absent info.
> For example sheperd cluster driver have struct:
> 
> static struct cluster_driver cdrv_shepherd = {
>         .name           = "shepherd",
>         .init           = shepherd_init,
>         .join           = shepherd_join,
>         .leave          = shepherd_leave,
>         .notify         = shepherd_notify,
>         .block          = shepherd_block,
>         .unblock        = shepherd_unblock,
>         .update_node    = shepherd_update_node,
>         .get_local_addr = get_local_addr,
> };
> 
> Can you explain in which cases each of this function executed?
> Thanks

You could reference sheep/cluster.h for documentation. And the best way to
understand how cluster driver works and interact with sheep, is reference 
cluster/local.c and try kill & join the node and analyze the log with debug
enabled.

I assume etcd driver is similar to zookeeper, once you grasp local.c, the next
is to take a look at zookeeper.c white write etcd driver.

Thanks,
Yuan



More information about the sheepdog mailing list