Friday, September 11, 2015

Apache Spark installation on Ubuntu 14.04

1. Download and install JAVA
   JDK (jdk-7u75-linux-x64.tar.gz)

2. Install Git
   $ sudo apt-get install git

2. Download and install Scala:
   $ sudo mkdir /usr/local/scala
   $ wget http://www.scala-lang.org/files/archive/scala-2.11.7.deb
   $ sudo dpkg -i scala-2.11.7.deb
   $ sudo apt-get update
   $ sudo apt-get install scala

3. Download and install pre-built Spark:
   $ wget http://d3kbcqa49mib13.cloudfront.net/spark-1.2.0-bin-hadoop2.4.tgz
   $ tar -xzvf spark-1.2.0-bin-hadoop2.4.tgz
   $ sudo mv spark-1.2.0-bin-hadoop2.4 /usr/local/spark

4. Set Environment variables:
   export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
   export PATH=$PATH:$JAVA_HOME/bin
   
   #export SCALA_HOME=/usr/local/scala -> Do not set path for Scala
   #export PATH=$PATH:$SCALA_HOME/bin -> Do not set path for Scala
   
   export SPARK_HOME=/usr/local/spark
   export PATH=$PATH:$SPARK_HOME/bin

5. Launch Spark shell with a Scala interpreter:
   $ spark-shell

6. Run Spark to use the Python interpreter:
   $ pyspark

7. Download IDE:
   IntelliJ IDEA  14.1.1



References:
  https://youtu.be/L5QWO8QBG5c
  http://blog.prabeeshk.com/blog/2014/10/31/install-apache-spark-on-ubuntu-14-dot-04/
  http://stackoverflow.com/questions/31594937/error-invalid-or-corrupt-jarfile-sbt-sbt-launch-0-13-5-jar/31848979#31848979

 

Tutorials:
  https://www.mapr.com/ebooks/spark/chapter01-introduction.html
  https://www.princeton.edu/researchcomputing/computational-hardware/hadoop/spark-tut/
  http://blog.knoldus.com/2014/06/04/a-simple-application-in-spark-and-scala/
  http://blog.cloudera.com/blog/2014/04/how-to-run-a-simple-apache-spark-app-in-cdh-5/


Interview - Questions and Answers:
  http://www.bigdataanalyst.in/category/spark/
 

Cisco (Internal):
  http://iwe.cisco.com/web/naiq-it-infrastrucure/spark
  http://iwe.cisco.com/web/bigdata-service/platform


--- *** ---

Thursday, June 4, 2015

Apache HBase 2.0 API - Sample Java Program

The below Java program uses the HBase 2.0 API and performs the following:


  1. Create Table
  2. Put Row
  3. Get Row
  4. Scan Rows
  5. Delete Column
  6. Disable Table
  7. Delete Table



package nag.arvind.gudiseva;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.*;
import org.apache.hadoop.hbase.util.Bytes;

import java.io.IOException;

