메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다. 문의사항은 gooper@gooper.com로 메일을 보내주세요.


1. hive 다운로드

http://mirror.apache-kr.org/hive/

 

2. banana pi에 업로드(winscp등을 이용) - root로 실행

/usr/local에 업로드한다.

 

3. 압축풀기

  - tar xvfz apache-hive-0.13.1-bin.tar.gz

 

4. 링크 걸기

  - ln -s apache-hive-0.13.1-bin hive

 

5. /etc/profile에 아래의 내용을 추가함

     export HIVE_HOME=/usr/local/hive
     export PATH=$PATH:$HIVE_HOME/bin

 

 # source /etc/profile로 반영함

 

6. conf설정

 - *.template파일을 복사하여 각각의 설정파일을 만들고 내용을 추가한다.

hive-env.sh

hive-exec-log4j.properties

hive-log4j.properties

hive-site.xml

 

7. hive에서 사용할 hdfs에 디렉토리 구성및 권한부여 

hadoop fs -mkdir /tmp
hadoop fs -mkdir /user/hive/warehouse
hadoop fs -chmod g+w /tmp
hadoop fs -chmod g+w /user/hive/warehouse


hadoop fs -chown hadoop:hadoop /user/hive

hadoop fs -chown hadoop:hadoop /user/hive/warehouse

 

8. mysql설치

 root@master:/usr/local# apt-get install mysql-server

