我在 docker 容器中运行 HBase。
版本是 1.2.4
基本上基于
当我执行以下操作时:
1) 构建镜像: docker build -t hbase-docker 。
2)启动容器: ./start-hbase.sh
3)进入容器: docker exec -it hbase bash
4) 打开 HBase shell : hbase shell
5)然后如果我输入一些东西并按退格键,它会崩溃并显示以下内容:
hbase(main):001:0> ConsoleReader.java:1414:in `backspace': java.lang.ArithmeticException: / by zero
from ConsoleReader.java:1436:in `backspace'
from ConsoleReader.java:628:in `readLine'
from ConsoleReader.java:457:in `readLine'
from Readline.java:237:in `s_readline'
from Readline$s$s_readline.gen:65535:in `call'
from CachingCallSite.java:332:in `cacheAndCall'
...
...
知道如何使退格起作用并防止这种情况发生吗?!
谢谢你。
最佳答案
ssh 到您的 docker 容器或在浏览模式下连接到它,并使用 - 检查为终端设置的列数 -stty -a
您将在输出中看到类似下面的内容 -
speed 38400 baud; rows 39; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
当列数设置为零时,您的 shell 可能会崩溃,这是一个已知的 jLine 错误。检查以下链接以供引用 - https://github.com/jruby/jruby/issues/151 , https://github.com/sbt/sbt/issues/714
要解决此问题,只需将列数设置为 > 0,如下所示 -
stty columns 50
关于shell - 退格后 HBase shell 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49649449/