Hbase shell命令

Hbase shell命令,hbase,Hbase,我有一个很愚蠢的Hbase问题,但我被困了很长时间。 当我登录时,Hbase shell发出以下命令: [jack@HOST117-20 bin]$ ./hbase shell HBase Shell; enter 'help<RETURN>' for list of supported commands. Type "exit<RETURN>" to leave the HBase Shell Version 0.94.0, r1332822, Tue May 1 2

我有一个很愚蠢的Hbase问题,但我被困了很长时间。 当我登录时,Hbase shell发出以下命令:

[jack@HOST117-20 bin]$ ./hbase shell
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.94.0, r1332822, Tue May  1 21:43:54 UTC 2012

hbase(main):001:0>scon mytable
[jack@HOST117-20箱]$/hbase外壳
HBase外壳;输入“帮助”以获取支持的命令列表。
键入“exit”以离开HBase外壳
版本0.94.0,r1332822,星期二2012年5月1日21:43:54 UTC
hbase(主):001:0>scon mytable
我发现我不能删除命令,例如,如果我键入了错误的命令“scon”,那么我不能使用Backspace或delete按钮删除命令,我必须重新键入。
提前感谢

我遇到了同样的问题,并发现通过键入以下命令行(我通过读取/usr/lib/hbase/bin/hbase找到此命令行),即使使用标准irb也可以重现该问题

因此,根本原因不存在于HBase外壳中,而存在于JRuby中,进一步调查表明,根本原因存在于JRuby 1.6.5使用的JLine中

首先,我创建了~/.jlinebindings.properties文件并将“Rubout:backward delete char”放在那里,希望backspace键可以“删除光标后面的一个字符”,但它不起作用。更糟糕的是,.jlinebindings.properties文件的存在清除了其他键绑定(例如箭头键的绑定),因此我删除了.jlinebindings.properties。我尝试将密钥绑定设置添加到~/.jline.rc和~/.inputrc,但它们也不起作用

我检查了JLine2源代码以进一步调查,发现最新版本的JLine2不支持.jlinebindings.properties文件。但支持.jline.rc。因此,我编译了最新的JLIne2源代码,将密钥绑定到.jline.rc文件,并指定JLIne2库(target/jline-2.10-SNAPSHOT.jar)作为类路径的第一个元素,但它不起作用。对于新建的JLine2库,JRuby 1.6.5抛出了不兼容的ClassChangeError。这意味着JLine2已更改其API并破坏了向后兼容性

接下来,我检查了JRuby源代码,并将其编译如下

# JRuby compilation requires ant
$ yum install ant

# Without this, compilation fails.
$ yum install ant-apache-regexp

$ git clone https://github.com/jruby/jruby.git

# Check the latest version
$ git tag

$ git checkout 1.7.1
$ mvn install
使用新的JRuby二进制文件,我再次调用了命令行

$ java -cp \
    ~/.m2/repository/org/jruby/jruby-complete/1.7.1/jruby-complete-1.7.1.jar \
    org.jruby.Main /usr/bin/irb
但是,它引发了SyntaxerError

SyntaxError: file:/home/admin/.m2/repository/org/jruby/jruby-complete/1.7.1/jruby-complete-1.7.1.jar!/META-INF/jruby.home/lib/ruby/1.9/irb/lc/ja/encoding_aliases.rb:7: syntax error, unexpected kEND

end
  ^
         eval at org/jruby/RubyKernel.java:1066
    real_load at jar:file:/home/admin/.m2/repository/org/jruby/jruby-complete/1.7.1/jruby-complete-1.7.1.jar!/META-INF/jruby.home/lib/ruby/1.9/irb/locale.rb:134
         load at jar:file:/home/admin/.m2/repository/org/jruby/jruby-complete/1.7.1/jruby-complete-1.7.1.jar!/META-INF/jruby.home/lib/ruby/1.9/irb/locale.rb:110
   initialize at jar:file:/home/admin/.m2/repository/org/jruby/jruby-complete/1.7.1/jruby-complete-1.7.1.jar!/META-INF/jruby.home/lib/ruby/1.9/irb/locale.rb:32
  init_config at jar:file:/home/admin/.m2/repository/org/jruby/jruby-complete/1.7.1/jruby-complete-1.7.1.jar!/META-INF/jruby.home/lib/ruby/1.9/irb/init.rb:114
        setup at jar:file:/home/admin/.m2/repository/org/jruby/jruby-complete/1.7.1/jruby-complete-1.7.1.jar!/META-INF/jruby.home/lib/ruby/1.9/irb/init.rb:16
        start at jar:file:/home/admin/.m2/repository/org/jruby/jruby-complete/1.7.1/jruby-complete-1.7.1.jar!/META-INF/jruby.home/lib/ruby/1.9/irb.rb:53
       (root) at /usr/bin/irb:13
