Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D52AA10122 for ; Wed, 26 Nov 2014 15:57:36 +0000 (UTC) Received: (qmail 95265 invoked by uid 500); 26 Nov 2014 15:57:36 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 95172 invoked by uid 500); 26 Nov 2014 15:57:35 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 95159 invoked by uid 99); 26 Nov 2014 15:57:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Nov 2014 15:57:35 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of yuzhihong@gmail.com designates 209.85.213.48 as permitted sender) Received: from [209.85.213.48] (HELO mail-yh0-f48.google.com) (209.85.213.48) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Nov 2014 15:57:09 +0000 Received: by mail-yh0-f48.google.com with SMTP id i57so1432956yha.35 for ; Wed, 26 Nov 2014 07:57:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=g22WoKazu5NdUSlikWnQ4M++J2Dkr+snBcdXc7xvD7s=; b=QOjv+qejp6s1d8iun8cLSs5eMmira+uu4wvOSP2IO0Wocg0eJWxOgZAbPztg3SORgE 9OE8lY23QC8OSY5e6UFNuiZFOui5xFRCV8q3coJIrLTvLjhOOesF4s2772B+gCk3ElC3 2vVaXZ6cJi0Nkk4a4G5Thhi6F8FtLhddX/R5Y4XGpQz5FrtOOx/bDftdFYoJnbv5gdm2 +PujYGKrQZi2LR7cIYxW1EXvj90WN3k49Qrt+eCRH2lynK18FY5c8J8XXXL5RRiplwpT cjZ5Fd/1eiqgkS+d2RKdf7GN/CRWNiXH0N42Yz0b9hXux815uUmN+o5a7msCszQrNXYj 05ig== MIME-Version: 1.0 X-Received: by 10.236.220.194 with SMTP id o62mr31681489yhp.32.1417017428047; Wed, 26 Nov 2014 07:57:08 -0800 (PST) Received: by 10.170.180.7 with HTTP; Wed, 26 Nov 2014 07:57:07 -0800 (PST) In-Reply-To: <1417008617683-4066381.post@n3.nabble.com> References: <1318922066090-3430514.post@n3.nabble.com> <1417008617683-4066381.post@n3.nabble.com> Date: Wed, 26 Nov 2014 07:57:07 -0800 Message-ID: Subject: Re: Hbase client do not able to connect with remote Hbase server From: Ted Yu To: "dev@hbase.apache.org" Content-Type: multipart/alternative; boundary=001a11c22f9c707f240508c51424 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c22f9c707f240508c51424 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Your client misses imports. e.g. import org.apache.hadoop.conf.Configuration; Please refer to unit tests, such as hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin1.java Cheers On Wed, Nov 26, 2014 at 5:30 AM, piyush mishra wrote: > hii all of you, > > I want to connect hbase remotely using my java client. > > here my java code is : > > public class CreateTable { > public static void main(String[] agrs) { > // CONFIGURATION > > // ENSURE RUNNING > try { > /*Configuration hbaseConfig ; > hbaseConfig =3D HBaseConfiguration.create(); */ > Configuration hbaseConfig =3D HBaseConfiguration.create(); > hbaseConfig.set("hbase.zookeeper.quorum", "maprdemo"); > hbaseConfig.set("hbase.zookeeper.property.clientPort","5181"); > /* hbaseConfig.set("hbase.master", "maprdemo:5181"); */ > /* hbaseConfig.set(=E2=80=9Chbase.master=E2=80=9D, =E2=80=9C:60000=E2=80= =B3); */ > //*HBaseConfiguration config =3D HBaseConfiguration.create(); */ > //config.set(=E2=80=9Chbase.zookeeper.quorum=E2=80=9D, =E2=80=9Clocalhost= =E2=80=9D); // Here we are running > zookeeper locally */ > HBaseAdmin.checkHBaseAvailable(hbaseConfig); > System.out.println("HBase is running!"); > //*createTable(config); > //creating a new table */ > HTable table =3D new HTable(hbaseConfig, "mytest"); > System.out.println("Table mytable obtained "); > // addData(table); > } > catch (MasterNotRunningException e) { > System.out.println("HBase is not running!"); > System.exit(1); > }catch (Exception ce){ ce.printStackTrace(); } > > } > > /* private static void addData(HTable table) { > // TODO Auto-generated method stub > > } */ > > } > > When i compiled this using > javac CreateTable.java > > > i get this error: > > CreateTable.java:9: error: cannot find symbol > Configuration hbaseConfig =3D HBaseConfiguration.create(); > ^ > symbol: class Configuration > location: class CreateTable > CreateTable.java:9: error: cannot find symbol > Configuration hbaseConfig =3D HBaseConfiguration.create(); > ^ > symbol: variable HBaseConfiguration > location: class CreateTable > CreateTable.java:16: error: cannot find symbol > HBaseAdmin.checkHBaseAvailable(hbaseConfig); > ^ > symbol: variable HBaseAdmin > location: class CreateTable > CreateTable.java:20: error: cannot find symbol > HTable table =3D new HTable(hbaseConfig, "mytest"); > ^ > symbol: class HTable > location: class CreateTable > CreateTable.java:20: error: cannot find symbol > HTable table =3D new HTable(hbaseConfig, "mytest"); > ^ > symbol: class HTable > location: class CreateTable > CreateTable.java:24: error: cannot find symbol > catch (MasterNotRunningException e) { > ^ > symbol: class MasterNotRunningException > location: class CreateTable > > > Please suggest me what i do.. > > > > > -- > View this message in context: > http://apache-hbase.679495.n3.nabble.com/Hbase-client-do-not-able-to-conn= ect-with-remote-Hbase-server-tp3430514p4066381.html > Sent from the HBase Developer mailing list archive at Nabble.com. > --001a11c22f9c707f240508c51424--