Help Center/ MapReduce Service/ User Guide (ME-Abu Dhabi Region)/ Troubleshooting/ Using Hive/ Connection Timeout During SQL Statement Execution on the Client
Updated on 2022-12-08 GMT+08:00

Connection Timeout During SQL Statement Execution on the Client

Symptom

The SQL statement fails to be executed on the client, and the error message "Timed out waiting for a free available connection" is displayed.

Possible Causes

A large number of DBService connections exist, and obtaining connections times out.

Procedure

  1. 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 the alarm is not cleared, go to 2.

  2. Log in to FusionInsight Manager, choose Cluster > Services > Hive > Configuration > All Configurations, search for javax.jdo.option.ConnectionURL, and check whether the value of the timeout parameter is less than 600.

    This parameter exists in Hive, HiveServer, MetaStore, and WebHCat. Ensure that the parameter values are the same.

    • If yes, go to 3.
    • If no, go to 7.

  3. Check whether the value of javax.jdo.option.ConnectionURL is ${javax.jdo.option.ConnectionURL.default}.

    • If yes, go to 4.
    • If no, change the timeout parameter in the URL to 600, click Save, and go to 7.

  4. Click Instance, select any HiveServer instance, and log in to the instance node as user root.
  5. Open the ${BIGDATA_HOME}/FusionInsight_Current/*HiveServer/etc/hivemetastore-site.xml configuration file, find the javax.jdo.option.ConnectionURL parameter, and copy its value.

  6. Log in to FusionInsight Manager, choose Cluster > Services > Hive > Configuration > 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.

    This parameter exists in Hive, HiveServer, MetaStore, and WebHCat. Ensure that the parameter values are the same.

  7. Choose Cluster > Services > Hive > Configuration > All Configurations, search for maxConnectionsPerPartition, and check whether its value is less than 100.

    • If yes, change the value to 100, click Save, and go to 8.
    • If no, go to 8.

  8. If parameters are modified in the preceding steps, choose Cluster > Services > Hive > Dashboard and choose More > Service Rolling Restart. If the parameters are not modified, skip this step.