CentOS 에서 Hive 2.0.0 단기 모드 설치 상세 설명
1.필요 한 환경
Hive 2.0 은 다음 과 같은 실행 환경 이 필요 합 니 다.Java 1.7 이상(Java 1.8 사용 을 강력 히 권장 합 니 다)Hadoop 2.X
2.하 이브 설치 팩 다운로드,압축 풀기
Hive 홈 페이지 주소:http://hive.apache.org/ 예 를 들 면:
wget "http://mirrors.cnnic.cn/apache/hive/hive-2.0.0/apache-hive-2.0.0-bin.tar.gz"
tar -xzvf apache-hive-2.0.0-bin.tar.gz
mv apache-hive-2.0.0-bin /opt/hive-2.0.0
3.환경 변수 설정(선택 가능)
접근 하기 편리 하도록 hive-2.0.0/bin 을 path 에 추가 합 니 다.
vi /etc/profile
끝 에 추가:
HIVE_HOME=/opt/hive-2.0.0
PATH=$PATH:$HIVE_HOME/bin
4.단기 모드 시작
하 이브 는 Hadoop 과 마찬가지 로 3 가지 작 동 모드 가 있 는데 그것 이 바로 단기 모드,의사 분포 모드,분포 모드 이다.여기 서 먼저 단기 모드 의 작 동 방식 을 말씀 드 리 겠 습 니 다.클 러 스 터 모드 설치http://blog.csdn.net/lnho2015/article/details/51355511
4.1 프로필 수정
cd /opt/hive-2.0.0/conf
vi hive-site.xml // hive-default.xml.template ,
다음 내용 을 입력 하고 저장:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/opt/hive-2.0.0/warehouse</value>
<description>location of default database for the warehouse</description>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:derby:/opt/hive-2.0.0/metastore_db;create=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
</configuration>
4.2 데이터베이스 초기 화
schematool -initSchema -dbType derby
다음 몇 줄 설명 초기 화 성공:
Starting metastore schema initialization to 2.0.0
Initialization script hive-schema-2.0.0.derby.sql
Initialization script completed
schemaTool completed
4.3 시작 프로그램
mkdir -p /opt/hive-2.0.0/warehouse //
chmod a+rwx /opt/hive-2.0.0/warehouse //
hive
hive>
프롬프트 가 나타 나 면 시작 성공 을 설명 합 니 다.5.흔히 볼 수 있 는 오류
5.1 하 이브 리드 를 실행 할 때 나타 나 기
Exception in thread "main" java.lang.RuntimeException: Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema -dbType ...) to create the schema. If needed, don't forget to include the option to auto-create the underlying database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql)
오류 원인:데이터베이스 가 초기 화 되 지 않 았 습 니 다.4.2 참조 하 십시오.
5.2 schematool 을 사용 하여 데이터 베 이 스 를 초기 화 할 때 나타 납 니 다.
Initialization script hive-schema-2.0.0.derby.sql
Error: FUNCTION 'NUCLEUS_ASCII' already exists. (state=X0Y68,code=30000) org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!
*** schemaTool failed ***
오류 원인:데이터베이스 폴 더 에 파일 이 이미 존재 합 니 다.해결 방법 은 데이터베이스 폴 더 를 비 우 는 것 입 니 다(즉,앞에서 설정 한
/opt/hive-2.0.0/metastore_db
폴 더 입 니 다)
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
CentOS 7에서 OpenLDAP 서버 설치 및 구성LDAP(Lightweight Directory Access Protocol)는 ID와 개체를 쉽게 관리할 수 있는 디렉터리 서비스입니다. Windows 세계에서 서버는 일반적으로 Active Directory입니다...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.