Showing posts with label Bigdata. Show all posts
Showing posts with label Bigdata. Show all posts

Thursday, June 22, 2017

RCA: /usr/java/jre1.8.0_112/bin/bin/java: No such file or directory

QA reported one issue observed in their environment:
Searching for java...
        1. /usr/java/jdk1.6.0_31/bin/java
        2. /usr/java/jdk1.6.0_31/jre/bin/java
        3. /usr/java/jdk1.7.0_67-cloudera/bin/java
        4. /usr/java/jdk1.7.0_67-cloudera/jre/bin/java
        5. /usr/java/jre1.8.0_112/bin/java
        6. Specify location of java to use.
Type the number for the required java from this list: [1] 5

/opt/cloudera/parcels/CDH-5.4.4-1.cdh5.4.4.p0.4/bin/../lib/hadoop/bin/hadoop: line 144: /usr/java/jre1.8.0_112/bin/bin/java: No such file or directory

/opt/cloudera/parcels/CDH-5.4.4-1.cdh5.4.4.p0.4/bin/../lib/hadoop/bin/hadoop: line 144: exec: /usr/java/jre1.8.0_112/bin/bin/java: cannot execute: No such file or directory
Note that the choice in the list is correct, but the script then invokes a “bin/bin/java” – where did it get that from?


Well, well, at the beginning I thought there was something wrong in our script using the specified Java directory(JAVA_HOME, PATH). While digging deeper, the error comes from:
-bash-3.2# /usr/bin/hadoop classpath --glob
/opt/cloudera/parcels/CDH-5.4.4-1.cdh5.4.4.p0.4/bin/../lib/hadoop/bin/hadoop: line 144: /usr/java/jre1.8.0_112/bin/bin/java: No such file or directory

/opt/cloudera/parcels/CDH-5.4.4-1.cdh5.4.4.p0.4/bin/../lib/hadoop/bin/hadoop: line 144: exec: /usr/java/jre1.8.0_112/bin/bin/java: cannot execute: No such file or directory

Check JAVA_HOME:
-bash-3.2# echo $JAVA_HOME
/usr/java/jre1.8.0_112/bin
-bash-3.2#

OMG, The above $JAVA_HOME is incorrect.

THE JAVA_HOME/JRE_HOME should be the installation directory, not the bin directory under it.

Correct it with

-bash-3.2# export JAVA_HOME=/usr/java/jre1.8.0_112

Documentation from Oracle:
https://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/


Friday, May 12, 2017

How to make an Ambari service support https only

I have already set up a new Ambari Service MyDemo which provides a quick link supporting http only. Here is the quicklink.json for it:


{
 "name": "default",
 "description": "default quick links configuration",
 "configuration": {
  "protocol": {
   "type": "http_only",
  },

  "links": [
   {
    "name": "mydemo_ui",
    "label": "MyDemo UI",
    "requires_user_name": "false",
    "component_name": "MYDEMO_SERVER",
    "url": "%@://%@:%@",
    "port":{
     "http_property": "mydemo.http.port",
     "http_default_port": "18042",
     "regex": "^(\\d+)$",
     "site":"mydemo-site"
    }
   }
  ]
 }
}

The quick link now points to http://sandbox.hortonworks.com:18042

Next, there is new request to make MyDemo support https only. I think the change should be quite straightforward - just replace all "http" in the configuration file with "https". But, a big BUT here, it does NOT work as expected. the quick link points to:
    http://sandbox.hortonworks.com
The protocol is incorrect and the port number is missing.

Based on the documentation from Ambari:
    https://cwiki.apache.org/confluence/display/AMBARI/Quick+Links
The protocol type can be "https_only" if the 'checks' are empty. But it just dose not work.

After several trials, here is the working version:


{
 "name": "default",
 "description": "default quick links configuration",
 "configuration": {
  "protocol": {
   "type": "https",
   "checks":[
    {
     "site":"mydemo-site"
    }
   ]
  },

  "links": [
   {
    "name": "mydemo_ui",    "label": "MYDEMO UI",
    "requires_user_name": "false",
    "component_name": "MYDEMO_SERVER",
    "url": "%@://%@:%@",
    "port":{
     "https_property": "mydemo.https.port",
     "https_default_port": "18043",
     "regex": "^(\\d+)$",
     "site":"mydemo-site"
    }
   }
  ]
 }
}

Note that the major change is to add the "checks" with only 'site' which is always true.
Now the quick link is pointing to https://sandbox.hortonworks.com:18043

No bug is NOT fixed eventually!


BTW:  Service log directory: /var/lib/ambari-agent/data

Friday, December 2, 2016

Add ports mapping to the HDP 2.5 VMware Sandbox

HDP 2.5 Sandbox VM:
    ssh root@IP -p 22

HDP 2.5 Sandbox Container
    ssh root@IP -p 2222

Note: here the IP is the public IP address for VM. It's NOT the IP for Container.

1) login to the Sandbox VM

$ ssh root@IP -p 22

2) Disable sandbox.service

$ systemctl disable sandbox.service

3) Reboot the VM

$ init 6

4) Modify sandbox start script

$ vi /root/start_scripts/start_sandbox.sh

Go search "-p 2222:22 \"
Add a new line after that, like:
    -p 1234:1234 \
save and exit.

5) Delete existing sandbox container

$ docker rm sandbox

6) Enable sandbox.service

systemctl enable sandbox.service

7) Reboot the VM

$ init 6

8) Verify new ports

$ docker ps |grep 1234

You should see that 1234 is now in the list.

9) Bring up webapp listening at port 1234


10) Verify that you can access IP:1234 via browser from a 3rd machine.