This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Waiting for docker daemon to start up:" | |
until /usr/bin/docker ps 2>&1| grep STATUS>/dev/null; do sleep 1; done; >/dev/null | |
/usr/bin/docker ps -a | grep sandbox | |
if [ $? -eq 0 ]; then | |
/usr/bin/docker start sandbox | |
else | |
docker run -v hadoop:/hadoop --name sandbox --hostname "sandbox.hortonworks.com" --privileged -d \ | |
-p 6080:6080 \ | |
-p 18081:18081 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INPUT=$1 | |
DEST=$2 | |
indices=$(curl -s -XGET $INPUT/_cat/indices?h=i) | |
for INDEX in $indices | |
do | |
elasticdump --input=$INPUT/$INDEX --output=$DEST/$INDEX --type=data | |
done |