發布時間: 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