ATLAS-4218: Docker support to run Apache Hive and Apache HBase with Atlas hook
diff --git a/dev-support/atlas-docker/.dockerignore b/dev-support/atlas-docker/.dockerignore
index fa4ce32..d4a3db2 100644
--- a/dev-support/atlas-docker/.dockerignore
+++ b/dev-support/atlas-docker/.dockerignore
@@ -1,5 +1,7 @@
*
!config
-!dist/apache-atlas-*-bin.tar.gz
+!dist/apache-atlas-*-hbase-hook.tar.gz
+!dist/apache-atlas-*-hive-hook.tar.gz
+!dist/apache-atlas-*-server.tar.gz
!downloads/*
!scripts/*
diff --git a/dev-support/atlas-docker/.env b/dev-support/atlas-docker/.env
index 79d2b97..eb49061 100644
--- a/dev-support/atlas-docker/.env
+++ b/dev-support/atlas-docker/.env
@@ -8,3 +8,5 @@
HADOOP_VERSION=3.3.0
HBASE_VERSION=2.3.3
KAFKA_VERSION=2.5.0
+HIVE_VERSION=3.1.2
+HIVE_HADOOP_VERSION=3.1.0
diff --git a/dev-support/atlas-docker/Dockerfile.atlas b/dev-support/atlas-docker/Dockerfile.atlas
index 4bafe80..8887791 100644
--- a/dev-support/atlas-docker/Dockerfile.atlas
+++ b/dev-support/atlas-docker/Dockerfile.atlas
@@ -18,12 +18,12 @@
ARG ATLAS_VERSION
-COPY ./scripts/atlas.sh ${ATLAS_SCRIPTS}/
-COPY ./dist/apache-atlas-${ATLAS_VERSION}-bin.tar.gz /home/atlas/dist/
+COPY ./scripts/atlas.sh ${ATLAS_SCRIPTS}/
+COPY ./dist/apache-atlas-${ATLAS_VERSION}-server.tar.gz /home/atlas/dist/
-RUN tar xfz /home/atlas/dist/apache-atlas-${ATLAS_VERSION}-bin.tar.gz --directory=/opt/ && \
+RUN tar xfz /home/atlas/dist/apache-atlas-${ATLAS_VERSION}-server.tar.gz --directory=/opt/ && \
ln -s /opt/apache-atlas-${ATLAS_VERSION} ${ATLAS_HOME} && \
- rm -f /home/atlas/dist/apache-atlas-${ATLAS_VERSION}-bin.tar.gz && \
+ rm -f /home/atlas/dist/apache-atlas-${ATLAS_VERSION}-server.tar.gz && \
mkdir -p /var/run/atlas /var/log/atlas /home/atlas/data ${ATLAS_HOME}/hbase/conf && \
rm -rf ${ATLAS_HOME}/logs && \
ln -s /var/log/atlas ${ATLAS_HOME}/logs && \
diff --git a/dev-support/atlas-docker/Dockerfile.atlas-db b/dev-support/atlas-docker/Dockerfile.atlas-db
new file mode 100644
index 0000000..b596809
--- /dev/null
+++ b/dev-support/atlas-docker/Dockerfile.atlas-db
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM postgres:12
+
+# Copy DB init script
+USER 0
+RUN mkdir -p /docker-entrypoint-initdb.d
+COPY config/init_postgres.sh /docker-entrypoint-initdb.d/
+RUN chown -R postgres:postgres /docker-entrypoint-initdb.d/
+ENV POSTGRES_PASSWORD atlasR0cks!
diff --git a/dev-support/atlas-docker/Dockerfile.atlas-hbase b/dev-support/atlas-docker/Dockerfile.atlas-hbase
index 1c5fa28..6b4b6ed 100644
--- a/dev-support/atlas-docker/Dockerfile.atlas-hbase
+++ b/dev-support/atlas-docker/Dockerfile.atlas-hbase
@@ -20,15 +20,25 @@
ARG HBASE_VERSION
-COPY ./downloads/hbase-${HBASE_VERSION}-bin.tar.gz /home/atlas/dist/
+COPY ./dist/apache-atlas-${ATLAS_VERSION}-hbase-hook.tar.gz /home/atlas/dist/
+COPY ./downloads/hbase-${HBASE_VERSION}-bin.tar.gz /home/atlas/dist/
-COPY ./scripts/atlas-hbase-setup.sh /home/atlas/scripts/
-COPY ./scripts/atlas-hbase.sh /home/atlas/scripts/
-COPY ./scripts/hbase-site.xml /home/atlas/scripts/
+COPY ./scripts/atlas-hbase-setup.sh /home/atlas/scripts/
+COPY ./scripts/atlas-hbase.sh /home/atlas/scripts/
+COPY ./scripts/hbase-site.xml /home/atlas/scripts/
+COPY ./scripts/atlas-hbase-application.properties /home/atlas/scripts/
RUN tar xvfz /home/atlas/dist/hbase-${HBASE_VERSION}-bin.tar.gz --directory=/opt/ && \
ln -s /opt/hbase-${HBASE_VERSION} /opt/hbase && \
- rm -f /home/atlas/dist/hbase-${HBASE_VERSION}-bin.tar.gz
+ rm -f /home/atlas/dist/hbase-${HBASE_VERSION}-bin.tar.gz && \
+ tar xvfz /home/atlas/dist/apache-atlas-${ATLAS_VERSION}-hbase-hook.tar.gz --directory=/opt/ && \
+ ln -s /opt/apache-atlas-hbase-hook-${ATLAS_VERSION} /opt/apache-atlas-hbase-hook && \
+ rm -f /home/atlas/dist/apache-atlas-${ATLAS_VERSION}-hbase-hook.tar.gz && \
+ ln -s /opt/apache-atlas-hbase-hook/hook/hbase/atlas-plugin-classloader-${ATLAS_VERSION}.jar /opt/hbase/lib/ && \
+ ln -s /opt/apache-atlas-hbase-hook/hook/hbase/hbase-bridge-shim-${ATLAS_VERSION}.jar /opt/hbase/lib/ && \
+ ln -s /opt/apache-atlas-hbase-hook/hook/hbase/atlas-hbase-plugin-impl /opt/hbase/lib/atlas-hbase-plugin-impl && \
+ cp /home/atlas/scripts/hbase-site.xml /opt/hbase/conf/hbase-site.xml && \
+ cp -f /home/atlas/scripts/atlas-hbase-application.properties /opt/hbase/conf/atlas-application.properties
ENV HBASE_HOME /opt/hbase
ENV PATH /usr/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/hbase/bin
diff --git a/dev-support/atlas-docker/Dockerfile.atlas-hive b/dev-support/atlas-docker/Dockerfile.atlas-hive
new file mode 100644
index 0000000..23b637f
--- /dev/null
+++ b/dev-support/atlas-docker/Dockerfile.atlas-hive
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM atlas-base:latest
+
+ARG HIVE_VERSION
+ARG HIVE_HADOOP_VERSION
+ARG ATLAS_VERSION
+
+
+COPY ./dist/apache-atlas-${ATLAS_VERSION}-hive-hook.tar.gz /home/atlas/dist/
+COPY ./downloads/apache-hive-${HIVE_VERSION}-bin.tar.gz /home/atlas/dist/
+COPY ./downloads/hadoop-${HIVE_HADOOP_VERSION}.tar.gz /home/atlas/dist/
+
+COPY ./scripts/atlas-hive-setup.sh /home/atlas/scripts/
+COPY ./scripts/atlas-hive.sh /home/atlas/scripts/
+COPY ./scripts/atlas-hive-application.properties /home/atlas/scripts/
+COPY ./scripts/hive-site.xml /home/atlas/scripts/
+
+RUN tar xvfz /home/atlas/dist/apache-hive-${HIVE_VERSION}-bin.tar.gz --directory=/opt/ && \
+ ln -s /opt/apache-hive-${HIVE_VERSION}-bin /opt/hive && \
+ rm -f /home/atlas/dist/apache-hive-${HIVE_VERSION}-bin.tar.gz && \
+ tar xvfz /home/atlas/dist/hadoop-${HIVE_HADOOP_VERSION}.tar.gz --directory=/opt/ && \
+ ln -s /opt/hadoop-${HIVE_HADOOP_VERSION} /opt/hadoop && \
+ rm -f /home/atlas/dist/hadoop-${HIVE_HADOOP_VERSION}.tar.gz && \
+ tar xvfz /home/atlas/dist/apache-atlas-${ATLAS_VERSION}-hive-hook.tar.gz --directory=/opt/ && \
+ ln -s /opt/apache-atlas-hive-hook-${ATLAS_VERSION} /opt/apache-atlas-hive-hook && \
+ rm -f /home/atlas/dist/apache-atlas-${ATLAS_VERSION}-hive-hook.tar.gz && \
+ ln -s /opt/apache-atlas-hive-hook/hook/hive/atlas-plugin-classloader-${ATLAS_VERSION}.jar /opt/hive/lib/ && \
+ ln -s /opt/apache-atlas-hive-hook/hook/hive/hive-bridge-shim-${ATLAS_VERSION}.jar /opt/hive/lib/ && \
+ ln -s /opt/apache-atlas-hive-hook/hook/hive/atlas-hive-plugin-impl /opt/hive/lib/atlas-hive-plugin-impl && \
+ cp -f /home/atlas/scripts/hive-site.xml /opt/hive/conf/hive-site.xml && \
+ cp -f /home/atlas/scripts/atlas-hive-application.properties /opt/hive/conf/atlas-application.properties
+
+ENV HIVE_HOME /opt/hive
+ENV HADOOP_HOME /opt/hadoop
+ENV PATH /usr/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/hive/bin:/opt/hadoop/bin
+
+ENTRYPOINT [ "/home/atlas/scripts/atlas-hive.sh" ]
diff --git a/dev-support/atlas-docker/README.md b/dev-support/atlas-docker/README.md
index 6ba4058..694d8db 100644
--- a/dev-support/atlas-docker/README.md
+++ b/dev-support/atlas-docker/README.md
@@ -43,7 +43,7 @@
5.2. Execute following command to install and start Atlas and dependent services (Solr, HBase, Kafka) in containers:
- docker-compose -f docker-compose.atlas-base.yml -f docker-compose.atlas.yml -f docker-compose.atlas-hadoop.yml -f docker-compose.atlas-hbase.yml -f docker-compose.atlas-kafka.yml up -d
+ docker-compose -f docker-compose.atlas-base.yml -f docker-compose.atlas.yml -f docker-compose.atlas-hadoop.yml -f docker-compose.atlas-hbase.yml -f docker-compose.atlas-kafka.yml -f docker-compose.atlas-hive.yml up -d
Apache Atlas will be installed at /opt/atlas/, and logs are at /var/logs/atlas directory.
diff --git a/dev-support/atlas-docker/config/init_postgres.sh b/dev-support/atlas-docker/config/init_postgres.sh
new file mode 100644
index 0000000..0602878
--- /dev/null
+++ b/dev-support/atlas-docker/config/init_postgres.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+set -e
+
+psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
+ CREATE USER hive WITH PASSWORD 'atlasR0cks!';
+ CREATE DATABASE hive;
+ GRANT ALL PRIVILEGES ON DATABASE hive TO hive;
+EOSQL
diff --git a/dev-support/atlas-docker/docker-compose.atlas-hbase.yml b/dev-support/atlas-docker/docker-compose.atlas-hbase.yml
index 7157889..6105aa7 100644
--- a/dev-support/atlas-docker/docker-compose.atlas-hbase.yml
+++ b/dev-support/atlas-docker/docker-compose.atlas-hbase.yml
@@ -6,6 +6,7 @@
dockerfile: Dockerfile.atlas-hbase
args:
- HBASE_VERSION=${HBASE_VERSION}
+ - ATLAS_VERSION=${ATLAS_VERSION}
image: atlas-hbase
container_name: atlas-hbase
hostname: atlas-hbase.example.com
@@ -23,8 +24,11 @@
condition: service_healthy
atlas-zk:
condition: service_started
+ atlas-kafka:
+ condition: service_started
environment:
- HBASE_VERSION
+ - ATLAS_VERSION
networks:
atlas:
diff --git a/dev-support/atlas-docker/docker-compose.atlas-hive.yml b/dev-support/atlas-docker/docker-compose.atlas-hive.yml
new file mode 100644
index 0000000..bb410cd
--- /dev/null
+++ b/dev-support/atlas-docker/docker-compose.atlas-hive.yml
@@ -0,0 +1,45 @@
+version: '3'
+services:
+ atlas-hive:
+ build:
+ context: .
+ dockerfile: Dockerfile.atlas-hive
+ args:
+ - HIVE_HADOOP_VERSION=${HIVE_HADOOP_VERSION}
+ - HIVE_VERSION=${HIVE_VERSION}
+ - ATLAS_VERSION=${ATLAS_VERSION}
+ image: atlas-hive
+ container_name: atlas-hive
+ hostname: atlas-hive.example.com
+ stdin_open: true
+ tty: true
+ networks:
+ - atlas
+ ports:
+ - "10000:10000"
+ depends_on:
+ atlas-db:
+ condition: service_started
+ atlas-hadoop:
+ condition: service_healthy
+ atlas-zk:
+ condition: service_started
+ atlas-kafka:
+ condition: service_started
+ environment:
+ - HIVE_HADOOP_VERSION
+ - HIVE_VERSION
+ - ATLAS_VERSION
+
+ atlas-db:
+ build:
+ context: .
+ dockerfile: Dockerfile.atlas-db
+ image: atlas-db
+ container_name: atlas-db
+ hostname: atlas-db.example.com
+ networks:
+ - atlas
+
+networks:
+ atlas:
diff --git a/dev-support/atlas-docker/download-archives.sh b/dev-support/atlas-docker/download-archives.sh
index dc6d22c..b5ede35 100755
--- a/dev-support/atlas-docker/download-archives.sh
+++ b/dev-support/atlas-docker/download-archives.sh
@@ -46,4 +46,6 @@
downloadIfNotPresent hadoop-${HADOOP_VERSION}.tar.gz https://archive.apache.org/dist/hadoop/common/hadoop-${HADOOP_VERSION}
downloadIfNotPresent hbase-${HBASE_VERSION}-bin.tar.gz https://archive.apache.org/dist/hbase/${HBASE_VERSION}
downloadIfNotPresent kafka_2.12-${KAFKA_VERSION}.tgz https://archive.apache.org/dist/kafka/${KAFKA_VERSION}
+downloadIfNotPresent apache-hive-${HIVE_VERSION}-bin.tar.gz https://archive.apache.org/dist/hive/hive-${HIVE_VERSION}
+downloadIfNotPresent hadoop-${HIVE_HADOOP_VERSION}.tar.gz https://archive.apache.org/dist/hadoop/common/hadoop-${HIVE_HADOOP_VERSION}
diff --git a/dev-support/atlas-docker/scripts/atlas-build.sh b/dev-support/atlas-docker/scripts/atlas-build.sh
index 316ef41..e53ebbb 100755
--- a/dev-support/atlas-docker/scripts/atlas-build.sh
+++ b/dev-support/atlas-docker/scripts/atlas-build.sh
@@ -86,4 +86,6 @@
mvn ${ARG_PROFILES} ${ARG_SKIPTESTS} -DskipDocs clean package
-mv -f distro/target/apache-atlas-${ATLAS_VERSION}-bin.tar.gz /home/atlas/dist/
+mv -f distro/target/apache-atlas-${ATLAS_VERSION}-server.tar.gz /home/atlas/dist/
+mv -f distro/target/apache-atlas-${ATLAS_VERSION}-hive-hook.tar.gz /home/atlas/dist/
+mv -f distro/target/apache-atlas-${ATLAS_VERSION}-hbase-hook.tar.gz /home/atlas/dist/
diff --git a/dev-support/atlas-docker/scripts/atlas-hbase-application.properties b/dev-support/atlas-docker/scripts/atlas-hbase-application.properties
new file mode 100644
index 0000000..8c5b9e0
--- /dev/null
+++ b/dev-support/atlas-docker/scripts/atlas-hbase-application.properties
@@ -0,0 +1,23 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+atlas.rest.address=http://atlas-example.com:21000
+
+atlas.kafka.zookeeper.connect=atlas-zk.example.com:2181
+atlas.kafka.bootstrap.servers=atlas-kafka.example.com:9092
diff --git a/dev-support/atlas-docker/scripts/atlas-hbase-setup.sh b/dev-support/atlas-docker/scripts/atlas-hbase-setup.sh
index c576989..9387b55 100755
--- a/dev-support/atlas-docker/scripts/atlas-hbase-setup.sh
+++ b/dev-support/atlas-docker/scripts/atlas-hbase-setup.sh
@@ -24,5 +24,4 @@
UserKnownHostsFile=/dev/null
EOF
-cp ${ATLAS_SCRIPTS}/hbase-site.xml /opt/hbase/conf/hbase-site.xml
chown -R hbase:hadoop /opt/hbase/
diff --git a/dev-support/atlas-docker/scripts/atlas-hive-application.properties b/dev-support/atlas-docker/scripts/atlas-hive-application.properties
new file mode 100644
index 0000000..8c5b9e0
--- /dev/null
+++ b/dev-support/atlas-docker/scripts/atlas-hive-application.properties
@@ -0,0 +1,23 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+atlas.rest.address=http://atlas-example.com:21000
+
+atlas.kafka.zookeeper.connect=atlas-zk.example.com:2181
+atlas.kafka.bootstrap.servers=atlas-kafka.example.com:9092
diff --git a/dev-support/atlas-docker/scripts/atlas-hive-setup.sh b/dev-support/atlas-docker/scripts/atlas-hive-setup.sh
new file mode 100755
index 0000000..f92b8c5
--- /dev/null
+++ b/dev-support/atlas-docker/scripts/atlas-hive-setup.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+echo "export JAVA_HOME=${JAVA_HOME}" >> ${HADOOP_HOME}/etc/hadoop/hadoop-env.sh
+
+cat <<EOF > /etc/ssh/ssh_config
+Host *
+ StrictHostKeyChecking no
+ UserKnownHostsFile=/dev/null
+EOF
+
+cat <<EOF > ${HADOOP_HOME}/etc/hadoop/core-site.xml
+<configuration>
+ <property>
+ <name>fs.defaultFS</name>
+ <value>hdfs://atlas-hadoop:9000</value>
+ </property>
+</configuration>
+EOF
+
+cp ${ATLAS_SCRIPTS}/hive-site.xml ${HIVE_HOME}/conf/hive-site.xml
+cp ${ATLAS_SCRIPTS}/hive-site.xml ${HIVE_HOME}/conf/hiveserver2-site.xml
+su -c "${HIVE_HOME}/bin/schematool -dbType postgres -initSchema" hive
+
+mkdir -p /opt/hive/logs
+chown -R hive:hadoop /opt/hive/
+chmod g+w /opt/hive/logs
+
+cd ${ATLAS_HOME}/atlas-hive-plugin
+./enable-hive-plugin.sh
diff --git a/dev-support/atlas-docker/scripts/atlas-hive.sh b/dev-support/atlas-docker/scripts/atlas-hive.sh
new file mode 100755
index 0000000..57bd890
--- /dev/null
+++ b/dev-support/atlas-docker/scripts/atlas-hive.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+service ssh start
+
+if [ ! -e ${HIVE_HOME}/.setupDone ]
+then
+ su -c "ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa" hdfs
+ su -c "cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys" hdfs
+ su -c "chmod 0600 ~/.ssh/authorized_keys" hdfs
+
+ su -c "ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa" yarn
+ su -c "cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys" yarn
+ su -c "chmod 0600 ~/.ssh/authorized_keys" yarn
+
+ echo "ssh" > /etc/pdsh/rcmd_default
+
+ ${ATLAS_SCRIPTS}/atlas-hive-setup.sh
+
+ touch ${HIVE_HOME}/.setupDone
+fi
+
+su -c "${HIVE_HOME}/bin/hiveserver2" hive
+
+HIVESERVER2_PID=`ps -ef | grep -v grep | grep -i "org.apache.hive.service.server.HiveServer2" | awk '{print $2}'`
+
+# prevent the container from exiting
+tail --pid=$HIVESERVER2_PID -f /dev/null
diff --git a/dev-support/atlas-docker/scripts/hbase-site.xml b/dev-support/atlas-docker/scripts/hbase-site.xml
index dd8828f..934321d 100644
--- a/dev-support/atlas-docker/scripts/hbase-site.xml
+++ b/dev-support/atlas-docker/scripts/hbase-site.xml
@@ -49,4 +49,8 @@
<name>hbase.zookeeper.quorum</name>
<value>atlas-zk.example.com</value>
</property>
+ <property>
+ <name>hbase.coprocessor.master.classes</name>
+ <value>org.apache.atlas.hbase.hook.HBaseAtlasCoprocessor</value>
+ </property>
</configuration>
diff --git a/dev-support/atlas-docker/scripts/hive-site.xml b/dev-support/atlas-docker/scripts/hive-site.xml
new file mode 100644
index 0000000..9ad54e7
--- /dev/null
+++ b/dev-support/atlas-docker/scripts/hive-site.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?><!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+ <property>
+ <name>javax.jdo.option.ConnectionURL</name>
+ <value>jdbc:postgresql://atlas-db/hive</value>
+ </property>
+ <property>
+ <name>javax.jdo.option.ConnectionDriverName</name>
+ <value>org.postgresql.Driver</value>
+ </property>
+ <property>
+ <name>javax.jdo.option.ConnectionUserName</name>
+ <value>hive</value>
+ </property>
+ <property>
+ <name>javax.jdo.option.ConnectionPassword</name>
+ <value>atlasR0cks!</value>
+ </property>
+
+ <property>
+ <name>hive.server2.enable.doAs</name>
+ <value>false</value>
+ </property>
+
+ <property>
+ <name>hive.zookeeper.quorum</name>
+ <value>atlas-zk.example.com</value>
+ </property>
+
+ <property>
+ <name>hive.zookeeper.client.port</name>
+ <value>2181</value>
+ </property>
+
+ <property>
+ <name>hive.exec.post.hooks</name>
+ <value>org.apache.atlas.hive.hook.HiveHook</value>
+ </property>
+
+ <property>
+ <name>hive.metastore.event.listeners</name>
+ <value>org.apache.atlas.hive.hook.HiveMetastoreHook</value>
+ </property>
+</configuration>