2020-09-29 01:29:44 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
NAME=rclone-hdfs
|
2021-01-16 23:52:08 +08:00
|
|
|
KERBEROS=${KERBEROS-"false"}
|
2020-09-29 01:29:44 +08:00
|
|
|
|
|
|
|
. $(dirname "$0")/docker.bash
|
|
|
|
|
|
|
|
start() {
|
2021-01-16 23:52:08 +08: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
|
2021-10-24 05:51:44 +08:00
|
|
|
sleep 30
|
2020-09-29 01:29:44 +08:00
|
|
|
|
2021-01-16 23:52:08 +08:00
|
|
|
if [ $KERBEROS = "true" ]; then
|
|
|
|
docker cp rclone-hdfs:/tmp/krb5cc_0 /tmp/krb5cc_`id -u`
|
|
|
|
fi
|
|
|
|
|
2020-09-29 01:29:44 +08:00
|
|
|
echo type=hdfs
|
|
|
|
echo namenode=127.0.0.1:8020
|
2021-01-08 17:05:25 +08:00
|
|
|
echo username=root
|
2021-10-22 20:07:48 +08:00
|
|
|
echo _connect=${namenode}
|
2020-09-29 01:29:44 +08:00
|
|
|
}
|
|
|
|
stop() {
|
|
|
|
if status ; then
|
2021-01-16 23:52:08 +08:00
|
|
|
docker logs $NAME > .stdout.log 2> .stderr.log
|
2020-09-29 01:29:44 +08:00
|
|
|
docker kill $NAME
|
|
|
|
echo "$NAME stopped"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
. $(dirname "$0")/run.bash
|