/** * Created by Nag Arvind Gudiseva on 6/4/2015. */public class EmployeeHBase {

    Connection connection;

    public EmployeeHBase(Connection connection) {
        this.connection = connection;
    }

    void createTable (String tableStr, String colStr1, String colStr2) throws IOException {

        HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(tableStr));

        HColumnDescriptor columnFamily1 = new HColumnDescriptor(colStr1);
        tableDescriptor.addFamily(columnFamily1);

        HColumnDescriptor columnFamily2 = new HColumnDescriptor(colStr2);
        tableDescriptor.addFamily(columnFamily2);

        HBaseAdmin admin = (HBaseAdmin) connection.getAdmin();

        System.out.println("Creating table ...");
        admin.createTable(tableDescriptor);
        System.out.println(tableDescriptor.toString());
        System.out.println("... table created!");

        admin.close();

    }

    void putRow(String tableStr, String rowStr, String colStr, String qlfrStr, String valueStr) throws IOException {

        Table table = connection.getTable(TableName.valueOf(tableStr));
        System.out.println("Connecting to table ...");
        Put p = new Put(Bytes.toBytes(rowStr));
        p.addColumn(Bytes.toBytes(colStr), Bytes.toBytes(qlfrStr), Bytes.toBytes(valueStr));
        table.put(p);
        System.out.println("... Added records to table!");

        table.close();

    }

    void getRow(String tableStr, String rowStr, String colStr, String qlfrStr) throws IOException {

        Table table = connection.getTable(TableName.valueOf(tableStr));
        System.out.println("Connecting to table ...");
        Get g = new Get(Bytes.toBytes(rowStr));
        Result r = table.get(g);
        byte [] value = r.getValue(Bytes.toBytes(colStr), Bytes.toBytes(qlfrStr));
        String valueStr = Bytes.toString(value);
        System.out.println("... GET: " + valueStr);

        table.close();

    }

    void scanRows(String tableStr, String colStr, String qlfrStr) throws IOException {

        Table table = connection.getTable(TableName.valueOf(tableStr));
        System.out.println("Connecting to table ...");
        Scan s = new Scan();
        s.addColumn(Bytes.toBytes(colStr), Bytes.toBytes(qlfrStr));
        ResultScanner scanner = table.getScanner(s);

        try {
            for (Result row : scanner) {
                System.out.println("... Found row: " + row);
            }
        }
        finally {
            scanner.close();
        }

        table.close();

    }

    void deleteColumn (String tableStr, String colStr) throws IOException {

        HBaseAdmin admin = (HBaseAdmin) connection.getAdmin();

        System.out.println("Deleting Column ...");
        admin.deleteColumn(tableStr, colStr);
        System.out.println("... Column " + colStr + " from table " + tableStr + " deleted!");

        admin.close();

    }

    void disableTable (String tableStr) throws IOException {

        HBaseAdmin admin = (HBaseAdmin) connection.getAdmin();

        System.out.println("Disabling table ...");
        admin.disableTable(tableStr);
        System.out.println("... " + tableStr + " table disabled!");

        admin.close();

    }

    void deleteTable (String tableStr) throws IOException {

        HBaseAdmin admin = (HBaseAdmin) connection.getAdmin();

        System.out.println("Deleting table ...");
        admin.deleteTable(tableStr);
        System.out.println("... " + tableStr + " table deleted!");

        admin.close();

    }

    public static void main(String[] args) throws IOException {

        Configuration config = HBaseConfiguration.create();
        Connection conn = ConnectionFactory.createConnection(config);
        RegionLocator regionLocator = conn.getRegionLocator(TableName.valueOf("Employee"));  // For future implementation
        EmployeeHBase employeeHBase = new EmployeeHBase(conn);

        employeeHBase.createTable("Employee", "personal", "official");

        employeeHBase.putRow("Employee", "emp102", "official", "name", "Arvind");

        employeeHBase.getRow("Employee", "emp102", "official", "name");

        employeeHBase.scanRows("Employee", "official", "name");

        employeeHBase.deleteColumn("Employee", "official");

        employeeHBase.disableTable("Employee");

        employeeHBase.deleteTable("Employee");

        regionLocator.close();
        conn.close();
    }
}

Reference: 
https://hbase.apache.org/apidocs/

Tuesday, June 2, 2015

Apache HBase Lab Practice on Windows 8 using Cygwin64

# Introduction:

FileStream
|
  DBMS
|
 RDBMS
|
NoSQL (HBase) -> Part of Hadoop Ecosystem


Tape:
- Sequence Access
_______________
| | | |
_______________

Disk
- Sequence and Random O[n] -> Order of Nth Processing
- Transformation
- Seeking / Seek time
. - Sequence Acess
. ----. - Random Access
.

O[n] Databases -> Casandra, MongoDB, couchDB, Impala, HBase, Dynama -> NoSQL


# Features:

- No concept of multiple tables
- Same as Google's Big Table
- Data operations using Get, Put, Scan, Delete.
- DDL - Create, Alter, Enable/Disable
- There is no update.  Update the same exact row with a different value by overwriting, e.g. put
- Enable / Disable -> Delete the data
- Supports both OLAP and OLTP (Inserts and Updates)
- Horizontally Scalable
- Random Access
- Low latency
- Sorted HashMap -> Keys and Values (Key Value store) -> No Indexes 
- Both Key and Value are byte array format -> combination of integer and string values
- Values are stored in key-order
- No schema for table, only Column families
- Rows are stored in a Sorted Order
- Each row has a row key
- Rows are strongly consistent
- RowId / RowKey is auto generated.  While inserting data, user should insert into RowId field.
- No Search (e.g. LIKE), No Joins, No Foreign Key
- Table scan is fast
- No data types (int, string, etc)
- Executes MR and fetches the records.
- E.g. Adhaar is implemented in HBase
- Access HBase data via an API


