Limiting concurrent connections

To prevent a rogue application from repeatedly connecting to and monopolizing HiveServer, you can limit concurrent connections to HiveServer.

As administrator, you can limit concurrent connections using the Cloudera Manager Safety Valve to add one or more of the following properties to the hive-site.xml configuration file:

hive.server2.limit.connections.per.user
Maximum number of HiveServer concurrent connections per user
hive.server2.limit.connections.per.ipaddress
Maximum number of HiveServer concurrent connections per IP address
hive.server2.limit.connections.per.user.ipaddress
Maximum number of HiveServer concurrent connections per user and IP address combination

The default of each parameter is 0. You can change the value of each parameter to any number. You must configure concurrent connections on the server side; therefore, a hive --hiveconf command does not work.

In this task, limit the number of connections per user to 25.

  • The following components are running:
    • HiveServer
    • Hive Metastore
    • Hive client
  • Minimum Required Role: Configurator (also provided by Cluster Administrator, Full Administrator)
  1. In Cloudera Manager > Clusters select the Hive service. Click Configuration, and search for hive-site.xml.
  2. In HiveServer2 Advanced Configuration Snippet (Safety Valve) for hive-site.xml, click + and add the hive.server2.limit.connections.per.user property.
  3. Enter a value representing the maximum number of concurrent connections: for example 25.
  4. Click Save.
  5. Click Actions > Deploy Client Configuration.
  6. Restart HIVE.