daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Sep 21st, 2016 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env bash
  2.  
  3. ROOT_DIR=$([[ $PWD == */bin ]] && dirname $PWD || echo $PWD)
  4.  
  5. DRUID_VERSION="0.9.2-SNAPSHOT"
  6. DRUID_PATH=${ROOT_DIR}/dist/druid-${DRUID_VERSION}
  7. MYSQL_PATH=${ROOT_DIR}/dist/mysql-metadata-storage-${DRUID_VERSION}.tar.gz
  8.  
  9. [[ -d ${DRUID_PATH} && -f ${MYSQL_PATH} ]] || {
  10.     echo "Druid distribution should be here $DRUID_PATH !!!"
  11.     exit 1
  12. }
  13.  
  14. echo "Uncompressing latest version of myslq-metadata-storage ..."
  15.  
  16. tar -xf ${MYSQL_PATH} -C ${DRUID_PATH}/extensions/
  17.  
  18. echo "Initiating Mysql metadata storage recovery from s3 deep storage ..."
  19.  
  20. DRUID_CLASSPATH="$DRUID_PATH/lib"
  21.  
  22. echo "Classpath $DRUID_CLASSPATH ..."
  23.  
  24. cd ${DRUID_CLASSPATH}
  25.  
  26. java \
  27.     -Ddruid.metadata.storage.type=mysql \
  28.     -Ddruid.metadata.storage.connector.connectURI=jdbc\:mysql\://localhost\:3306/druid \
  29.     -Ddruid.metadata.storage.connector.user=${DRUID_MYSQL_USER} \
  30.     -Ddruid.metadata.storage.connector.password=${DRUID_MYSQL_PSWD} \
  31.     -Ddruid.extensions.loadList=[\"mysql-metadata-storage\",\"druid-s3-extensions\"] \
  32.     -Ddruid.storage.type=s3 \
  33.     -Ddruid.s3.accessKey=${HADOOP_AWS_ACCESS_KEY_ID} \
  34.     -Ddruid.s3.secretKey=${HADOOP_AWS_SECRET_ACCESS_KEY} \
  35.     -Ddruid.storage.bucket=${S3_BUCKET} \
  36.     -Ddruid.storage.baseKey=${S3_PATH} \
  37.     -Ddruid.storage.maxListingLength=1000 \
  38.     -cp . io.druid.cli.Main tools insert-segment-to-db --workingDir ${S3_PATH} --updateDescriptor false
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top