# Architecture:

- Works on top of Hadoop
- Port Nos
 HDFS: 50070
 MapReduce: 50060
 Master Server (60010) -> localhost:60010
 Region Servers (60030) -> localhost:60030

+ HBase Master Server (aka Name Node)
- Cluster Management, Monitoring, Load Balancing

+ HBase StandBy Master
-

+ ZooKeeper
- Corordination server to communicate and run the HBase Server
- Coordinates HMaster transitions
- Highly available system for coordination
- Only information, no processing
- It is part of HBase.  No need to set path in .bashrc file
- Quorum Peer is the daemon of ZooKeeper
- Stack - FIFO
- Required for HBase Developer

+ HBase Region Server(s) (aka Data Node(s))
(1) HFile - Data Storage Location
(2) Memstore - Schema information of the Column Families
(3) Write-Ahead Log / HLog -> Current running transactions Log


# Diagram:

  
HBase Master
|
ZooKeeper
|
-------------------------------------------------------------------------------------------------------------
| | | |
HBase Region Server HBase Region Server                   HBase Region Server HBase Region Server
| | | |
-------------------------------------------------------------------------------------------------------------
|
  HDFS


# Configuration:

1. .bashrc
Set path for HBase in .bashrc file
export HBASE_HOME=/home/kosmik/work/hbase-0.94.12
export PATH=$HBASE_HOME/bin:$PATH

2. regionservers
In Hbase conf, create a file with "regionservers".  Inside type localhost.

3. hbase-env.sh

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
export HBASE_REGIONSERVER=/home/kosmik/work/hbase-0.94.12/conf/regionservers
export HBASE_MANAGES_ZK=true

4. hbase-site.xml



 hbase.root.dir
 hdfs://localhost:9000/hbase

 hbase.cluster.distributed
 true


 hbase.zookeeper.property.dataDir
 /home/kosmik/work/zookeeper




# Daemons:

  On starting HBase (start-hbase.sh), 8 processes should run:
1. HBase Master
2. HBase Region
3. Job Tracker
4. Task Tracker
5. Name Node
6. Secondary Name Node
7. Data Node
8. Quorum Peer


# HBase vs Hive:

HBase Hive
-------------------------------------------------------    -------------------------------------
RowId CF:Identifier TimeStamp Value Id Name Sal
-------------------------------------------------------    --------------------------------------
101 CF:Name 10:05:11 Kiran 101 Kiran 10000
-------------------------------------------------------    --------------------------------------
101 CF:Sal 10:05:12 10000
-------------------------------------------------------    --------------------------------------
...
-------------------------------------------------------    ---------------------------------------
...
-------------------------------------------------------    ---------------------------------------
...
-------------------------------------------------------    ---------------------------------------

Rowkey info:height info:state roles:hadoop roles:

1234 info {'lastname': 'Smith', 'firstName': 'John'}
pwd {'Password': 'HelloWorld'}


# Interview Questions:

Q. Difference between HBase and RDBMS?
A. - Search queries
- Foreign Keys
- There are no joins
- All parts of table in single query

Q. Diff between Truncate and Delete
A. Truncate (Shit + Delete)

Q. Bulk Uploads with MapReduce
A.

Q. What is Distributed Caching?
A. In Memory processing

Q. Difference between HDFS Block and Input Splits?

Q. How we can improve the performance of Hive?
A. ORC format, Vectorized format, Tez -> Refer Qubole


# To view HBase files in HDFS:

sudo -u hdfs hadoop fs -mkdir /hbase
sudo -u hdfs hadoop fs -chown hbase /hbase

hdfs> hadoop fs -mkdir /hbase
hdfs> hadoop fs -chown hbase /hbase


# References:

Big Data University -> Videos


# Lab Practice:


+ Cygwin64 Terminal Commands

$> net start sshd

$> ssh cyg_server@localhost

$> /usr/local/hbase-1.0.1.1//bin/start-hbase.sh

$> /usr/local/hbase-1.0.1.1//bin/hbase shell

