Connection Timed Out During SQL Statement Execution on the Hive Client
Symptom
The Hive client fails to execute SQL statements, and error message "Timed out waiting for a free available connection" is displayed.
Cause Analysis
There are a large number of DBService connections, and obtaining the connections times out.
Procedure
- Check whether the client uses the Spark SQL client to execute SQL statements.
- If yes, check the timeout parameter in the URL, change the value to 600, and go to 7.
- If no, go to 2.
- Log in to Manager, choose Cluster > Services > Hive > Configurations > All Configurations, search for javax.jdo.option.ConnectionURL, and check whether the value of the timeout parameter is less than 600.Note
Hive, HiveServer, MetaStore, and WebHCat all have this parameter. Ensure that their parameter values are the same.
- Check whether the value of javax.jdo.option.ConnectionURL is ${javax.jdo.option.ConnectionURL.default}.
- Click Instance, select any HiveServer instance, and log in to the instance node as user root.
- Open the ${BIGDATA_HOME}/FusionInsight_Current/*HiveServer/etc/hivemetastore-site.xml configuration file, find the javax.jdo.option.ConnectionURL parameter, and copy its value.
- Log in to Manager, choose Cluster > Services > Hive > Configurations > All Configurations, search for javax.jdo.option.ConnectionURL, change its value to the URL copied in 5, change the timeout parameter to 600, and click Save.Note
Hive, HiveServer, MetaStore, and WebHCat all have this parameter. Ensure that their parameter values are the same.
- Choose Cluster > Services > Hive > Configurations > All Configurations, search for maxConnectionsPerPartition, and check whether its value is less than 100.
- If parameters are modified in the preceding steps, choose Cluster > Services > Hive > Dashboard, click More, and select Service Rolling Restart. If no parameters are modified, skip this step.
Parent topic: Using Hive
- Symptom
- Cause Analysis
- Procedure