Goal:If drillbit gets hung, and queries may get stuck on that drillbit, this script can help you quickly do the health check for each drillbit.
Basically It will connect to each drillbit using JDBC and run a simple query.
If the script get stuck when connecting to one drillbit, we need to troubleshoot by collecting jstack output and drillbit.log.
Solution:Here is the source code for this script:
java -cp /opt/mapr/drill/drill-1.4.0/jars/jdbc-driver/drill-jdbc-all-1.4.0.jar:. HealthCheck <username> <password> <Initial_Host> <Drill_Port>Default values for username and password are: mapr/mapr
Default value for Initial_Host is : localhost
Default value for Drill_Port is: 31010
# java -cp /opt/mapr/drill/drill-1.4.0/jars/jdbc-driver/drill-jdbc-all-1.4.0.jar:. HealthCheck Step 1. Creating Drill Connection to : jdbc:drill:drillbit=localhost:31010 Step 2. Fetching all drillbits Connecting to v2.poc.com:31010 Successful! Connecting to v3.poc.com:31010 Successful! Connecting to v4.poc.com:31010 Successful! Connecting to v1.poc.com:31010 Successful!
Note: if this script gets stuck on one of the drillbits, before shutting down that drillbit, please remember to take jstack output for further RCA.
After shutting down that problematic drillbit, then re-run this script until every drillbit is working fine.