Sarang Sarang - 1 year ago 141
Bash Question

unable to launch HBase shell

I am able to get localhost:16010 running. But, somehow the Hbase shell is not launching when I use :

01HW993798:bin tcssig$ cd /Users/tcssig/Downloads/hbase-1.0.3/bin
01HW993798:bin tcssig$ hbase shell

-bash: hbase: command not found

When I directly launch Hbase Unix executable, it generates the below error log.

Error: JAVA_HOME is not set

Although I have set it. After this only, the localhost:16010 is running.

NOTE : I know there is one similar question, but no relevant answers are present there.

Using this I am able to invoke the command, but now it gives the error :

./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

Although I have java file there.

Answer Source

Your hbase invocation should be like this:

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

When you just type hbase shell linux searches for hbase executable in all directories included in PATH environment variable. Since above bin directory is not included it errors out.

Alternatively you can also update your path variable, based on linux distribution, the command to do that may vary. It should be something like:

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

Put this command in your .bashrc or .bash_profile and then source this file. That way the bin directory is now included in PATH and hbase command is available.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download