IT Log

Hive Metastore Derby 본문

Open Source/Apache

Hive Metastore Derby

newly0513 2021. 3. 24. 16:28
728x90
반응형

시스템 요구사항 (System requirements)

  • Java
    • Java 9 이상 : 10.15.2.0 / 10.15.1.3 (Derby 버전)
    • Java 8 이상 : 10.14.2.0 / 10.13.1.1 (Derby 버전)
    • Java 6 이상 : 10.12.1.1 / 10.11.1.1 (Derby 버전)

 

Derby Download

cd /usr/local; \
wget http://apache.mirror.cdnetworks.com/db/derby/db-derby-10.14.2.0/db-derby-10.14.2.0-bin.tar.gz; \
tar xzvf db-derby-10.14.2.0-bin.tar.gz; \
rm -rf db-derby-10.14.2.0-bin.tar.gz; \
mv db-derby-10.14.2.0-bin derby

 

Data Folder 생성

mkdir /usr/local/derby/data


환경변수 설정

derby.sh

vi /etc/profile.d/derby.sh
DERBY_INSTALL=/usr/local/derby
DERBY_HOME=/usr/local/derby
export DERBY_INSTALL
export DERBY_HOME

 

hive.sh

vi /etc/profile.d/hive.sh
HADOOP=/usr/local/hadoop/bin/hadoop
export HADOOP

 

export CLASSPATH=$CLASSPATH:$DERBY_HOME/lib/derby.jar:$DERBY_HOME/lib/derbytool.jar:$DERBY_HOME/lib/derbyclient.jar:

 

 

 

Derby 시작

cd /usr/local/derby/data; \
nohup /usr/local/derby/bin/startNetworkServer -h 0.0.0.0 &

 

구성 파일

hive-site.xml

 해당 <properties>부분을 찾아서 아래 <value>값으로 변경합니다.

cd /usr/local/hive/conf; \
cp hive-default.xml.template hive-site.xml
# 수정
...
  <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:derby://master:1527/metastore_db;create=true</value>
    <description>JDBC connect string for a JDBC metastore</description>
  </property> 
  <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>org.apache.derby.jdbc.ClientDriver</value>
    <description>Driver class name for a JDBC metastore</description>
  </property>
...


# 추가
  <property>
    <name>system:java.io.tmpdir</name>
    <value>/user/local/hive/tmp/java</value>
  </property>
  <property>
    <name>system:user.name</name>
    <value>${user.name}</value>
  </property>

 

 

jpox.properties

vi /usr/local/hive/conf/jpox.properties
javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFactoryImpl
org.jpox.autoCreateSchema=false
org.jpox.validateTables=false
org.jpox.validateColumns=false
org.jpox.validateConstraints=false
org.jpox.storeManagerType=rdbms
org.jpox.autoCreateSchema=true
org.jpox.autoStartMechanismMode=checked
org.jpox.transactionIsolation=read_committed
javax.jdo.option.DetachAllOnCommit=true
javax.jdo.option.NontransactionalRead=true
javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.ClientDriver
javax.jdo.option.ConnectionURL=jdbc:derby://master:1527/metastore_db;create=true
javax.jdo.option.ConnectionUserName=APP
javax.jdo.option.ConnectionPassword=mine

 

Derby jar 파일 복사

cp /usr/local/derby/lib/derbyclient.jar /usr/local/hive/lib; \
cp /usr/local/derby/lib/derbytools.jar /usr/local/hive/lib

cp /usr/local/derby/lib/derbyclient.jar /usr/local/hadoop/lib; \
cp /usr/local/derby/lib/derbytools.jar /usr/local/hadoop/lib

 

Hive 시작

 show tables; 실행 시 /usr/local/derby/data/metastore_db. 가 생성되어야 합니다.

cd /usr/local/hive; \
hive
show tables;

728x90
반응형

'Open Source > Apache' 카테고리의 다른 글

HBase 구성 ( Full-distributed )  (0) 2021.03.24
HBase 구성 (Standalone)  (0) 2021.03.24
Hive Metastore MySQL  (0) 2020.09.07
Hive Metastore  (0) 2020.09.05
Zookeeper 구성 ( Multi-Server )  (0) 2020.09.02
Comments