Support Questions

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

configs.sh not supported from 2.6.4 HDP version

avatar

hi all,

Until HDP version - 2.6.4 we can use the configs.sh as the following example

( in this example we print all variables that relevant to the config type - yarn-site )

cluster name - HDP

config type - yarn-site

ambari server - localhost

 /var/lib/ambari-server/resources/scripts/configs.sh get localhost HDP yarn-site
########## Performing 'GET' on (Site:yarn-site, Tag:version1512057597218)
"properties" : {
"hadoop.registry.rm.enabled" : "true",
.
.
.

from 2.6.4 version ( and include config.sh isn't supported )

/var/lib/ambari-server/resources/scripts/configs.py get localhost HDP yarn-site
Usage: configs.py [options]
configs.py: error: One of required options is not passed

so we using now the configs.py instead

but seems that flags in configs.sh not as in configs.py

what is the right syntax to use the configs.py in order to get all variable according to the config type as we do on configs.sh ?

 /var/lib/ambari-server/resources/scripts/configs.py get localhost HDP yarn-site
Usage: configs.py [options]
configs.py: error: One of required options is not passed
Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Master Mentor

@Michael Bronson

Here is a simple example of config.py:

# /var/lib/ambari-server/resources/scripts/configs.py --user=admin --password=admin --port=8080 --action=get --host=localhost --cluster=Sandbox --config-type=yarn-site

View solution in original post

6 REPLIES 6

avatar
Master Mentor

@Michael Bronson

Here is a simple example of config.py:

# /var/lib/ambari-server/resources/scripts/configs.py --user=admin --password=admin --port=8080 --action=get --host=localhost --cluster=Sandbox --config-type=yarn-site

avatar
Master Mentor

@Michael Bronson

Here is another example in which we are setting a property in cluster-env. Notice "-k" means Key and "-v" for value. Following command will set the Auto Start for Cluster services to true.

# /var/lib/ambari-server/resources/scripts/configs.py --user=admin --password=admin --port=8080 --action=set --host=localhost --cluster=Sandbox --config-type=cluster-env -k "recovery_enabled" -v "true"

.

avatar

@jay thank you , another little equation regrading that

in configs.sh in order to set new value we do that ( for example )

/var/lib/ambari-server/resources/scripts/configs.sh set localhost HDP yarn.timeline-service.recovery.enabled true

what is the syntax for configs.py?

Michael-Bronson

avatar
Master Mentor

@Michael Bronson

Yes we can set individual properties as well like following:

# /var/lib/ambari-server/resources/scripts/configs.py --user=admin --password=admin --port=8080 --action=set --host=localhost --cluster=Sandbox --config-type=yarn-site -k "yarn.timeline-service.recovery.enabled" -v "true"

.

avatar
New Contributor

@Jay Kumar SenSharma

Hi ,

I am trying to use this in my environment but fails. Its a kerberized environment and SSL enabled. "XXX" is where I replace the right values.

/var/lib/ambari-server/resources/scripts/configs.py --user=admin --password="XXXXXXXXX" --port=8442 --action=get --host="XXX"--cluster="XXX" --config-type=yarn-site 2018-11-14 10:58:36,163 INFO ### Performing "get" content: Traceback (most recent call last): File "/var/lib/ambari-server/resources/scripts/configs.py", line 364, in <module> sys.exit(main()) File "/var/lib/ambari-server/resources/scripts/configs.py", line 350, in main return get_properties(cluster, config_type, action_args, accessor) File "/var/lib/ambari-server/resources/scripts/configs.py", line 260, in get_properties get_config(cluster, config_type, accessor, output) File "/var/lib/ambari-server/resources/scripts/configs.py", line 212, in get_config properties, attributes = get_current_config(cluster, config_type, accessor) File "/var/lib/ambari-server/resources/scripts/configs.py", line 123, in get_current_config config_tag = get_config_tag(cluster, config_type, accessor) File "/var/lib/ambari-server/resources/scripts/configs.py", line 94, in get_config_tag response = accessor(DESIRED_CONFIGS_URL.format(cluster)) File "/var/lib/ambari-server/resources/scripts/configs.py", line 89, in do_request raise Exception('Problem with accessing api. Reason: {0}'.format(exc)) Exception: Problem with accessing api. Reason: ''

avatar

@Mayank Bhatt do add "--protocol https --port 8443" options if ambari is running on HTTPS.