发布时间: 2018-01-29 00:30:13
HIVE的安装部署
1.1:下载Hive安装包
http://hive.apache.org/downloads.html
1.2:将hive文件上传到HADOOP集群,并解压
将文件上传到:/home/hadoop
[hadoop@hdp08 ~]$ tar zxvf apache-hive-2.2.0-bin.tar.gz -C apps
[hadoop@hdp08 ~]$ cd apps
[hadoop@hdp08 ~]$ mv apache-hive-2.2.0-bin hive
1.3. 配置环境变量编程 /etc/profile
[root@hdp08 ~]# vi /etc/profile
HIVE_HOME=/home/hadoop/apps/hive
HBASE_HOME=/home/hadoop/apps/hbase
ZOOKEEPER_HOME=/home/hadoop/apps/zookeeper
HADOOP_HOME=/home/hadoop/apps/hadoop-2.8.1
JAVA_HOME=/opt/jdk1.8.0_121
PATH=$HIVE_HOME/bin:$HBASE_HOME/bin:$ZOOKEEPER_HOME/bin:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH
export HIVE_HOME HBASE_HOME ZOOKEEPER_HOME HADOOP_HOME JAVA_HOME PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
#让环境变量生效
[root@hdp08 ~]# source /etc/profile
1.4 修改hive配置文件进入配置文件的目录
[hadoop@hdp08 ~]$ cd apps/hive/conf/
[hadoop@hdp08 conf]$cp hive-default.xml.template hive-site.xml
[hadoop@hdp08 conf]vi hive-site.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://hdp08:3306/hive?createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
<description>username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
<description>password to use against metastore database</description>
</property>
</configuration>
1.5. 安装mysql并配置hive数据库及权限
安装mysql数据库及客户端详细见mysql安装文档配置hive元数据库
A. 创建hive数据库
mysql>create database hive;
B. 对hive元数据库进行赋权,开放远程连接,开放localhost连接
mysql>grant all privileges on *.* to root@"%" identified by "root" with grant option;
mysql>grant all privileges on *.* to root@"localhost" identified by "root" with grant option;
C. 将mysql驱动程序拷贝到$HIVE_HOME/lib目录下
hive元数据库初始化[hadoop@hdp08 ~]schematool -dbType mysql -initSchema启动hive[hadoop@hdp08 conf]hive
上一篇: {大数据}HIVE基本操作
下一篇: {大数据}Hive