01 하이브 CentOS7 설치

하이브 MapReduce의 데이터웨어 하우스 수많은 일반 작업자의 공정을 간략화 할 수있다. 세 가지 방법으로 설치 및 배포의 하이브 : 기본적으로 [데비 자신의 데이터베이스를 사용, 지역의 [사용 MySQL 데이터베이스] 및 원격 [메타 스토어와 MySQL하지 동일한 시스템에서]. 이 문서에 CentOS7에 기본적으로 설치 하이브를 설명합니다.

1 개 시스템, 소프트웨어 및 전제 제약

  • CentOS는 7 장비의 IP 64 워크 스테이션 192.168.100.200, 호스트 이름 danji되면, 독자는 실제 상황에 따라 설정된다
  • CentOS7에서 하둡 설치 및 시작되었습니다
    https://www.jianshu.com/p/b7ae3b51e559
  • 하이브-0.14.0-아파치
    하이브 다운로드 링크 : https://pan.baidu.com/s/1c_skDYabCRSkS5hRUB6lFQ
    추출 코드 : A00t
    은 / 루트에 업로드 아파치 하이브-0.14.0-bin.tar.gz의 192.168.100.200 디렉토리
  • xshell
  • 작업의 효과를 제거 할 수있는 권한, 모든 작업은 루트하기 위해 수행

이 동작을

  • 루트에 192.168.100.200 xshell에 로그인
  • 2. 추출 구성 환경 변수
tar -xvf apache-hive-0.14.0-bin.tar.gz
# 配置环境变量,修改~/.bashrc,在其中加入以下内容【请读者根据实际情况修改路径】
export JAVA_HOME=/root/jdk1.8.0_152
export HIVE_HOME=/root/apache-hive-0.14.0-bin
export PATH=$HIVE_HOME/bin:$HIVE_HOME/conf:$JAVA_HOME/bin:$PATH
# 保存退出,使生效
source ~/.bashrc
  • 3. 하이브-site.xml 파일을 수정
# 进入hive配置目录
cd /root/apache-hive-0.14.0-bin/conf
# 由模板拷贝一份hive-site.xml
cp hive-default.xml.template hive-site.xml  
# 修改hive-site.xml,加入以下内容,保存退出
<property>
   <name>system:java.io.tmpdir</name>
     <value>/root/apache-hive-0.14.0-bin/tmpdir</value>
     </property>
<property>
     <name>system:user.name</name>
     <value>hive</value>
   </property>
  • 4. HDFS에 두 개의 폴더를 생성 및 권한 부여
    hive.metastore.warehouse.dir :이 매개 변수는 하이브 데이터 저장 디렉토리를 지정
    hive.exec.scratchdir :이 매개 변수는 하이브 데이터를 임시 파일 디렉토리를 지정합니다
# 进入hadoop的bin目录
cd /root/hadoop-2.5.2/bin
# 创建/user/hive/warehouse
./hdfs dfs -mkdir -p /user/hive/warehouse  
# 赋予/user/hive/warehouse权限
./hdfs dfs -chmod 777 /user/hive/warehouse  
# 创建/tmp/hive 
./hdfs dfs -mkdir -p /tmp/hive 
# 赋予/tmp/hive 权限
./hdfs dfs -chmod 777 /tmp/hive 
  • 복사 및 hive-env.sh 수정
# 进入hive的conf目录
cd /root/apache-hive-0.14.0-bin/conf   
# 拷贝hive-env.sh
cp hive-env.sh.template hive-env.sh
# 修改以下键值对
# Set HADOOP_HOME to point to a specific hadoop install directory
HADOOP_HOME=/root/hadoop-2.5.2

# Hive Configuration Directory can be controlled by:
export HIVE_CONF_DIR=/root/apache-hive-0.14.0-bin/conf

# Folder containing extra ibraries required for hive compilation/execution can be controlled by:
export HIVE_AUX_JARS_PATH=/root/apache-hive-0.14.0-bin/lib

3 테스트

# 进入hive的bin目录
cd /root/apache-hive-0.14.0-bin/bin
# 启动hive
./hive
# 出现以下内容,则启动成功,具体内容有些许差别,但大体一致
[root@localhost bin]# ./hive
Logging initialized using configuration in jar:file:/root/apache-hive-0.14.0-bin/lib/hive-common-0.14.0.jar!/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/root/hadoop-2.5.2/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/root/apache-hive-0.14.0-bin/lib/hive-jdbc-0.14.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
hive> 

위는 CentOS7에서 하이브 기본 설치 과정입니다.

HTTPS : //www.jianshu.com/p/755944f01fab 재현

추천

출처blog.csdn.net/weixin_34281537/article/details/91051970