Help Center/ MapReduce Service/ Troubleshooting/ Using Hive/ Insufficient Permissions to Execute the set role admin Command
Updated on 2022-09-14 GMT+08:00

Insufficient Permissions to Execute the set role admin Command

Symptom

When a user runs the following command:

set role admin

The following error is reported:

0: jdbc:hive2://192.168.42.26:21066/> set role admin;
Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. dmp_B doesn't belong to role admin (state=08S01,code=1)

Cause Analysis

The current user does not have the permissions of the admin role of Hive.

Solution

  1. Log in to Manager.

    • For versions earlier than MRS 3.x, go to 7.
    • For MRS 3.x or later, choose Cluster > Services > Hive. In the upper right corner of the Dashboard page, click More and check whether Enable Ranger is unavailable.
      • If yes, go to 2.
      • If no, go to 7.

  2. Choose Cluster > Services > Ranger and click RangerAdmin in the Basic Information area. The Ranger web UI is displayed.
  3. Click the username in the upper right corner, select Log Out to log out of the system, and log in to the system as user rangeradmin.
  4. On the homepage, click Settings and choose Roles.
  5. Click the role with Role Name set to admin. In the Users area, click Select User and select a username.
  6. Click Add Users, select Is Role Admin in the row where the username is located, and click Save.
  7. Choose System > Permission > Role and add a role with the Hive administrator permission.
  8. On FusionInsight Manager, choose System > Permission > User.
  9. In the Operation column of the user, click Modify.
  10. Bind a role that has the Hive administrator permissions to the user and click OK.