Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEST1] #2

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion catalogs/catalog-hadoop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ tasks.test {

doFirst {
environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.12")
environment("GRAVITINO_CI_KERBEROS_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-kerberos-hive:0.1.0")
environment("GRAVITINO_CI_KERBEROS_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-kerberos-hive:0.1.2")
}

val init = project.extra.get("initIntegrationTest") as (Test) -> Unit
Expand Down
2 changes: 1 addition & 1 deletion catalogs/catalog-hive/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ tasks.test {

doFirst {
environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.12")
environment("GRAVITINO_CI_KERBEROS_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-kerberos-hive:0.1.1")
environment("GRAVITINO_CI_KERBEROS_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-kerberos-hive:0.1.2")
}

val init = project.extra.get("initIntegrationTest") as (Test) -> Unit
Expand Down
35 changes: 34 additions & 1 deletion dev/docker/kerberos-hive/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
# start ssh
HOSTNAME=`hostname`
service ssh start
ssh-keyscan localhost > /root/.ssh/known_hosts
ssh-keyscan ${HOSTNAME} >> /root/.ssh/known_hosts
ssh-keyscan localhost >> /root/.ssh/known_hosts
ssh-keyscan 0.0.0.0 >> /root/.ssh/known_hosts
ssh-keyscan 127.0.0.1 >> /root/.ssh/known_hosts

# init the Kerberos database
echo -e "${PASS}\n${PASS}" | kdb5_util create -s
Expand Down Expand Up @@ -65,6 +67,37 @@ ${HADOOP_HOME}/sbin/hadoop-daemon.sh start namenode

echo "Starting DataNode..."
${HADOOP_HOME}/sbin/start-secure-dns.sh
sleep 5

# Check if the DataNode is running
ps -ef | grep DataNode | grep -v "color=auto"
if [[ $? -ne 0 ]]; then
echo "DataNode failed to start, please check the logs"
ehco "HDFS DataNode log start----------------------------"
cat ${HADOOP_HOME}/bin/logs/hadoop-root-datanode-*.log
exit 1
fi

retry_times=0
ready=0
while [[ ${retry_times} -lt 10 ]]; do
hdfs_ready=$(hdfs dfsadmin -report | grep "Live datanodes" | awk '{print $3}')
if [[ ${hdfs_ready} == "(1):" ]]; then
echo "HDFS is ready, retry_times = ${retry_times}"
let "ready=0"
break
fi
sleep 10
retry_times=$((retry_times+1))
done

if [[ ${ready} -ne 0 ]]; then
echo "HDFS is not ready"
ehco "HDFS DataNode log start---------------------------"
cat ${HADOOP_HOME}/bin/logs/hadoop-root-datanode-*.log
exit 1
fi


# start mysql and create databases/users for hive
chown -R mysql:mysql /var/lib/mysql
Expand Down
3 changes: 3 additions & 0 deletions docs/docker-image-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ You can use these kinds of Docker images to facilitate integration testing of al
You can use this kind of image to test the catalog of Apache Hive with kerberos enable

Changelog
- gravitino-ci-kerberos-hive:0.1.2
- Add `${HOSTNAME} >> /root/.ssh/known_hosts` to the startup script.
- Add check for the status of DataNode, if the DataNode is not running or ready within 100s, the container will exit.

- gravitino-ci-kerberos-hive:0.1.1
- Add a principal for Gravitino web server named 'HTTP/localhost@HADOOPKRB'.
Expand Down
Loading