Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to access HBase via REST API in Cloudera Quickstart VM.

Highlighted

How to access HBase via REST API in Cloudera Quickstart VM.

when i try to start it from terminal...its saying address bind exception.

 

 

[cloudera@quickstart ~]$ hbase rest start
2015-10-21 22:59:07,497 INFO [main] util.VersionInfo: HBase 0.98.6-cdh5.3.0
2015-10-21 22:59:07,497 INFO [main] util.VersionInfo: Subversion file:///data/jenkins/workspace/generic-package-rhel64-6-0/topdir/BUILD/hbase-0.98.6-cdh5.3.0 -r Unknown
2015-10-21 22:59:07,497 INFO [main] util.VersionInfo: Compiled by jenkins on Tue Dec 16 19:13:29 PST 2014
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/lib/hbase/lib/phoenix-server-4.5.2-HBase-0.98-runnable.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/lib/zookeeper/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
2015-10-21 22:59:07,909 INFO [main] impl.MetricsConfig: loaded properties from hadoop-metrics2-hbase.properties
2015-10-21 22:59:07,960 INFO [main] impl.MetricsSystemImpl: Scheduled snapshot period at 10 second(s).
2015-10-21 22:59:07,960 INFO [main] impl.MetricsSystemImpl: HBase metrics system started
2015-10-21 22:59:08,039 INFO [main] mortbay.log: Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog
2015-10-21 22:59:08,088 INFO [main] http.HttpServer: Added global filter 'safety' (class=org.apache.hadoop.http.HttpServer$QuotingInputFilter)
2015-10-21 22:59:08,090 INFO [main] http.HttpServer: Added filter static_user_filter (class=org.apache.hadoop.http.lib.StaticUserWebFilter$StaticUserFilter) to context rest
2015-10-21 22:59:08,090 INFO [main] http.HttpServer: Added filter static_user_filter (class=org.apache.hadoop.http.lib.StaticUserWebFilter$StaticUserFilter) to context static
2015-10-21 22:59:08,099 INFO [main] http.HttpServer: HttpServer.start() threw a non Bind IOException
java.net.BindException: Port in use: 0.0.0.0:8085
at org.apache.hadoop.http.HttpServer.openListener(HttpServer.java:742)
at org.apache.hadoop.http.HttpServer.start(HttpServer.java:686)
at org.apache.hadoop.hbase.rest.RESTServer.main(RESTServer.java:246)
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216)
at org.apache.hadoop.http.HttpServer.openListener(HttpServer.java:738)
... 2 more
Exception in thread "main" java.net.BindException: Port in use: 0.0.0.0:8085
at org.apache.hadoop.http.HttpServer.openListener(HttpServer.java:742)
at org.apache.hadoop.http.HttpServer.start(HttpServer.java:686)
at org.apache.hadoop.hbase.rest.RESTServer.main(RESTServer.java:246)
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216)
at org.apache.hadoop.http.HttpServer.openListener(HttpServer.java:738)
... 2 more
2015-10-21 22:59:08,112 INFO [Shutdown] mortbay.log: Shutdown hook executing
2015-10-21 22:59:08,112 INFO [Shutdown] mortbay.log: Shutdown hook complete
[cloudera@quickstart ~]$

2 REPLIES 2

Re: How to access HBase via REST API in Cloudera Quickstart VM.

Contributor

You can check if something is running on that port (for example the HBase service could be already launched):

 

netstat -utanp | grep :8085

 

Highlighted

Re: How to access HBase via REST API in Cloudera Quickstart VM.

Master Collaborator

You should probably ignore my original response, below - I was thinking of Cloudera Live, not QuickStartVM where CM is off by default. The recommended way to start the service in that case is 'sudo service hbase-rest start'. In my QuickStart VM the service starts up and there's nothing already using port 8085 before I start it. There are some Linux services that just pick a random post on start up and sometimes they get in the way of other services - I'd recommend following valtri's suggestion so you can get to the bottom of this, but if all else fails a reboot might be a simple way to get past this.

 

----

 

I'd also recommend starting the REST service through Cloudera Manager, as
it will set up an environment with the proper configuration for that
service. Starting it from the CLI, it's going to use the configs currently
in /etc/hbase/conf/ and that's intended for clients, etc. You may hit some
other funny issues going this route.

To do this, log into Cloudera Manager, click on the HBase service on the
left-hand side, go to the Instances tab, and click the button to add a
role. Select the REST service role, and follow the rest of the prompts...

Don't have an account?
Coming from Hortonworks? Activate your account here