Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

HBase Shell giving error

NoMethodError: undefined method `getTerminal' for Java::Jline::Terminal:Module

refresh_width at /usr/hdp/2.5.0.0-1245/hbase/lib/ruby/shell/formatter.rb:33

initialize at /usr/hdp/2.5.0.0-1245/hbase/lib/ruby/shell/formatter.rb:46

(root) at /usr/hdp/2.5.0.0-1245/hbase/bin/hirb.rb:128

-------------------------------------------------------------------------------

I found it required higher version of protobuf jar so I updated HBase lib by replacing to protobuf-java-3.1.0.jar from protobuf-java-2.5.0.jar, still facing same error.

1 ACCEPTED SOLUTION

Super Collaborator

Did you make any changes in the hbase classpath or any new jars added to the lib directory? It seems that you have wrong jline there.

View solution in original post

15 REPLIES 15

Super Collaborator

Did you make any changes in the hbase classpath or any new jars added to the lib directory? It seems that you have wrong jline there.

@ssoldatov

I did not changed hbase classpath, I just replace protobuf jar that I mentioned above

Super Collaborator

I would suggest to return back the original protobuf (there was a thread about a similar issue somewhere on the internet, but this issue is not relevant to the protobuf). And check that no new jars were added to the HBase lib directory (like phoenix-client for example).

As suggested I return back the original protobuf, but still facing same error. There is no new jar is added in /hbase/lib but we have phoenix, ranger etc jar as I installed all this by Ambari.

Super Collaborator

Can you run ls -la /usr/hdp/2.5.0.0-1245/hbase/lib/*.jar and attach output here?

@ssoldatov

Thanks...!

In /usr/hdp/current/hbase-master/lib

  1. protobuf-java-3.1.0.jar -> /usr/ibmpacks/current/bigmatch/hbase/lib/protobuf-java-3.1.0.jar
  2. spark-assembly-1.6.2.2.5.0.0-1245-hadoop2.7.3.2.5.0.0-1245.jar -> /usr/ibmpacks/current/bigmatch/hbase/lib/sparkassembly-1.6.2.2.5.0.0-1245-hadoop2.7.3.2.5.0.0-1245.jar

I unlink above two and changed protobuf-java-3.1.0.jar from protobuf-java-2.5.0.jar in /hbase/lib and follow below link.

http://stackoverflow.com/questions/28563167/hbase-master-not-starting-correctly

It worked for me.

@HARISH BAJPAI

NoMethodError indicates that you are not using the correct version of jar in the classpath.

This is because the "protobuf-java-2.5.0.jar" might be having some classes with different method signature and the newer jar might have different syntax of those methods so you will get errors like you are getting. [NoMethodError: undefined method `getTerminal']

Which means in the newer version of the jar "getTerminal" method seems to be removed.

@jss

In this case what should me next course of action?

@HARISH BAJPAI

Please do not try to upgrade individual JARs Major Version. Because with every major version change many APIs are changed completely, Like some methods are added new/ some methods are removed and some methods signature is changed. So i will suggest you to not to upgrade the Major version (from 2.5.0 to 3.1.0 ). Please revert back to your old jar "protobuf-java-2.5.0.jar"

@@HARISH BAJPAI

For example you can refer to the following link which says that lots of methods have been removed between 2.5 and 3.0 version of Protobuf-java

https://abi-laboratory.pro/java/tracker/timeline/protobuf-java/

You can get the details by clicking on the "Removed Methods" and "Added Methods" links

Guru

Hbase in HDP-2.5 will NOT work with protobuf-3.0. Please refrain from manually changing libraries or classpath entries of any of the HDP components.

I have HDP2.5, I changed protobuf-3.0 with default one.

Cloudera Employee

cat /etc/hbase/conf/hbase-site.xml |grep -1 hbase.tmp, please make sure chmod 777 to hbase.tmp.dir . Things should work after same.

[root@HDCLUS01-HOST6 lib]# cat /etc/hbase/conf/hbase-site.xml |grep -1 hbase.tmp

<name>hbase.local.dir</name>

<value>${hbase.tmp.dir}/local</value>

</property>

--

<property>

<name>hbase.tmp.dir</name>

<value>/tmp/hbase-${user.name}</value>

----------------------------------------------------------- As mentioned above I provide chmod 777, but my bad still getting same error

I changed jruby-complete-1.7.4.jar to jruby-complete-1.6.8 in /hbase/lib, I tried to restart HBase but not Hmaster is stopped with "Connection refused to hdclus01-host6:16000"

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.