$> /usr/local/hbase-1.0.1.1//bin/stop-hbase.sh

$> logout

$> net stop sshd

+ Ubuntu Terminal Commands

$> start-all.sh
$> start-hbase.sh // Starts HBase Server

$> hbase shell // Opens HBase Shell

  hbase> status 'detailed'
...
  hbase> quit

$> hbase-daemon.sh stop regionserver // Stops an individual RegionServer
$> stop-hbase.sh
$> stop-all.sh

+ HBase Shell Commands

hbase> version
hbase> status 'detailed'
hbase> whoami
hbase> list

hbase> create 'employee', 'personal', 'official'
  --------   --------   --------
table cf1 cf1

hbase> describe 'employee'
hbase> put 'employee','emp101','official:designation','hadoop admin'
--------   ------ --------------------   ------------
table rowid cf:identifier value

hbase> put 'employee','Emp101','personal:name','Dhanu' // Case Sensitive -> New Row Key inserted 
hbase> put 'employee', 'emp01', 'personal:name', 'kosmik'
hbase> put 'employee', 'emp01', 'official:department', 'IT'
hbase> put 'employee', 'emp02', 'official:department', 'HR'
hbase> put 'employee', 'emp02', 'personal:name', 'kiran'

hbase> scan 'employee'
hbase> get 'employee', 'emp01'
hbase> get 'employee', 'emp02'
hbase> count 'employee'
hbase> delete 'employee', 'emp01', 'personal:name'
hbase> deleteall 'employee', 'emp02' // Entire row is deleted

hbase> disable 'employee'
hbase> enable 'employee'

hbase> drop 'employee'


---

Sunday, May 31, 2015

Cygwin64 Terminal #2 - HBase Shell


aravindpc@aravindpc ~
$ ssh cyg_server@localhost
  cyg_server@localhost's password:

cyg_server@aravindpc ~
$ cd /usr/local/hbase-1.0.1.1/

cyg_server@aravindpc /usr/local/hbase-1.0.1.1
$ ./bin/hbase shell
cygpath: can't convert empty path
2015-05-31 18:08:21,013 ERROR [main] util.Shell: Failed to locate the winutils binary in the hadoop binary path
java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
HBase Shell; enter 'help' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 1.0.1.1, re1dbf4df30d214fca14908df71d038081577ea46, Sun May 17 12:34:26 PDT 2015

------------- HBase Commands to try ----------------
status  // Check HBase Server Status
create 'test', 'data'
list
put 'test', 'row1', 'data:1', 'value1'
put 'test', 'row2', 'data:2', 'value2'
put 'test', 'row3', 'data:3', 'value3'
scan 'test'
disable 'test'
drop 'test'
list
exit  // Exit HBase Shell
----------------------------------------------------

cyg_server@aravindpc /usr/local/hbase-1.0.1.1
$ logout
Connection to localhost closed.

aravindpc@aravindpc ~
$ exit

Cygwin64 Terminal #1 - HBase Server [Run As Administrator]


aravindpc@aravindpc ~
$ net start sshd
The CYGWIN sshd service is starting.
The CYGWIN sshd service was started successfully.

aravindpc@aravindpc ~
$ ssh cyg_server@localhost
  cyg_server@localhost's password:

cyg_server@aravindpc ~
$ cd /usr/local/hbase-1.0.1.1/

cyg_server@aravindpc /usr/local/hbase-1.0.1.1
$ ./bin/start-hbase.sh
cygpath: can't convert empty path
cygpath: can't convert empty path
2015-05-31 18:02:06,333 ERROR [main] util.Shell: Failed to locate the winutils binary in the hadoop binary path
java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.

cyg_server@aravindpc /usr/local/hbase-1.0.1.1
$ ./bin/stop-hbase.sh
stopping hbase.................

cyg_server@aravindpc /usr/local/hbase-1.0.1.1
$ net stop sshd
The CYGWIN sshd service is stopping.
The CYGWIN sshd service was stopped successfully.

cyg_server@aravindpc /usr/local/hbase-1.0.1.1
$ logout
Connection to localhost closed.

aravindpc@aravindpc ~
$ exit

Installing Apache HBase on Windows 8 using Cygwin64 (without Hadoop)

DOWNLOADS:

