How to connect to remote HBase in Java?

前端 未结 5 1341
独厮守ぢ
独厮守ぢ 2020-12-23 09:58

I have a standlone HBase server. This is my hbase-site.xml:


 
    hbase.rootdir
    

        
5条回答
  •  一个人的身影
    2020-12-23 10:04

    hbase.master is @Deprecated. Clients use Zookeeper to get current hostname/port of their HBase servers.

    @Deprecated
    config.set("hbase.master", "146.169.35.28:60000")
    

    Hadoop and HBase are very sensitive to DNS and /etc/hosts configuration. Make sure, your hostname doesn't point to 127.0.0.1 otherwise it will start many services listening on localhost only. Try not to use IP addresses anywhere in settings.

    My /etc/hosts:

    192.168.2.3     cloudera-vm     # Added by NetworkManager
    127.0.0.1       localhost.localdomain   localhost
    127.0.1.1       cloudera-vm-local localhost
    

    /etc/hbase/hbase-site.xml should have settings set distributed=false (since you are using this for testing only):

    
      hbase.cluster.distributed
      false
    
    

    /etc/zookeeper/zoo.cfg

    # the port at which the clients will connect
    clientPort=2181
    server.0=cloudera-vm:2888:3888
    

    List of my Java processes:

    root@cloudera-vm:~# jps
    1643 TaskTracker
    1305 JobTracker
    1544 SecondaryNameNode
    2037 Bootstrap
    9622 DataNode
    10144 Jps
    9468 NameNode
    1948 RunJar
    9746 HMaster
    

提交回复
热议问题