无法启动 HBase shell

unable to launch HBase shell

我可以得到 localhost:16010 运行。但是,当我使用 :

时,不知何故 Hbase shell 没有启动
01HW993798:bin tcssig$ cd /Users/tcssig/Downloads/hbase-1.0.3/bin
01HW993798:bin tcssig$ hbase shell

-bash: hbase: command not found

当我直接启动 Hbase Unix 可执行文件时,它会生成以下错误日志。

 Error: JAVA_HOME is not set 

虽然我设置了。仅此之后,localhost:16010 为 运行。

注意:我知道有一个类似的问题,但那里没有相关答案。

使用这个我可以调用命令,但现在它给出了错误:

./hbase: line 403: /Users/tcssig/Downloads/hbase-

1.0.3/bin/JAVA_HOME:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Cont``ents/Home/bin/java: No such file or directory

虽然我在那里有 java 文件。

你的 hbase 调用应该是这样的:

cd /Users/tcssig/Downloads/hbase-1.0.3/bin
./hbase shell  [Note the ./]

当您键入 hbase shell 时 linux 在 PATH 环境变量中包含的所有目录中搜索 hbase 可执行文件。由于不包含上述 bin 目录,因此会出错。

或者,您也可以根据 linux 分布更新您的路径变量,执行此操作的命令可能会有所不同。它应该是这样的:

export PATH=/Users/tcssig/Downloads/hbase-1.0.3/bin:$PATH

将此命令放入您的 .bashrc.bash_profile,然后获取此文件。这样 bin 目录现在包含在 PATH 中并且 hbase 命令可用。

进入$HBASE_HOME/bin路径,尝试:

./hbase shell