You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Li Li <fa...@gmail.com> on 2015/01/05 09:26:43 UTC

Unable to load native-hadoop library in java hbase client

WARN main org.apache.hadoop.util.NativeCodeLoader Unable to load
native-hadoop library for your platform... using builtin-java classes
where applicable

I have correctly installed native lib in hadoop and hbase.

I can verify it by ./bin/hbase --config ~/conf_hbase
org.apache.hadoop.util.NativeLibraryChecker
15/01/05 16:22:53 WARN bzip2.Bzip2Factory: Failed to load/initialize
native-bzip2 library system-native, will use pure-Java version
15/01/05 16:22:53 INFO zlib.ZlibFactory: Successfully loaded &
initialized native-zlib library
Native library checking:
hadoop: true /home/lli/hadoop-2.3.0/lib/native/libhadoop.so.1.0.0
zlib:   true /lib/x86_64-linux-gnu/libz.so.1
snappy: true /usr/local/lib/libsnappy.so.1
lz4:    true revision:99
bzip2:  false

bzip2 is not installed but I don't use it.

Also when run hbase shell, it's ok(no warn of unable to load
native-hadoop library)

But when I run java client codes, it prints this warn.
my java code is simple:

    Configuration conf = HBaseConfiguration.create();
    conf.set("hbase.zookeeper.quorum", "localhost");
    conf.set("hbase.zookeeper.property.clientPort", "2181");
    HConnection conn = HConnectionManager.createConnection(conf);

Re: Unable to load native-hadoop library in java hbase client

Posted by Stack <st...@duboce.net>.
On Mon, Jan 5, 2015 at 6:58 PM, Li Li <fa...@gmail.com> wrote:

> yes, I have read it. the hbase server is correctly configured because
> I can create a table with snappy compression algorithm. Also it's
> correct for the ./bin/hbase shell.
> But my java client print this warning message.(for now it's a single
> node pesudo cluster and the java client run on the same machine of
> hbase/hadoop) I think the problem is the java client can't find native
> library path. What environment variables should I set?
>
>
How do you invoke your client?

What if in the same terminal as the hbase shell works, you do a 'bin/hbase
classpath' and save what is output then set this as CLASSPATH for your
client, does it still fail?

St.Ack

Re: Unable to load native-hadoop library in java hbase client

Posted by Li Li <fa...@gmail.com>.
yes, I have read it. the hbase server is correctly configured because
I can create a table with snappy compression algorithm. Also it's
correct for the ./bin/hbase shell.
But my java client print this warning message.(for now it's a single
node pesudo cluster and the java client run on the same machine of
hbase/hadoop) I think the problem is the java client can't find native
library path. What environment variables should I set?

On Mon, Jan 5, 2015 at 11:59 PM, Stack <st...@duboce.net> wrote:
> You checked the section in the refguide on loading native libs:
> http://hbase.apache.org/book.html#hadoop.native.lib ? It was updated
> recently.
>
> You have symlinked or copied the the native libs under your client?  List
> out the links for us here.
>
> St.Ack
>
>
> On Mon, Jan 5, 2015 at 12:26 AM, Li Li <fa...@gmail.com> wrote:
>
>> WARN main org.apache.hadoop.util.NativeCodeLoader Unable to load
>> native-hadoop library for your platform... using builtin-java classes
>> where applicable
>>
>> I have correctly installed native lib in hadoop and hbase.
>>
>> I can verify it by ./bin/hbase --config ~/conf_hbase
>> org.apache.hadoop.util.NativeLibraryChecker
>> 15/01/05 16:22:53 WARN bzip2.Bzip2Factory: Failed to load/initialize
>> native-bzip2 library system-native, will use pure-Java version
>> 15/01/05 16:22:53 INFO zlib.ZlibFactory: Successfully loaded &
>> initialized native-zlib library
>> Native library checking:
>> hadoop: true /home/lli/hadoop-2.3.0/lib/native/libhadoop.so.1.0.0
>> zlib:   true /lib/x86_64-linux-gnu/libz.so.1
>> snappy: true /usr/local/lib/libsnappy.so.1
>> lz4:    true revision:99
>> bzip2:  false
>>
>> bzip2 is not installed but I don't use it.
>>
>> Also when run hbase shell, it's ok(no warn of unable to load
>> native-hadoop library)
>>
>> But when I run java client codes, it prints this warn.
>> my java code is simple:
>>
>>     Configuration conf = HBaseConfiguration.create();
>>     conf.set("hbase.zookeeper.quorum", "localhost");
>>     conf.set("hbase.zookeeper.property.clientPort", "2181");
>>     HConnection conn = HConnectionManager.createConnection(conf);
>>

Re: Unable to load native-hadoop library in java hbase client

Posted by Stack <st...@duboce.net>.
You checked the section in the refguide on loading native libs:
http://hbase.apache.org/book.html#hadoop.native.lib ? It was updated
recently.

You have symlinked or copied the the native libs under your client?  List
out the links for us here.

St.Ack


On Mon, Jan 5, 2015 at 12:26 AM, Li Li <fa...@gmail.com> wrote:

> WARN main org.apache.hadoop.util.NativeCodeLoader Unable to load
> native-hadoop library for your platform... using builtin-java classes
> where applicable
>
> I have correctly installed native lib in hadoop and hbase.
>
> I can verify it by ./bin/hbase --config ~/conf_hbase
> org.apache.hadoop.util.NativeLibraryChecker
> 15/01/05 16:22:53 WARN bzip2.Bzip2Factory: Failed to load/initialize
> native-bzip2 library system-native, will use pure-Java version
> 15/01/05 16:22:53 INFO zlib.ZlibFactory: Successfully loaded &
> initialized native-zlib library
> Native library checking:
> hadoop: true /home/lli/hadoop-2.3.0/lib/native/libhadoop.so.1.0.0
> zlib:   true /lib/x86_64-linux-gnu/libz.so.1
> snappy: true /usr/local/lib/libsnappy.so.1
> lz4:    true revision:99
> bzip2:  false
>
> bzip2 is not installed but I don't use it.
>
> Also when run hbase shell, it's ok(no warn of unable to load
> native-hadoop library)
>
> But when I run java client codes, it prints this warn.
> my java code is simple:
>
>     Configuration conf = HBaseConfiguration.create();
>     conf.set("hbase.zookeeper.quorum", "localhost");
>     conf.set("hbase.zookeeper.property.clientPort", "2181");
>     HConnection conn = HConnectionManager.createConnection(conf);
>