Help Center/ MapReduce Service/ Component Operation Guide (LTS)/ Using Hive/ Enterprise-Class Enhancements of Hive/ Allowing Only the Hive Administrator to Create Databases and Tables in the Default Database
Updated on 2024-10-25 GMT+08:00

Allowing Only the Hive Administrator to Create Databases and Tables in the Default Database

Scenario

Only the Hive administrator can create databases and tables in the default database. Other users can use the databases only after being authorized by the Hive administrator.

  • After this function is enabled, common users are not allowed to create a database or create a table in the default database. Based on the actual application scenario, determine whether to enable this function.
  • Permissions of common users are restricted. In the scenario where common users have been used to perform operations, such as database creation, table script migration, and metadata recreation in an earlier version of database, the users can perform such operations on the database in the condition that this function is disabled temporarily after the database is migrated or after the cluster is upgraded.

Procedure

  1. Log in to FusionInsight Manager. Click Cluster, choose Services > Hive, click Configurations, and then All Configurations.
  2. Choose HiveServer(Role) > Customization, add a customized parameter to the hive-site.xml parameter file, set Name to hive.allow.only.admin.create, and set Value to true.
  3. Click Save to save the configuration. Click Instances, select all Hive instances, choose More > Restart Instance, enter the password of the current user, and click OK to restart all Hive instances.
  4. Determine whether to enable this function on the Spark/Spark2x client.

    • If yes, go to 5.
    • If no, no further action is required.

  1. Choose SparkResource2x > Customization, add a customized parameter to the hive-site.xml parameter file, set Name to hive.allow.only.admin.create, and set Value to true. Then, choose JDBCServer2x > Customization and repeat the preceding operations to add the customized parameter.
  2. Click Save to save the configuration. Click Instances, select all Spark2x instances, choose More > Restart Instance, enter the password of the current user, and click OK to restart all instances.
  3. Download and install the Spark/Spark2x client again.