big-data-europe / docker-hadoop

Apache Hadoop docker image
2.2k stars 1.3k forks source link

java client raises `java.net.UnknownHostException: can not resolve hbase-master` #78

Closed diegoquintanav closed 4 years ago

diegoquintanav commented 4 years ago

How should I connect a client using the java API?. I'm using this at the moment this gist

Configuration config = HBaseConfiguration.create();
config.set("hbase.zookeeper.quorum", "localhost");
config.set("hbase.zookeeper.property.clientPort", "2181");
HBaseAdmin.available(config);

Returns

org.apache.hadoop.hbase.MasterNotRunningException: org.apache.hadoop.hbase.MasterNotRunningException: java.net.UnknownHostException: can not resolve hbase-master,16000,1592488743309
    at org.apache.hadoop.hbase.client.ConnectionImplementation.isMasterRunning(ConnectionImplementation.java:610)
    at org.apache.hadoop.hbase.client.HBaseAdmin.available(HBaseAdmin.java:2410)
    at Main.main(Main.java:95)

How should I fix this?


I'm using hbase-client 2.2.5, but version 1.6.0 rises the same problem.

        <!-- https://mvnrepository.com/artifact/org.apache.hbase/hbase-client -->
        <dependency>
            <groupId>org.apache.hbase</groupId>
            <artifactId>hbase-client</artifactId>
            <version>2.2.5</version>
        </dependency>
diegoquintanav commented 4 years ago

I wanted to post this in docker-hbase, lol. Please remove this.