Hive 2.1.1 설치 설명서

3825 단어
한 환경
OS:ubuntu 16.04.3 LTS
Hadoop:2.6.5
java:1.8.0_151
Hive 2.1.1

Hadoop 클러스터 환경
10.190.3.10     master
10.190.3.6      slave

설치
2.1 구성 환경 변수
HIVE_HOME=/home/hadoop/apache-hive-2.1.1-bin
PATH=$PATH:$HIVE_HOME/bin
export HIVE_NAME PATH

2.2 Metastore
metastore는 Hive 메타데이터의 중앙 집중식 저장소입니다.그것은 서비스와 백엔드 데이터 저장소 두 부분을 포함한다.메타스토어를 구성하는 방법은 세 가지가 있는데 그것이 바로 메타스토어, 로컬 메타스토어, 원격 메타스토어입니다.이번 구축에서 MySQL을 원격 창고로 사용하고 마스터 노드에 배치하며 Hive 서버도 마스터에 설치하고 Hive 클라이언트는 slave가 Hive 서버에 접근한다.
2.3 Mysql 설치
sudo apt install mysql-server

2.3.1 편집/etc/mysql/mysqld.conf.d/mysqld.cnf
bind-address            = 10.190.3.10

완료 후 mysql 다시 시작
sudo service mysql restart

2.3.2 Hive 사용자를 만들고 Hive 원격 로그인 권한을 부여할 수 있음
mysql -u root -p
CREATE USER 'hive' IDENTIFIED BY 'hive';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%' WITH GRANT OPTION;
flush privileges;

2.3.3 Hive 데이터베이스 만들기
mysql -uroot -p
create database hive

2.4 구성 Hive
Hive 프로필 디렉터리에 들어가서 Hive-default를 찾으십시오.xml.template,cp분은hive-default입니다.xml에서 다른 Hive-site를 만듭니다.xml 및 매개 변수 추가

 
 

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


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

     
         javax.jdo.option.ConnectionUserName
         hive
     

     
         javax.jdo.option.ConnectionPassword
         hive
     


   hive.metastore.schema.verification
   false
    
    Enforce metastore schema version consistency.
    True: Verify that version information stored in metastore matches with one from Hive jars.  Also disable automatic
          schema migration attempt. Users are required to manully migrate schema after Hive upgrade which ensures
          proper metastore schema migration. (Default)
    False: Warn if the version information stored in metastore doesn't match with one from in Hive jars.
    
 
 


2.5 JDBC 다운로드
cp mysql-connector-java-5.1.45-bin.jar apache-hive-2.1.1-bin/lib/

2.6 Hive 클라이언트 구성
 scp -r apache-hive-1.2.1-bin/ hadoop@slave:/home/hadoop
 #  slave  
 vi hive-site.xml
 
 
 
 

  hive.metastore.uris
  thrift://10.190.3.10:9083
  Thrift uri for the remote metastore. Used by metastore client to connect to remote metastore.

              

2.7 Hive 시작
schematool -dbType mysql -initSchema --verbose      #mysql       
hive --service metastore &
jps
10288 RunJar  #      
9365 NameNode
9670 SecondaryNameNode
11096 Jps
9944 NodeManager
9838 ResourceManager
9471 DataNode

Hive 서버측 마스터 액세스
hive

Slave 액세스를 위한 Hive 클라이언트
hive

참조:
1: https://cwiki.apache.org/confluence/display/Hive/AdminManual+Installation
2: https://cwiki.apache.org/confluence/display/Hive/AdminManual+Installation

좋은 웹페이지 즐겨찾기