(404오류가발생시 https://www.gooper.com/ss/index.php?mid=bigdata&category=2772&document_srl=2995를 참조하여 조치후 설치한다)


9. 사용자 생성

가. mysql> grant all privileges on *.* to 'hive'@'localhost' identified by '패스워드' with grant option;

Query OK, 0 rows affected (0.00 sec)

나. mysql>grant all privileges on *.* to 'hive'@'%' identified by '패스워드' with grant option;


10. db생성

mysql> create database metastore_db;

Query OK, 1 row affected (0.00 sec)

 

11. 테이블 생성 스크립트 실행

root@master:/usr/local/hive/bin# mysql -u root -p패스워드 metastore_db < /usr/local/hive/scripts/metastore/upgrade/mysql/hive-schema-0.13.0.mysql.sql

 

12. 원격접속 가능하도록 설정

mysql> select host from user where user='hive';
+-----------+
| host      |
+-----------+
| localhost |
+-----------+
1 row in set (0.00 sec)

mysql> insert into mysql.user(host,user,password) values('%','metastore',password('패스워드'));
Query OK, 1 row affected, 3 warnings (0.00 sec)

mysql> grant all privileges on *.* to 'hive'@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> select host from user where user='hive';
+-----------+
| host      |
+-----------+
| %         |
| localhost |
+-----------+
2 rows in set (0.00 sec)

13.mysql connector를 다운로드하여 HIVE_HOME/lib에 복사

   (http://www.mysql.com/downloads/connector/j/에서 다운로드하여 압축해제후 mysql-connector-java-5.1.32-bin.jar만 복사)

 

14. HIVE_HOME/conf의 hive-site.xml에 아래를 추가 혹은 변경한다.


<configuration>

<property>

  <name>javax.jdo.option.ConnectionURL</name>

  <value>jdbc:mysql://db_server:3306/hive_metastore_db?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>hive</value>

  <description>username to use against metastore database</description>

</property>

<property>

  <name>javax.jdo.option.ConnectionPassword</name>

  <value>패스워드</value>

  <description>password to use against metastore database</description>

</property>

</configuration>

<property>

  <name>hive.metastore.port</name>

  <value>3306</value>

  <description>Hive metastore listener port</description>

  </property>

</configuration>


15. hadoop-env.sh 끝에 아래의 내용을 추가하여 hive관련 lib및 conf를 인식시켜준다.

가. export HADOOP_CLASSPATH에 /usr/local/hive/conf를 추가함

나. 파일끝에 아래를 추가함

for f in ${HIVE_HOME}/lib/*.jar; do
   HADOOP_CLASSPATH=${HADOOP_CLASSPATH}:$f;
done

 

16. hive metastore실행
  hive --service metastore &

  *확인

     root@master:/usr/local/hive/bin# netstat -an | grep 9083
     tcp6       0      0 :::9083                 :::*                    LISTEN    


17. hive server2실행 

   hive server시작(hive가 설치된 master에서 실행)

      : nohup hiveserver2 &


18. beeline실행

hiveserver2에 접근하기 위해서 "bin/beeline -u jdbc:hive2://sda1:10000"을 실행한다.

 

*로그파일 위치(root로 실행할때 default위치) : /tmp/root/hive.log



번호 제목 글쓴이 날짜 조회 수
30 Query Status: Sender xxx.xxx.xxx.xxx timed out waiting for receiver fragment instance: 1234:cdsf, dest node: 10 의 오류 원인및 대응방안 총관리자 2021.11.03 77
29 kudu 테이블 metadata강제 삭제시 발생하는 오류 메세지 총관리자 2022.01.12 110
28 not leader of this config: current role FOLLOWER 오류 발생시 확인방법 총관리자 2022.01.17 23
27 Soft memory limit exceeded (at 100.05% of capacity) 오류 조치 총관리자 2022.01.17 181
26 Failed to write to server: (no server available): 총관리자 2022.01.17 32
25 Kudu tablet이 FAILED일때 원인 확인 방법 총관리자 2022.01.17 90
24 kudu rebalance수행 command예시 총관리자 2022.01.17 85
23 [hive] hive.tbls테이블의 owner컬럼값은 hadoop.security.auth_to_local에 의해서 filtering된다. 총관리자 2022.04.14 55
22 [TLS/SSL]Kudu Master 설정하기 총관리자 2022.05.13 61
21 [TLS/SSL]Kudu Tablet Server설정 총관리자 2022.05.13 35
20 Query 1234:1234 expired due to client inactivity(timeout is 5m)및 invalid query handle gooper 2022.06.10 81
19 small file 한개 파일로 만들기(text file 혹은 parquet file의 테이블) gooper 2022.07.04 76
18 [Cloudera 6.3.4, Kudu]]Service Monitor에서 사용하는 metric중에 일부를 blacklist로 설정하여 모니터링 정보 수집 제외하는 방법 gooper 2022.07.08 31
17 [Kudu]Schema별 혹은 테이블별 사용량(Replica포함) 구하는 방법 gooper 2022.07.14 121
16 [CDP7.1.7]Impala Query의 Memory Spilled 양은 ScratchFileUsedBytes값을 누적해서 구할 수 있다. gooper 2022.07.29 29
15 [impala]쿼리 수행중 발생하는 오류(due to memory pressure: the memory usage of this transaction, Failed to write to server) gooper 2022.10.05 67
14 [Impala 3.2버젼]compute incremental stats db명.테이블명 수행시 ERROR: AnalysisException: Incremental stats size estimate exceeds 2000.00MB. 오류 발생원인및 조치방안 gooper 2022.11.30 697
13 hive의 메타정보 테이블을 MariaDB로 사용하는 경우 table comment나 column comment에 한글 입력시 깨지는 경우 utf8로 바꾸는 방법. gooper 2023.03.10 93
12 [Kudu]ERROR: Unable to advance iterator for node with id '2' for Kudu table 'impala::core.pm0_abdasubjct': Network error: recv error from unknown peer: Transport endpoint is not connected (error 107) gooper 2023.03.16 536
11 [KUDU] kudu tablet server여러가지 원인에 의해서 corrupted상태가 된 경우 복구방법 gooper 2023.03.28 37

A personal place to organize information learned during the development of such Hadoop, Hive, Hbase, Semantic IoT, etc.
We are open to the required minutes. Please send inquiries to gooper@gooper.com.

위로