diff --git a/Dockerfile b/Dockerfile index 8964abc..6010906 100644 --- a/Dockerfile +++ b/Dockerfile @@ -83,5 +83,13 @@ COPY hbase-site.xml ~/hbase-site.xml RUN mkdir -p /hadoop/zookeeper 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 9870 8088 9000 diff --git a/init b/init index 7178f39..ca1fb32 100644 --- a/init +++ b/init @@ -1,9 +1,19 @@ #!/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 -hdfs namenode -format -rm *.tar.gz -start-all.sh +hdfs namenode -format # format namenodes +rm *.tar.gz # delete all tar files to save space + +# start all +start-all.sh start-hbase.sh -jps \ No newline at end of file + +# 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 +