编码_aliases.rb(或者新的JRuby做了一些破坏向后兼容性的更改)一定有问题,但我不想对此进行调查,因此添加了LANG=C作为解决方法

$ LANG=C java -cp \
    ~/.m2/repository/org/jruby/jruby-complete/1.7.1/jruby-complete-1.7.1.jar \
    org.jruby.Main /usr/bin/irb
这成功地调用了irb,我可以确认backspace按预期工作。maven/jrubycore/pom.xml说jruby1.7.1所指的JLIne版本是2.7

作为最后一步,我尝试通过以下操作让HBase shell使用新的JRuby

$ cd /usr/lib/hbase/lib
$ mv jruby-complete-1.6.5.jar{,.backup}
$ cp ~/.m2/repository/org/jruby/jruby-complete/1.7.1/jruby-complete-1.7.1.jar .
$ hbase shell
但是,HBase外壳并没有启动。相反,发出了下面的错误消息

include_class is deprecated. Use java_import.
include_class is deprecated. Use java_import.
include_class is deprecated. Use java_import.
12/12/28 18:03:12 WARN conf.Configuration: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
NoMethodError: undefined method `getTerminal' for Java::Jline::Terminal:Module
  refresh_width at /usr/lib/hbase/bin/../bin/../lib/ruby/shell/formatter.rb:34
     initialize at /usr/lib/hbase/bin/../bin/../lib/ruby/shell/formatter.rb:47
         (root) at /usr/lib/hbase/bin/../bin/hirb.rb:108
这些错误消息表明,在/usr/lib/hbase/lib下替换jruby complete-*.jar并不能解决问题


因此,我放弃了,并得出结论,在这个问题上没有简单的解决办法。我的最终结论是,我们必须等待HBase专家用新的JRuby更新HBase外壳实现。

我遇到了同样的问题。我在Win 7框中以xterm模式使用SecureCRT以SSH方式连接到CentOS 6.3 Linux服务器

我安装了hbase之类的东西,然后我发现我的backspace键和delete键都在向右删除。所以,@Jack,我想你的退格没有被破坏,只是它的功能是作为另一个删除键,而不是它的正常行为(向左删除)

我找到了一个解决方案:使用Ctrl+Backspace向左删除。它对我来说很有魅力。因此,如果您在过去2年中没有找到解决方案,您应该试试这个;)


顺便说一句,虽然我找到了这个解决办法,但我仍然不知道为什么会发生这种情况。如果有人知道这个问题的原因(irb的错误或SecureCRT的错误设置?),请告诉我。谢谢

您可能正在windows上使用secureCRT。我在这个配置中遇到了同样的问题。我改用油灰,问题就消失了。如果您仍然想使用SecureCRT,我找到了一个解决方法—转到会话配置并在仿真部分使用终端“Linux”,现在在HBase Shell中,您可以使用Ctrl backspace来执行“backspace”工作

我从未遇到过这个问题,但我只玩过0.90。你在用什么操作系统?是的,很奇怪,我怀疑可能缺少插件
include_class is deprecated. Use java_import.
include_class is deprecated. Use java_import.
include_class is deprecated. Use java_import.
12/12/28 18:03:12 WARN conf.Configuration: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
NoMethodError: undefined method `getTerminal' for Java::Jline::Terminal:Module
  refresh_width at /usr/lib/hbase/bin/../bin/../lib/ruby/shell/formatter.rb:34
     initialize at /usr/lib/hbase/bin/../bin/../lib/ruby/shell/formatter.rb:47
         (root) at /usr/lib/hbase/bin/../bin/hirb.rb:108