Monday, November 19, 2012

Configure MySQL as a MetaStore For Hive. MySQL as Hive





1. first your mysql should be installed and running.

I will show you how to configure mysql as a meta store for hive

lets start --->  



2. download mysql jdbc connectory and put it into hive directory (http://dev.mysql.com/downloads/connector/j/)

3. then open hive-site.xml file from hive/conf directory.

4. if you dont have hive-site.xml and if you have hive-default.xml then open it and edit it.... but before editing this file please do make a backupe of that.

5. search for "hive.metastore.local" tag and make its value as "true"

6. then search "javax.jdo.option.ConnectionURL" and give its value as "jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true"

7. then search for "javax.jdo.option.ConnectionDriverName" and make its value as "com.mysql.jdbc.Driver"

8. then search "javax.jdo.option.ConnectionUserName" and make its value as "<give your username of mysql>"

9. then search "javax.jdo.option.ConnectionPassword" and make its value as "<give your mysql password using which you are able to connect>"

10. so your settings has been done.

11. now go to terminal and type bin/hive

12. and type create table andytablename(info INT);

13.  if everything is configured fine then it will give you something like "Time taken: 18.854 seconds"

15. then go to mysql and type "show databases"

+--------------------+
| Database           |
+--------------------+
| information_schema |
| hive               |
| mysql              |
| performance_schema |
| test               |
+--------------------+

16. use hive;

15. type "show tables"

+-----------------+
| Tables_in_hive  |
+-----------------+
| BUCKETING_COLS  |
| CDS             |
| COLUMNS_V2      |
| DATABASE_PARAMS |
| DBS             |
| PARTITION_KEYS  |
| SDS             |
| SD_PARAMS       |
| SEQUENCE_TABLE  |
| SERDES          |
| SERDE_PARAMS    |
| SORT_COLS       |
| TABLE_PARAMS    |
| TBLS            |
+-----------------+


Thats finishes the hive metastore configuration with mysql ...............

if you find any problem in configuring it please drop me a mail at dwivedishashwat@gmail.com


i will attachi the test of this file with video for your help

thanks cheer :)







No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

#Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc

 #Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc Linux is an open-source operating system that is loved by millio...