欢迎投稿

今日深度:

hive 安装,

hive 安装,


 

安装hive比较简单,首先需要确保安装了mysql

 

准备:平台:Ubuntu 14   jdk版本:jdk1.7.41 mysql:1.5

 

1、首先需要下载hive 可以到官网去下载,我们下载到/usr/local目录下  wget http://mirrors.cnnic.cn/apache/hive/hive-1.2.1/apache-hive-1.2.1-bin.tar.gz

1.1  下载完之后解压  tar -zxf apache-hive-1.2.1-bin.tar.gz

1.2 配置环境 vi /etc/profile

HIVE_HOME=/home/hadoop/apache-hive-1.2.1-bin

PATH=$PATH:$HIVE_HOME/bin

exportHIVE_NAME PATH

1.3 配置mysql

1.3.1  使用root登陆mysql   mysql -uroot -p

创建hive用户 create user 'hive' identified by 'hive';

赋予权限 grant all privileges on *.* to 'hive'@'localhost' with grant option;

刷新  flush privileges;

1.3.2 使用hive用户登陆

登陆 mysql -u hive -p;

创建hive数据库 create database hive;

1.4 配置hive

1.4.1 配置hive文件,进入到hive的conf目录下 cd /usr/local/hive/conf 找到hive-default-template.xml 复制一份  cp hive-default-template.xml hive-default.xml

在创建一个hive-site.xml文件,并编辑

<configuration>

<property>

<name>javax.jdo.option.ConnectionURL</name>

<value>jdbc:mysql://hadoop-master:3306/hive?createDatabaseIfNotExist=true</value>

<description>JDBCconnect string for a JDBC metastore</description>   

</property>  

<property>

<name>javax.jdo.option.ConnectionDriverName</name>

<value>com.mysql.jdbc.Driver</value>

<description>Driverclass name for a JDBC metastore</description>    

</property>              

 

<property>

<name>javax.jdo.option.ConnectionUserName</name>

<value>hive<value>

<description>usernameto use against metastore database</description>

</property>

<property> 

<name>javax.jdo.option.ConnectionPassword</name>

<value>hive</value>

<description>passwordto use against metastore database</description> 

</property>         

</configuration>

1.4.2 从网上下载mysql的jar包,也可以从本地上传。下载之后剪切到/usr/local/hive/lib目录下

1.5 启动

1.5.1 启动metastore服务

进入hive目录 bin/hive --service metastore &

1.5.2 启动hiveservice服务

进入hive目录 bin/hive --service hiveservice2 &

1.5.3 启动hive客服的

输入hive即可进入

www.htsjk.Com true http://www.htsjk.com/hive/37411.html NewsArticle hive 安装,   安装hive比较简单,首先需要确保安装了mysql   准备:平台:Ubuntu 14   jdk版本:jdk1.7.41 mysql:1.5   1、 首先需要下载hive 可以到官网去下载,我们下载到/usr/local目录下 ...
相关文章
    暂无相关文章
评论暂时关闭