Created
April 27, 2015 14:44
-
-
Save wesfloyd/9001a65f5cdaf134352d to your computer and use it in GitHub Desktop.
Sample script used to Probe HS2 service for availability
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
import sys | |
import subprocess | |
from subprocess import call | |
################################################### | |
# Edit the variables below to match your environment | |
################################################### | |
hs2Host = 'localhost' | |
hs2Port = '10000' | |
userName = 'root' | |
################################################### | |
beelineArgs = ['beeline', '-u', 'jdbc:hive2://'+ hs2Host + ':' + hs2Port , '-n' , userName , '-e' , 'show tables' ]; | |
cmd_out, cmd_err = subprocess.Popen(beelineArgs, stdout=subprocess.PIPE).communicate() | |
if cmd_out: | |
print 'cmd_out\n' + cmd_out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment