This behavior has been reproduced on a small test cluster with a single
ZooKeeper as well as a production cluster with five ZooKeepers.

On Wed, Sep 9, 2009 at 6:43 PM, <[email protected]> wrote:

> Hi,
> In Hbase getting started, there's someting about ZooKeeper quorum count.
> Maybe you just set one ZooKeeper quorum , trying to set more ZooKeeper
> quorums.
> I think it could be ok!
>
> Fleming
>
> It is recommended to run a ZooKeeper quorum of 5 or 7 machines, and give
> each server around 1GB to ensure that they don't swap. It is also
> recommended to run the ZooKeeper servers on separate machines from the
> Region Servers with their own disks. If this is not easily doable for you,
> choose 5 of your region servers to run the ZooKeeper servers on.
>
>
>
>
>
>
>
>                      elsif
>                      <elsif.t...@gmail        To:
> [email protected]
>                      .com>                    cc:      (bcc: Y_823910/TSMC)
>                                               Subject: Hbase 0.20.0
> threading issue
>                      2009/09/10 09:07
>                      AM
>                      Please respond to
>                      hbase-user
>
>
>
>
>
>
> Hello.  We are trying to use Hbase in a threaded application and are
> encountering an issue with the ZooKeeper connection being lost:
>
> org.apache.hadoop.hbase.client.NoServerForRegionException: Timed out
> trying to locate root region
>
> The following sample program returns 10 results and 10 of the above
> errors.  Code was compiled against the 0.20.0 svn fork and the
> pre-compiled Hadoop 0.20.0 release.
>
> import java.io.IOException;
>
> import org.apache.hadoop.hbase.HBaseConfiguration;
> import org.apache.hadoop.hbase.KeyValue;
> import org.apache.hadoop.hbase.client.HTable;
> import org.apache.hadoop.hbase.client.Get;
> import org.apache.hadoop.hbase.client.Result;
> import org.apache.hadoop.hbase.util.Bytes;
>
> // create 'fc_test', {NAME => 'json', VERSIONS => 1}, {NAME => 'data',
> VERSIONS =>1}
> // put 'fc_test', 'testing123', 'json:', "[1,2,3]"
>
> public class TableTest extends Thread {
>    public void run() {
>        try {
>            String key = "testing123";
>            HBaseConfiguration conf = new HBaseConfiguration();
>            HTable table = new HTable(conf, "fc_test");
>            Get get = new Get(Bytes.toBytes(key));
>            get.addFamily(Bytes.toBytes("json"));
>            Result result = table.get(get);
>            KeyValue[] kvs = result.raw();
>
>            System.out.println(Bytes.toString(kvs[0].getValue()));
>        } catch (Exception e) {
>            System.out.println(e.toString());
>        }
>
>        try {
>            Thread.currentThread().sleep(1000);
>        } catch (Exception e) {
>        }
>
>    }
>
>    public static void main(String args[]) throws IOException {
>        Thread t = null;
>        int i;
>
>        for (i = 0; i< 20; i++) {
>            t = new TableTest();
>            t.start();
>        }
>
>        // wait for last thread
>        try {
>            t.join();
>        } catch (InterruptedException e) {
>        }
>    }
> }
>
>
> #!/bin/bash
>
> export
>
> CLASSPATH=.:/opt/hbase/conf:/opt/hbase/build/hbase-0.20.0.jar:/opt/hbase/lib/AgileJSON-2009-03-30.jar:/opt/hbase/lib/commons-cli-2.0-SNAPSHOT.jar:/opt/hbase/lib/commons-el-from-jetty-5.1.4.jar:/opt/hbase/lib/commons-httpclient-3.0.1.jar:/opt/hbase/lib/commons-logging-1.0.4.jar:/opt/hbase/lib/commons-logging-api-1.0.4.jar:/opt/hbase/lib/commons-math-1.1.jar:/opt/hbase/lib/hadoop-0.20.0-plus4681-core.jar:/opt/hbase/lib/hadoop-0.20.0-test.jar:/opt/hbase/lib/hadoop-gpl-compression-0.1.0-dev.jar:/opt/hbase/lib/jasper-compiler-5.5.12.jar:/opt/hbase/lib/jasper-runtime-5.5.12.jar:/opt/hbase/lib/jetty-6.1.14.jar:/opt/hbase/lib/jetty-util-6.1.14.jar:/opt/hbase/lib/jruby-complete-1.2.0.jar:/opt/hbase/lib/json.jar:/opt/hbase/lib/junit-3.8.1.jar:/opt/hbase/lib/libthrift-r771587.jar:/opt/hbase/lib/log4j-1.2.15.jar:/opt/hbase/lib/lucene-core-2.2.0.jar:/opt/hbase/lib/servlet-api-2.5-6.1.14.jar:/opt/hbase/lib/xmlenc-0.52.jar:/opt/hbase/lib/zookeeper-r785019-hbase-1329.jar
>
>
> javac -classpath ${CLASSPATH} TableTest.java
>
> java -classpath ${CLASSPATH}  TableTest 2>err.log
>
>
>
>
>
>  ---------------------------------------------------------------------------
>                                                         TSMC PROPERTY
>  This email communication (and any attachments) is proprietary information
>  for the sole use of its
>  intended recipient. Any unauthorized review, use or distribution by anyone
>  other than the intended
>  recipient is strictly prohibited.  If you are not the intended recipient,
>  please notify the sender by
>  replying to this email, and then delete this email and any copies of it
>  immediately. Thank you.
>
>  ---------------------------------------------------------------------------
>
>
>
>

Reply via email to