Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Auto-Start Services from disable to enable ( in ambari GUI under ADMIN )

avatar

I want to enable the button - Auto-Start Services from disable to enable by API as described in picture2 (capture2), the default status is as described in picture1

* need to set the button to enable - in order to configure all the components as auto start


capture2.pngcapture1.png
Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Master Mentor

@uri ben-ari

Please try this.

Step1). On the ambari server host run the following command:

# /var/lib/ambari-server/resources/scripts/configs.sh -u admin -p admin -port 8080 get amb25101.example.com plain_ambari cluster-env  /tmp/cluster-env.txt

.

You should see the file "/tmp/cluster-env.txt" content something like following, NOTICE the "recovery_enabled" is set to "false" (that you need to make as "true")

"properties" : {
"agent_mounts_ignore_list" : "",
"alerts_repeat_tolerance" : "1",
"enable_external_ranger" : "false",
"fetch_nonlocal_groups" : "true",
"hide_yarn_memory_widget" : "false",
"ignore_bad_mounts" : "false",
"ignore_groupsusers_create" : "false",
"kerberos_domain" : "EXAMPLE.COM",
"manage_dirs_on_root" : "true",
"managed_hdfs_resource_property_names" : "",
"one_dir_per_partition" : "false",
"override_uid" : "true",
"recovery_enabled" : "false",
.
.
.

.

Step2). Now edit the file "/tmp/cluster-env.txt" and set the "recovery_enabled" : "true".

.

Step3). Now run the same config.sh command but this time instead of "get" use "set" to set the "recovery_enabled" is set to "true".

# /var/lib/ambari-server/resources/scripts/configs.sh -u admin -p admin -port 8080 set amb25101.example.com plain_ambari cluster-env  /tmp/cluster-env.txt

.

Step4). refresh the ambari ui and check again the "Auto Recobery Page"

.

Please Change the Following values in the config.sh command

Here in the above command please replace the ambari admin credentials
"amb25101.example.com" replace with your Ambari Server Hostname
"plain_ambari" with your ambari Cluster name.

.

View solution in original post

4 REPLIES 4

avatar
Master Mentor

@uri ben-ari

Please try this.

Step1). On the ambari server host run the following command:

# /var/lib/ambari-server/resources/scripts/configs.sh -u admin -p admin -port 8080 get amb25101.example.com plain_ambari cluster-env  /tmp/cluster-env.txt

.

You should see the file "/tmp/cluster-env.txt" content something like following, NOTICE the "recovery_enabled" is set to "false" (that you need to make as "true")

"properties" : {
"agent_mounts_ignore_list" : "",
"alerts_repeat_tolerance" : "1",
"enable_external_ranger" : "false",
"fetch_nonlocal_groups" : "true",
"hide_yarn_memory_widget" : "false",
"ignore_bad_mounts" : "false",
"ignore_groupsusers_create" : "false",
"kerberos_domain" : "EXAMPLE.COM",
"manage_dirs_on_root" : "true",
"managed_hdfs_resource_property_names" : "",
"one_dir_per_partition" : "false",
"override_uid" : "true",
"recovery_enabled" : "false",
.
.
.

.

Step2). Now edit the file "/tmp/cluster-env.txt" and set the "recovery_enabled" : "true".

.

Step3). Now run the same config.sh command but this time instead of "get" use "set" to set the "recovery_enabled" is set to "true".

# /var/lib/ambari-server/resources/scripts/configs.sh -u admin -p admin -port 8080 set amb25101.example.com plain_ambari cluster-env  /tmp/cluster-env.txt

.

Step4). refresh the ambari ui and check again the "Auto Recobery Page"

.

Please Change the Following values in the config.sh command

Here in the above command please replace the ambari admin credentials
"amb25101.example.com" replace with your Ambari Server Hostname
"plain_ambari" with your ambari Cluster name.

.

avatar

is it possible by API to check that button change from disable to enable ?

Michael-Bronson

avatar

when I run the first syntax ( step 1 ) I get - USERID=admin PASSWORD=admin PORT=:8080 [ERROR] "/tmp/cluster-env.txt" not found in server response. [ERROR] Output of `curl -k -s -u admin:admin "http://master.uns.com:8080/api/v1/clusters/cluster-env?fields=Clusters/desired_configs"` is: [ERROR] { "status" : 404, "message" : "The requested resource doesn't exist: Cluster not found, clusterName=cluster-env" }

Michael-Bronson

avatar
Master Mentor

@uri ben-ari

That error you will get only when you have not specified the "Cluster Name" aftaer the ambari server hostname in the config.sh command:

/var/lib/ambari-server/resources/scripts/configs.sh -u admin -p admin -port 8080 get amb25101.example.com plain_ambari cluster-env /tmp/cluster-env.txt

.