1. Download Java 7 (jdk-7u1-windows-i586.exe), HBase Stable binary (hbase-1.0.1.1-bin.tar.gz) and Cygwin64 (setup-x86_64.exe)

JAVA:

2. Install Java in default location (with default options)

3. Configure Environment variables for JAVA_HOME, PATH and CLASSPATH.

CYGWIN64:

4. Create folders as below:
C:\cygwin\root // Root folder
C:\cygwin\setup // Local Package folder

5. Place Cygwin64 setup file inside Local Package folder

6. Run setup with Install from Internet options without selecting any additional packages

7. Configure Environment variables for CYGWIN_HOME (C:\cygwin\root) and PATH (%CYGWIN_HOME%\bin)

8. Re-run setup with default options and select the below packages during installation:
a. OpenSSH
b. tcp_wrappers
c. diffutils
d. zlib

HBASE:

9. Place hbase-*.tar.gz inside C:\cygwin\root\usr\local folder

10. Unpack the archive using Cygwin64 terminal
$ tar xvf hbase-1.0.1.1-bin.tar.gz

11. Create logs folder i.e. C:\cygwin\root\usr\local\hbase-1.0.1.1\logs

12. Add the following to hbase-site.xml


hbase.rootdir
file:///C:/cygwin/root/tmp/hbase/data
 
hbase.tmp.dir
C://cygwin/root/tmp/hbase/tmp
 
hbase.zookeeper.quorum
127.0.0.1



13. Add the following to hbase-env.sh

export JAVA_HOME=/usr/local/zulu/
export HBASE_CLASSPATH=/cygwin/root/usr/local/hbase-1.0.1.1/lib/
export HBASE_OPTS="-XX:+UseConcMarkSweepGC"
export HBASE_IDENT_STRING=$HOSTNAME

LINKS & FILE PERMISSIONS:

14. Create Symbolic Link for Java using Cygwin64 terminal
$ LN -s /cygdrive/c/Azul/zulu1.7.0_65-7.6.0.1-win64 /usr/local/zulu

15. Create passwd and group files inside /etc folder:
C:\cygwin\root\etc\passwd
C:\cygwin\root\etc\group

16. Set file permissions:
chmod +r /etc/passwd
chmod u+w
chmod +r /etc/group
chmod u+w /etc/group
chown :Users /var
chmod 757 /var
chmod ug-s /var
chmod +t /var

SSH CONFIGURATION:

17. Configure SSH using Cygwin64 terminal [Run As Administrator]:
A. Run the script
$ ssh-host-config
(Refer: Installing Apache HBase (TM) on Windows using Cygwin)

B. Start the SSH service
$ net start sshd

C. Harmonize Windows and Cygwin64
$ mkpasswd -cl > /etc/passwd
$ mkgroup --local > /etc/group

18. Test SSH using another Cygwin64 terminal [Local User]:

$ ssh cyg_server@localhost
cyg_server@localhost's password:

cyg_server@aravindpc ~
$ logout

TROUBLESHOOTING:

$ editrights -l -u aravindpc
$ editrights.exe -a SeAssignPrimaryTokenPrivilege -u aravindpc
$ editrights.exe -a SeCreateTokenPrivilege -u aravindpc
$ editrights.exe -a SeTcbPrivilege -u aravindpc
$ editrights.exe -a SeServiceLogonRight -u aravindpc

$ ssh-keygen -R localhost

REFERENCES:

1. http://hbase.apache.org/cygwin.html
2. https://hbase.apache.org/0.94/book.html

Tuesday, May 19, 2015

HDInsight Emulator - Configuring the Hive Metastore in Local MySQL Database Server


1. Setup and configure MySQL Community Server 5.6.24 Windows (x86, 64-bit).
   Note: Minimum Supported Version is 5.6.17
   
2. Copy MySQL Connector Java Jar to Hive Lib folder.
   Jar Filename: mysql-connector-java-5.1.6.jar
   Hive Lib Folder: C:\hdp\hive-0.13.0.2.1.3.0-1981\lib\
   
3. Start MySQL Database Server.
   
4. Connect to MySQL Command Shell.

5. Create a new Database in MySQL to store Hive Metastore.

mysql> CREATE DATABASE metastore;

6. Use this newly created Database.

mysql> USE metastore;

