[sheepdog] [PATCH] multi-sheep cluster in one zookeeper cluster.

Liu Yuan namei.unix at gmail.com
Fri Feb 27 08:55:25 CET 2015


On Fri, Feb 27, 2015 at 03:46:05PM +0800, Xu Yifeng wrote:
> 
> On 2015年02月27日 15:10, Ruoyu wrote:
> >
> >On 2015年02月27日 13:41, Xu Yifeng wrote:
> >>
> >>On 2015年02月27日 12:04, Liu Yuan wrote:
> >>>On Fri, Feb 27, 2015 at 11:51:22AM +0800, Yifeng Xu wrote:
> >>>>Is this patch really necessary ? I think zookeeper C client support
> >>>>chroot, if you read zookeeper.c source code, you will find it,
> >>>>here is some code quoted:
> >>>>
> >>>>/**
> >>>>  * Create a zookeeper handle associated with the given host and port.
> >>>>  */
> >>>>zhandle_t *zookeeper_init(const char *host, watcher_fn watcher,
> >>>>   int recv_timeout, const clientid_t *clientid, void
> >>>>*context, int flags)
> >>>>...
> >>>>//parse the host to get the chroot if
> >>>>     //available
> >>>>     index_chroot = strchr(host, '/');
> >>>>     if (index_chroot) {
> >>>>         zh->chroot = strdup(index_chroot);
> >>>>         if (zh->chroot == NULL) {
> >>>>             goto abort;
> >>>>         }
> >>>>
> >>>Intresting. How we take advantage of this feature? Did you
> >>>mean that we can
> >>>just append the cluster id on to "host" parameter?
> >>>
> >>>Thanks
> >>>Yuan
> >>>
> >>Yes, we can.
> >Thanks for you advice. I have a problem in using this feature.
> >sheep exit with error when I try to start it with cluster option:
> >-c zookeeper:127.0.0.1:2181/default,timeout=10000
> >
> >The error message is as below.
> >
> >Feb 27 15:00:21   INFO [main] zk_init(1401) version 3.4.6, address
> >127.0.0.1:2181/default, timeout 10000
> >Feb 27 15:00:21   INFO [main] zk_init(1421) the negociated session
> >timeout is 10000
> >Feb 27 15:00:21  ERROR [main] zk_queue_init(644) failed, path
> >/sheepdog, no node
> >Feb 27 15:00:21  ERROR [main] main(954) failed to create sheepdog cluster
> >
> >Is something wrong?
> 
> Make sure you have created a directory before starting sheepdog, on
> my machine, I initialized it by following commands:
> /usr/share/zookeeper/bin/zkCli.sh
>  create /default myfoo
>  quit
> sheep -czookeeper:um37.sa.cl:2181/default,timeout=10000 /home/xyf/sheepdata/
> 

Cool, it will be a small modification for sheep to create the root directory.
I'd like to see someone make a patch for this approach.

Yuan



More information about the sheepdog mailing list