Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when starting hbase: JAVA_HOME not set #75

Open
JB-data opened this issue Aug 7, 2020 · 1 comment
Open

Issue when starting hbase: JAVA_HOME not set #75

JB-data opened this issue Aug 7, 2020 · 1 comment

Comments

@JB-data
Copy link

JB-data commented Aug 7, 2020

When I run the bin/cloud-local.sh init script , I am asked to login to my own machine (which serves as the hbase master) and provide the password when he complains about JAVA_HOME not set:

Starting hbase...
starting master, logging to /home/user/Documents/cloud-local/hbase-1.3.1/logs/hbase-user-master-ds-gpu11.out
OpenJDK 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
jb@ds-gpu11's password: 
ds-gpu11: +======================================================================+
ds-gpu11: |                    Error: JAVA_HOME is not set                       |
ds-gpu11: +----------------------------------------------------------------------+
ds-gpu11: | Please download the latest Sun JDK from the Sun Java web site        |
ds-gpu11: |     > http://www.oracle.com/technetwork/java/javase/downloads        |
ds-gpu11: |                                                                      |
ds-gpu11: | HBase requires Java 1.7 or later.                                    |
ds-gpu11: +======================================================================+

On my machine(the one used as hbase master), a proper version of java is installed and JAVA_HOME is not empty:

(base) jb@ds-gpu11:~/Documents/cloud-local$ java --version
openjdk 11.0.8 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1, mixed mode, sharing)
(base) jb@ds-gpu11:~/Documents/cloud-local$ echo $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64

so it is not clear to me why I get this error.

The error comes from /cloud-local/hbase-1.3.1/bin/hbase-config.sh where there is a check if JAVA_HOME is defined.
I believe that in cloud-local/hbase-1.3.1/conf/hbase-env.sh folder JAVA_HOME can be set (like described here: https://hbase.apache.org/book.html#quickstart in 2.2.3), but this file is overwritten every time you run the cloud-local.sh init command, so I dont see how I can specify this.
If I copy the exact same part of the script where it fails, and run it directly on my machine, it does not fail as JAVA_HOME is indeed recognized.

Any clue how I can specify JAVA_HOME variable correctly?
Thanks!!

Extra info: I believe these are all the scripts that call each other:
1)script to initiate the cloud environment on local node
/cloud-local/bincloud-local.sh init -->
2)calls script to start hbase
/cloud-local/hbase-1.3.1/bin/start-hbase.sh -->
3)calls script to start daemon:
"$bin"/hbase-daemon.sh --config "${HBASE_CONF_DIR}" start master $@
4)daemon is started:
~/Documents/cloud-local/hbase-1.3.1/bin/hbase-daemon.sh
5)From /cloud-local/hbase-1.3.1/bin/hbase-config.sh there is a check if JAVA_HOME is defined that fails .

@JB-data
Copy link
Author

JB-data commented Aug 19, 2020

I just found how to fix this:
in /cloud-local/hbase-1.3.1/conf/hbase-env.sh
add the path to JAVA_HOME for java 8:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
then run
bin/cloud-local init again and if passed the check for JAVA_HOME .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant