ITPub博客

首页 > 大数据 > Hadoop > 配置Hive,采用mysql存储metadata

配置Hive,采用mysql存储metadata

原创 Hadoop 作者:xinlieboy 时间:2014-11-19 16:55:01 0 删除 编辑

 1.安装hadoop(1.0以上)

 2.安装hive安装(0.9.0以上版本)

 4.当然你还得安装jdk

 4. mysql,同时准备个可访问的账号,这里采用root,最好配上远程访问权限。

 修改hive下的conf文件夹中将 hive-default.xml.template 复制并改名成 hive-site.xml

这里是我的文件


           hive.metastore.local
           true



           javax.jdo.option.ConnectionURL
           
            jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true
           


           javax.jdo.option.ConnectionDriverName
           com.mysql.jdbc.Driver


           javax.jdo.option.ConnectionUserName
           Username<!-- In my case UserName is hadoop-->


           javax.jdo.option.ConnectionPassword
           UserPassword<!-- In my case password is hadoop-->

 

其中标红的都是需要修改的,并改成自己的设置,同时将mysql的jdbc驱动拷贝到hive的lib目录下,然后启动hive看到如下界面


 
  1. WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files. 
  2. Logging initialized using configuration in jar:file:/usr/local/hadoop/hive/lib/hive-common-0.9.0.jar!/hive-log4j.properties 
  3. Hive history file=/tmp/root/hive_job_log_root_201206141444_1788273672.txt 
  4. hive> 
当输入show tables;没有报错时,证明配置成功
hive> show tables;
OK
invites
Time taken: 3.688 seconds
hive>
然后大家可以登录到mysql查看是否创建了数据库hive(跟你配置的名字相同)
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| hive               |
| mysql              |
| performance_schema |
| test               |
+--------------------+
5 rows in set (0.00 sec)
这时一切搞定~~~~~~~~~~

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26495863/viewspace-1339220/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-11-22

  • 博文量
    65
  • 访问量
    316101