AnsweredAssumed Answered

trouble calling mapr-hbase api to write to a mapr table

Question asked by elleg on Jun 25, 2014
Latest reply on Jun 26, 2014 by elleg
Hi there,

I am writing a small application to test mapr + hive against the amazon m7 cluster. I got the hive-site.xml configuration set up as you described in the docs, but I am still unable to make the connection to zookeeper.

Basically I would like to write to this mapr table test, and query it using hive. As a first step I am trying to write data to a mapr table and then I plan to create the mapr-hive table to link it to. (Is this approach correct?)

My mapr table:

    maprcli table create -path /mapr/MapR_EMR.amazonaws.com/data/test
    maprcli table cf create -path /mapr/MapR_EMR.amazonaws.com/data/test -cfname all -compression lzf -maxversions 5
    maprcli table cf create -path /mapr/MapR_EMR.amazonaws.com/data/test -cfname text -compression lzf -maxversions 5

     
hive-site.xml (i am not able to format the xml in this question, so I just pasted the values for each property here):

    hive.aux.jars.path  =
    file:///opt/mapr/hive/hive-0.11.0/lib/hive-hbase-handler-0.11.0-mapr.jar,file:///opt/mapr/hbase/hbase-0.94.17/hbase-0.94.17-mapr-1405.jar,file:///opt/mapr/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.jar

    hbase.zookeeper.quorum = got the quorum from hbase-site.xml
    hbase.zookeeper.property.clientPort = 5181

My code pretty much puts some data in the mapr table with this:

            hBaseConfiguration = HBaseConfiguration.create();
            table = new HTable(hBaseConfiguration, "test"); // should test be the full path?
      
            Put p = new Put(Bytes.toBytes(idString));
            p.add(Bytes.toBytes("all"), Bytes.toBytes("all"),Bytes.toBytes(jsonString));
            p.add(Bytes.toBytes("text"), Bytes.toBytes("text"),Bytes.toBytes(textAsString));
            table.put(p);

Error:

    2014-06-25 06:38:32 [main-SendThread(localhost:2181)] WARN  org.apache.zookeeper.ClientCnxn - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.7.0_40]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:735) ~[na:1.7.0_40]
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
    ~[zookeeper-3.4.5.jar:3.4.5-1392090]


    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068) ~[zookeeper-3.4.5.jar:3.4.5-1392090]

    2014-06-25 06:38:32 [main-SendThread(localhost:2181)] DEBUG o.a.zookeeper.ClientCnxnSocketNIO - Ignoring exception during shutdown input

Jars in my build:

              'org.apache.hadoop:hadoop-core:1.0.3-mapr-3.0.2'
              'com.mapr.fs:mapr-hbase:1.0.3-mapr-3.0.2',


Thanks!

Outcomes