2020-09-28 17:29:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
NAME=rclone-hdfs
|
2021-01-16 15:52:08 +00:00
|
|
|
KERBEROS=${KERBEROS-"false"}
|
2020-09-28 17:29:44 +00:00
|
|
|
|
|
|
|
. $(dirname "$0")/docker.bash
|
|
|
|
|
|
|
|
start() {
|
2021-01-16 15:52:08 +00:00
|
|
|
docker run --rm -d --name "rclone-hdfs" \
|
|
|
|
--hostname "rclone-hdfs" \
|
|
|
|
-e "KERBEROS=$KERBEROS" \
|
|
|
|
-p 127.0.0.1:9866:9866 \
|
|
|
|
-p 127.0.0.1:8020:8020 \
|
|
|
|
-p 127.0.0.1:750:750 \
|
|
|
|
-p 127.0.0.1:88:88 \
|
|
|
|
rclone/test-hdfs
|
2020-09-28 17:29:44 +00:00
|
|
|
sleep 10
|
|
|
|
|
2021-01-16 15:52:08 +00:00
|
|
|
if [ $KERBEROS = "true" ]; then
|
|
|
|
docker cp rclone-hdfs:/tmp/krb5cc_0 /tmp/krb5cc_`id -u`
|
|
|
|
fi
|
|
|
|
|
2020-09-28 17:29:44 +00:00
|
|
|
echo type=hdfs
|
|
|
|
echo namenode=127.0.0.1:8020
|
2021-01-08 09:05:25 +00:00
|
|
|
echo username=root
|
2021-10-22 12:07:48 +00:00
|
|
|
echo _connect=${namenode}
|
2020-09-28 17:29:44 +00:00
|
|
|
}
|
|
|
|
stop() {
|
|
|
|
if status ; then
|
2021-01-16 15:52:08 +00:00
|
|
|
docker logs $NAME > .stdout.log 2> .stderr.log
|
2020-09-28 17:29:44 +00:00
|
|
|
docker kill $NAME
|
|
|
|
echo "$NAME stopped"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
. $(dirname "$0")/run.bash
|