You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何修改Ambari API将Hive View集群配置设为Custom选项

How to Switch Hive View to "Custom" Cluster Configuration via Ambari API (v2.5.2.0)

Hey there, I’ve dealt with this exact Ambari 2.5.x quirk before! The root issue with your current API request is that you’re missing the critical property that triggers the switch from "Local Cluster" to "Custom" mode in the Hive View settings.

The Key Fix: Add Cluster Mode Properties

To force the view to use the Custom configuration, you need to add two essential properties to the properties section of your payload:

  • cluster.config.mode: Set this to "CUSTOM" — this is the toggle that flips the radio button from Local to Custom
  • cluster.name: Specify your Ambari cluster name (you can grab this from the Ambari UI header, e.g., my-cluster)

Modified Curl Command

Here’s the updated API request with these properties included:

curl --user admin:admin -i -H 'X-Requested-By: ambari' -X PUT http://localhost:8080/api/v1/views/HIVE/versions/1.5.0/instances/AUTO_HIVE_INSTANCE --data '{ 
  "ViewInstanceInfo" : { 
    "description" : "This view instance is auto created when the Hive service is added to a cluster.", 
    "instance_name" : "AUTO_HIVE_INSTANCE", 
    "label" : "Hive View", 
    "view_name" : "HIVE", 
    "version" : "1.5.0", 
    "visible" : true, 
    "properties" : { 
      "cluster.config.mode": "CUSTOM",
      "cluster.name": "your-cluster-name",
      "hdfs.auth_to_local" : null, 
      "hdfs.umask-mode" : "022", 
      "hive.jdbc.url" : "jdbc:hive2://localhost:10000/", 
      "hive.ldap.configured" : "false", 
      "hive.metastore.warehouse.dir" : "/apps/hive/warehouse", 
      "hive.session.params" : "transportMode=binary;hive.server2.proxy.user=${username};user=admin;password=password;", 
      "jobs.dir" : "/user/admin/hive/jobs", 
      "scripts.dir" : "/user/admin/hive/scripts", 
      "scripts.settings.defaults-file" : "/user/admin/.${instanceName}.defaultSettings", 
      "webhdfs.auth" : "", 
      "webhdfs.url" : "webhdfs://localhost:50070", 
      "webhdfs.username" : "admin", 
      "yarn.ats.url" : "http://localhost:8188", 
      "yarn.resourcemanager.url" : "http://localhost:8088" 
    } 
  } 
}'

Why This Works

In Ambari 2.5.x, the cluster.config.mode property directly controls the view’s cluster configuration mode:

  • "LOCAL" (the default) keeps it locked to the "Local Cluster" option
  • "CUSTOM" switches it to the "Custom" radio button, enabling the manual cluster properties you’ve defined

Verification

After sending this updated request, log into your Ambari UI, navigate to the Hive View’s configuration page, and you should see the "Custom" option selected automatically.

内容的提问来源于stack exchange,提问作者HP.

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 06:47:43