Configuring Apache Hive
Also available as:
PDF

Limit 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 by adding 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. In this task, you use Apache Ambari to limit the number of concurrent connections per user. Alternatively, you can modify hive-site.xml from the file system. You must configure concurrent connections on the server side; therefore, a hive --hiveconf command does not work.

  • The following components are running:
    • Ambari
    • HiveServer
    • Hive Metastore
    • A database for the metastore, such as the default MySQL Server
    • Hive clients
  • You have a user name and password for connecting to Apache Hive.
  1. From the Ambari main navigation pane, select Hive and click CONFIGS.
  2. Click Advanced:
  3. Scroll down and expand Custom hive-site.
  4. Click Add Property > Key and enter a property name intuitive to limiting the number of concurrent connections: for example, hive.server2.limit.connections.per.user.
  5. Enter a value representing the maximum number of concurrent connections: for example, 25.
  6. In Property Type, select TEXT:
  7. Click Add.
  8. Click Save.
    In this example, connections are now limited to 25 per user.