7. Create the Database Schema using the schema.sql file as provided in Hive
   Location of .sql file: C:/hdp/hive-0.13.0.2.1.3.0-1981/scripts/metastore/upgrade/mysql/
   Schema filename: hive-schema-0.13.0.mysql.sql
   
mysql> SOURCE C:/hdp/hive-0.13.0.2.1.3.0-1981/scripts/metastore/upgrade/mysql/hive-schema-0.13.0.mysql.sql;

8. Create a MySQL User Account for Hive to access the Metastore.

mysql> CREATE USER 'hiveuser'@'%' IDENTIFIED BY 'password';

9. Prevent the Hive user from Creating or Altering tables in the Metastore Database Schema.

mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON metastore.* TO 'hiveuser'@'%';
mysql> REVOKE ALTER,CREATE ON metastore.* FROM 'hiveuser'@'%';
mysql> FLUSH privileges;

10. Edit "hive-site.xml" located in Hive Conf folder
    Hive Conf Folder: C:\hdp\hive-0.13.0.2.1.3.0-1981\conf\
   
   



   

   


 javax.jdo.option.ConnectionURL
 jdbc:mysql://ARAVINDPC:3306/metastore?createDatabaseIfNotExist=true
 JDBC connect string for a JDBC metastore stored on MySQL



 javax.jdo.option.ConnectionDriverName
 com.mysql.jdbc.Driver
 MySQL Driver class name for a JDBC metastore



 javax.jdo.option.ConnectionUserName
 hiveuser
 Username to connect to MySQL Server



 javax.jdo.option.ConnectionPassword
 password
 Password to connect to MySQL Server



 datanucleus.autoCreateSchema
 false



 datanucleus.fixedDatastore
 true



  datanucleus.autoStartMechanism
  SchemaTable


   

11. Start Hadoop Cluster (HDFS) and get into Hive console.

The output on console will be as:
C:\hdp\hive-0.13.0.2.1.3.0-1981\bin>hive
...
hive>

12. Verify that Hive is communicating to MySQL.

The output on console will be as:
hive> show databases;
OK
...

Now, we are good to proceed further.

13. Test the Hive Metastore configuration with MySQL Server.

A. Create a table on the Hive console:
hive> create table employee(id int, name string, location string);
OK
...

B. View the Hive table on MySQL shell:
mysql> SELECT * FROM TBLS;
+-----------+-----------+-------+-----------+---------------+--------------------+----------+
| OWNER     | RETENTION | SD_ID | TBL_NAME  | TBL_TYPE      | VIEW_EXPANDED_TEXT | VIEW_OR |
+-----------+-----------+-------+-----------+---------------+--------------------+----------+
| aravindpc |         0 |     1 | employee  | MANAGED_TABLE | NULL               | NULL |
+-----------+-----------+-------+-----------+---------------+--------------------+----------+
...

In the MySQL shell, we can see the name of the above created Hive table.  Thus, we have configured the Hive Metastore to use the Local MySQL Database Server.

---

TROUBLESHOOTING: Use the following commands in sequence at Hive Bin prompt (in HDFS mode):

C:\hdp\hive-0.13.0.2.1.3.0-1981\bin> hadoop dfsadmin -safemode leave
C:\hdp\hive-0.13.0.2.1.3.0-1981\bin> stop_daemons
C:\hdp\hive-0.13.0.2.1.3.0-1981\bin> start_daemons

For SSL Error:
WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.




 
    javax.jdo.option.ConnectionURL
    jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true&useSSL=false
   
   

 


---

Ref:
http://java.dzone.com/articles/how-configure-mysql-metastore
https://cwiki.apache.org/confluence/display/Hive/AdminManual+MetastoreAdmin#AdminManualMetastoreAdmin-SupportedBackendDatabasesforMetastore
http://www.cloudera.com/content/cloudera/en/documentation/archives/cdh3/v3u6/CDH3-Installation-Guide/cdh3ig_topic_16_3.html
http://www.cloudera.com/content/cloudera/en/documentation/cdh4/v4-2-0/CDH4-Installation-Guide/cdh4ig_topic_18_4.html
https://www.edureka.co/blog/apache-hive-installation-on-ubuntu
http://stackoverflow.com/questions/1328538/how-do-i-escape-ampersands-in-xml-so-they-are-rendered-as-entities-in-html

---