Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

"HiveServer2 Enable Impersonation" setting not available via the API

avatar
Contributor

Hi,

 

I'm using the API to change the "HiveServer2 Enable Impersonation" configuration setting of the Hive service. However the option is not accessbile through the API.

 

 Here's the setting in the webinterface:

 

Screen Shot 2016-07-21 at 13.43.00.png

 

 

 

I can change it just fine with the web interface and there I can see that it is desribed as "hive_server2_enable_impersonation" and "hive.server2.enable.doAs".

 

But when I try to change those values through the API it fails with:

 

{
  "message" : "Unknown configuration attribute 'hive_server2_enable_impersonation'."
}

 

 I am trying with:

curl -X PUT -H "Content-Type:application/json" -u admin:admin "http:/localhost:7180/api/v12/clusters/My_cluster/services/hive/config" -d '{ "items" : [ { "name" : "hive_server2_enable_impersonation", "value" : "false" } ] }'


curl -X PUT -H "Content-Type:application/json" -u admin:admin "http:/localhost:7180/api/v12/clusters/My_cluster/services/hive/config" -d '{ "items" : [ { "name" : "hive.server2.enable.doAs", "value" : "false" } ] }'

 

When I check the config json of the Hive service as returned by:

curl -X GET -H "Content-Type:application/json" -u admin:admin"http://localhost:7180/api/v12/clusters/My_cluster/services/hive/config?view=FULL"

 

I don't see any option to change this anywhere in the result.

 

What's going on here, isn't everything accesible through the API or was this setting just forgotten?

1 ACCEPTED SOLUTION

avatar
Master Guru

Hi... this is old, but just came across it.

 

hiveserver2_enable_impersonation is set at the HiveServer2 role level, so you would need to use the full path to your HiveServer2 role.  for instance:

 

curl -X PUT -H "Content-Type:application/json" -u admin:admin -k "https://localhost:7183/api/v12/clusters/cluster/services/hive/roles/hive-HIVESERVER2-609b6bea2fc852513192152e64d3ec19/config" -d '{ "items" : [ { "name" : "hiveserver2_enable_impersonation", "value" : "false" } ] }'

 

Since the attribute does not exist at the service level (where you attempted to set it), the attribute is not found.

 

I hope that might help you or others.

 

Cheers,

 

Ben

View solution in original post

1 REPLY 1

avatar
Master Guru

Hi... this is old, but just came across it.

 

hiveserver2_enable_impersonation is set at the HiveServer2 role level, so you would need to use the full path to your HiveServer2 role.  for instance:

 

curl -X PUT -H "Content-Type:application/json" -u admin:admin -k "https://localhost:7183/api/v12/clusters/cluster/services/hive/roles/hive-HIVESERVER2-609b6bea2fc852513192152e64d3ec19/config" -d '{ "items" : [ { "name" : "hiveserver2_enable_impersonation", "value" : "false" } ] }'

 

Since the attribute does not exist at the service level (where you attempted to set it), the attribute is not found.

 

I hope that might help you or others.

 

Cheers,

 

Ben