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

如何通过Cloudera Manager API永久禁用服务

How to Permanently Disable a Cloudera Service via API (Prevent Auto-Start on Restart)

Absolutely, you can pull this off with the Cloudera Manager (CM) API! The trick is adjusting a persistent service configuration that stops the service from automatically firing up after a CM or server restart. Here's a straightforward, step-by-step guide:

1. Find Your Target Service's ID

First, you need the unique identifier (name) of the service you want to disable. Run this API call to list all services in your cluster:

curl -u "your-cm-username:your-cm-password" "http://<cm-server-host>:7183/api/v40/clusters/<your-cluster-name>/services"

Scan the response for the name field of your target service (e.g., hbase, kafka, solr) — this is the ID you'll use in later commands.

2. Stop the Service (If It’s Running)

Before locking down auto-start, make sure the service is stopped:

curl -u "your-cm-username:your-cm-password" -X POST \
"http://<cm-server-host>:7183/api/v40/clusters/<your-cluster-name>/services/<service-id>/commands/stop"

Wait for the command to finish (you can check the service status via the API if you want to be thorough).

3. Disable Auto-Start Permanently

The key configuration here is service_auto_start — setting this to false guarantees the service won’t launch automatically when CM or the server restarts. Use this PUT request to update the service’s settings:

curl -u "your-cm-username:your-cm-password" -X PUT -H "Content-Type: application/json" \
"http://<cm-server-host>:7183/api/v40/clusters/<your-cluster-name>/services/<service-id>/config" \
-d '{
  "items": [
    {
      "name": "service_auto_start",
      "value": "false"
    }
  ]
}'

This change gets saved in CM’s database, so it’ll stick even through CM restarts, cluster reboots, or server power cycles.

4. Verify the Configuration (Optional)

To double-check the setting took effect, fetch the service’s current configuration:

curl -u "your-cm-username:your-cm-password" \
"http://<cm-server-host>:7183/api/v40/clusters/<your-cluster-name>/services/<service-id>/config?view=full"

Look for the service_auto_start entry to confirm it’s set to false.

Re-Enabling the Service Later

If you ever want to bring back auto-start functionality, just repeat step 3 but set "value": "true", then start the service with the start command.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.29 06:46:55