Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

tellusboutyourself

하이브(Hive) 설치 본문

Hadoop

하이브(Hive) 설치

금서_ 2024. 3. 8. 17:58

리눅스(Rocky9-Server) 터미널 창에서 하이브 설치하는 방법

 

# 설치파일 다운로드
wget http://apache.mirror.cdnetworks.com/hive/hive-3.1.2/apache-hive-3.1.2-bin.tar.gz

# 압축 풀기
tar xvfz apache-hive-3.1.2-bin.tar.gz apache-hive-3.1.2-bin/

# 템플릿 파일 변경
find -type f -name hive-env*

# 긴 이름을 짧게 바꾸기
mv apache-hive-3.1.2-bin apache-hive

# 아파치 하이브에 들어가기
cd apache-hive/

ls bin/

pwd

mv conf/hive-env.sh.template conf/hive-env.sh

ls conf

# 하둡 홈 경로 설정하기 (gedit로 편집해도 됨.)
vi conf/hive-env.sh
	(편집창 들어가서)
		HADOOP_HOME=${bin}/../../hadoop 밑에다가 
		HADOOP_HOME=~/hadoop 추가하기

find -type f -name hive-site*

# 코어사이트 내용을 hive-site.xml로 복사
cp ~/hadoop/etc/hadoop/core-site.xml hive-site.xml

# 해당 파일 들어가서, 주석은 다 지워도 됨. 
gedit hive-site.xml
	(편집창 들어가서 아래와 같이 수정)
	
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>
	<property>
		<name>hive.metastore.warehouse.dir</name>
		<value>/user/hive/warehouse</value>
	</property>
	<property>
		<name>hive.cli.print.header</name>
		<value>true</value>
	</property>
</configuration>

# 저장 후 닫기
# 다시 터미널 창으로 돌아와서

$HADOOP_HOME/sbin/start-all.sh

hadoop fs -mkdir -p /user/hive/warehouse bin
hadoop fs -ls /user/hive/warehouse bin
hadoop fs -mkdir -p /user/hive/warehouse/bin
hadoop fs -chmod g+w /tmp
hadoop fs -chmod g+w /user/hive/warehouse/
hadoop fs -chmod 777 /tmp/hive
hadoop fs -ls /tmp/hive

pwd

cp $HADOOP_HOME/share/hadoop/hdfs/lib/guava-27.0-jre.jar ~/apache-hive/lib/

bin/schematool -initSchema -dbType derby