Guest User

Untitled

a guest
Oct 22nd, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ##########################################################
  4. ### Author: Puneetha Bagivalu Manjegowda
  5. ### Script to launch beeline shell with connection string and custom parameters
  6. ##########################################################
  7.  
  8.  
  9. ##########################################################
  10. #### Parameters ####
  11. HIVE_CONNECTION_STRING="jdbc:hive2://quickstart.cloudera:10000/default;"
  12. # If we have a secure connection then we can set 'ssl=true'. Ex: HIVE_CONNECTION_STRING="jdbc:hive2://quickstart.cloudera:10000/default;ssl=true"
  13. DEFAULT_CONFIGURATION_FILE="/home/cloudera/beeline_scripts/default_beeline_config.hql"
  14. ##########################################################
  15.  
  16. echo -n "Enter Username : "
  17. read username
  18. #echo "Username is :${username}"
  19.  
  20. echo -n "Enter the password : "
  21. read -s password
  22. #echo "Password is: ${password}"
  23.  
  24. echo ${password} > /tmp/${username}_beeline.dat
  25.  
  26. #Beeline only support plain text password in command line (or) as part of textfile.
  27. #Hence, we temporarily stored the password and remove it after 3 seconds.
  28. #Once you are logged in to Hive, you need that password file.
  29. nohup bash /home/cloudera/beeline_scripts/remove_pass.sh ${username} &>/dev/null &
  30.  
  31. beeline -u ${HIVE_CONNECTION_STRING} -n ${username} -w /tmp/${username}_beeline.dat --hivevar env_curr_pid=`echo $$` -i ${DEFAULT_CONFIGURATION_FILE}
Add Comment
Please, Sign In to add comment