Add hive installation

This commit is contained in:
2024-02-01 11:35:43 +05:30
parent 1418f2dfad
commit 004a01630e
2 changed files with 24 additions and 6 deletions

View File

@@ -83,5 +83,13 @@ COPY hbase-site.xml ~/hbase-site.xml
RUN mkdir -p /hadoop/zookeeper RUN mkdir -p /hadoop/zookeeper
RUN chown -R $USER:$USER /hadoop/ RUN chown -R $USER:$USER /hadoop/
# Install Hive
RUN wget https://dlcdn.apache.org/hive/hive-3.1.3/apache-hive-3.1.3-bin.tar.gz
RUN tar -xzvf apache-hive-3.1.3-bin.tar.gz
RUN mv apache-hive-3.1.3-bin /usr/local/hive
RUN echo "export HIVE_HOME=/usr/local/hive" >> ~/.bashrc
RUN echo "export PATH=\$PATH:\$HIVE_HOME/bin" >> ~/.bashrc
RUN echo "HADOOP_HOME=/usr/local/hadoop" >> /usr/local/hive/bin/hive-config.sh
# Expose necessary ports # Expose necessary ports
EXPOSE 9870 8088 9000 EXPOSE 9870 8088 9000

20
init
View File

@@ -1,9 +1,19 @@
#!/usr/bin/env bash #!/usr/bin/env bash
service ssh restart
stop-hbase.sh service ssh restart # restart ssh service
stop-hbase.sh # stop all processes
stop-all.sh stop-all.sh
hdfs namenode -format hdfs namenode -format # format namenodes
rm *.tar.gz rm *.tar.gz # delete all tar files to save space
# start all
start-all.sh start-all.sh
start-hbase.sh start-hbase.sh
jps
# hive initialization
hdfs dfs -mkdir /tmp
hdfs dfs -chmod g+w /tmp
hdfs dfs -mkdir -p /user/hive/warehouse
hdfs dfs -chmod g+w /user/hive/warehouse
schematool -dbType derby -initSchema