hive与hbase安装

单独安装hive
使用Derby数据库的安装方式
什么是Derby安装方式
•Apache Derby是一个完全用java编写的数据库,所以可以跨平台,但需要在JVM中运行
•Derby是一个Open source的产品,基于Apache License 2.0分发
•即将元数据存储在Derby数据库中,也是Hive默认的安装方式
 安装Hive
•解压Hive
[java]  view plain copy 在CODE上查看代码片 派生到我的代码片
 
  1. tar zxvf  hive-0.8.1.tar  /home/test/Desktop  
•建立软连接
[java]  view plain copy 在CODE上查看代码片 派生到我的代码片
 
  1. ln –s hive-0.8.1 hive  
•添加环境变量
[java]  view plain copy 在CODE上查看代码片 派生到我的代码片
 
  1. •export HIVE_HOME=/home/test/Desktop/hive  
  2. •export PATH=….HIVE_HOME/bin:$PATH:.  
配置Hive
•进入hive/conf目录
•依据hive-env.sh.template,创建hive-env.sh文件
[java]  view plain copy 在CODE上查看代码片 派生到我的代码片
 
  1. cp  hive-env.sh.template hive-env.sh  
•修改hive-env.sh
•指定hive配置文件的路径
[java]  view plain copy 在CODE上查看代码片 派生到我的代码片
 
  1. export HIVE_CONF_DIR=/home/test/Desktop/hive/conf  
•指定Hadoop路径
[java]  view plain copy 在CODE上查看代码片 派生到我的代码片
 
  1. HADOOP_HOME=/home/test/Desktop/hadoop    
hive-site.xml
[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
 
  1. <property>  
  2.   <name>javax.jdo.option.ConnectionURL</name>  
  3. <value>jdbc:derby:;databaseName=metastore_db;create=true</value>  
  4.   <description>JDBC connect string for a JDBC metastore</description>  
  5. </property>  
  6.    
  7. <property>  
  8.   <name>javax.jdo.option.ConnectionDriverName</name>  
  9.   <value>org.apache.derby.jdbc.EmbeddedDriver</value>  
  10.   <description>Driver class name for a JDBC metastore</description>  
  11. </property>  
  12. <property>  
  13.   <name>javax.jdo.option.ConnectionUserName</name>  
  14.   <value>APP</value>  
  15.   <description>username to use against metastore database</description>  
  16. </property>  
  17.    
  18. <property>  
  19.   <name>javax.jdo.option.ConnectionPassword</name>  
  20.   <value>mine</value>  
  21.   <description>password to use against metastore database</description>  
  22. </property>  

启动Hive
•命令行键入
•Hive
•显示
WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
Logging initialized using configuration in jar:file:/home/test/Desktop/hive-0.8.1/lib/hive-common-0.8.1.jar!/hive-log4j.properties
Hive history file=/tmp/test/hive_job_log_test_201208260529_167273830.txt
hive>
测试语句
•建立测试表test
•create table test  (key string);
•show tables;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值