<html><head><meta http-equiv="content-type" content="text/html; charset=GB2312"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }body { font-size: 10.5pt; font-family: 微软雅黑; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><br><span></span></div>
<blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><div> </div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b> <a href="mailto:liangry@ucweb.com">Ruoyu</a></div><div><b>Date:</b> 2015-02-27 15:10</div><div><b>To:</b> <a href="mailto:skypexu@gmail.com">Xu Yifeng</a>; <a href="mailto:namei.unix@gmail.com">Liu Yuan</a></div><div><b>CC:</b> <a href="mailto:yuyang@cmss.chinamobile.com">Yu Yang</a>; <a href="mailto:sheepdog@lists.wpkg.org">sheepdog</a></div><div><b>Subject:</b> Re: [sheepdog] [PATCH] multi-sheep cluster in one zookeeper cluster.</div></div></div><div><div> </div>
<div>On 2015年02月27日 13:41, Xu Yifeng wrote:</div>
<div>></div>
<div>> On 2015年02月27日 12:04, Liu Yuan wrote:</div>
<div>>> On Fri, Feb 27, 2015 at 11:51:22AM +0800, Yifeng Xu wrote:</div>
<div>>>> Is this patch really necessary ? I think zookeeper C client support</div>
<div>>>> chroot, if you read zookeeper.c source code, you will find it,</div>
<div>>>> here is some code quoted:</div>
<div>>>></div>
<div>>>> /**</div>
<div>>>> * Create a zookeeper handle associated with the given host and port.</div>
<div>>>> */</div>
<div>>>> zhandle_t *zookeeper_init(const char *host, watcher_fn watcher,</div>
<div>>>> int recv_timeout, const clientid_t *clientid, void *context, int </div>
<div>>>> flags)</div>
<div>>>> ...</div>
<div>>>> //parse the host to get the chroot if</div>
<div>>>> //available</div>
<div>>>> index_chroot = strchr(host, '/');</div>
<div>>>> if (index_chroot) {</div>
<div>>>> zh->chroot = strdup(index_chroot);</div>
<div>>>> if (zh->chroot == NULL) {</div>
<div>>>> goto abort;</div>
<div>>>> }</div>
<div>>>></div>
<div>>> Intresting. How we take advantage of this feature? Did you mean that </div>
<div>>> we can</div>
<div>>> just append the cluster id on to "host" parameter?</div>
<div>>></div>
<div>>> Thanks</div>
<div>>> Yuan</div>
<div>>></div>
<div>> Yes, we can.</div>
<div>Thanks for you advice. I have a problem in using this feature.</div>
<div>sheep exit with error when I try to start it with cluster option: -c </div>
<div>zookeeper:127.0.0.1:2181/default,timeout=10000</div>
<div> </div>
<div>The error message is as below.</div>
<div> </div>
<div>Feb 27 15:00:21 INFO [main] zk_init(1401) version 3.4.6, address </div>
<div>127.0.0.1:2181/default, timeout 10000</div>
<div>Feb 27 15:00:21 INFO [main] zk_init(1421) the negociated session </div>
<div>timeout is 10000</div>
<div>Feb 27 15:00:21 ERROR [main] zk_queue_init(644) failed, path /sheepdog, </div>
<div>no node</div>
<div>Feb 27 15:00:21 ERROR [main] main(954) failed to create sheepdog cluster</div>
<div> </div>
<div>Is something wrong?</div>
<div>></div>
<div>> Xu</div>
<div><br></div>
<div><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;">The curreent version does not support , you must make sure that the root znode exists.</span></div><div>So you should create "<span style="font-size: 10.5pt; line-height: 1.5; background-color: window;">/default</span><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;">" by hand in zk before you start your sheep.</span></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;"><br></span></div>
<div> </div>
</div></blockquote>
</body></html>