<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question How to use config.py in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-use-config-py/m-p/227084#M188944</link>
    <description>&lt;P&gt;I'm trying to read (and later to set) some of hadoop configuration using configs.py but it fails and I'm unable to figure out what is wrong. &lt;/P&gt;&lt;P&gt;This is what I tried:&lt;/P&gt;&lt;PRE&gt;[root@hdptst55 ~]# /var/lib/ambari-server/resources/scripts/configs.py -a get -n host_group_1  -u admin -p admin -e yarn-site.xml -k yarn.nodemanager.resource.memory-mb
2018-02-15 16:51:43,771 ERROR File yarn-site.xml doesn't exist or you don't have permissions.
[root@hdptst55 ~]#

&lt;/PRE&gt;&lt;P&gt;The file and the parameters do exists:&lt;/P&gt;&lt;PRE&gt;[root@hdptst55 ~]# grep -a1 yarn.nodemanager.resource.memory-mb /etc/hadoop/conf/yarn-site.xml
    &amp;lt;property&amp;gt;
      &amp;lt;name&amp;gt;yarn.nodemanager.resource.memory-mb&amp;lt;/name&amp;gt;
      &amp;lt;value&amp;gt;5120&amp;lt;/value&amp;gt;
[root@hdptst55 ~]#
&lt;/PRE&gt;&lt;P&gt;What is wrong? Are there logs to this tool?&lt;/P&gt;&lt;P&gt;Were can I find some practical usage examples? &lt;/P&gt;</description>
    <pubDate>Fri, 16 Feb 2018 06:01:28 GMT</pubDate>
    <dc:creator>smp_yuval</dc:creator>
    <dc:date>2018-02-16T06:01:28Z</dc:date>
    <item>
      <title>How to use config.py</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-use-config-py/m-p/227084#M188944</link>
      <description>&lt;P&gt;I'm trying to read (and later to set) some of hadoop configuration using configs.py but it fails and I'm unable to figure out what is wrong. &lt;/P&gt;&lt;P&gt;This is what I tried:&lt;/P&gt;&lt;PRE&gt;[root@hdptst55 ~]# /var/lib/ambari-server/resources/scripts/configs.py -a get -n host_group_1  -u admin -p admin -e yarn-site.xml -k yarn.nodemanager.resource.memory-mb
2018-02-15 16:51:43,771 ERROR File yarn-site.xml doesn't exist or you don't have permissions.
[root@hdptst55 ~]#

&lt;/PRE&gt;&lt;P&gt;The file and the parameters do exists:&lt;/P&gt;&lt;PRE&gt;[root@hdptst55 ~]# grep -a1 yarn.nodemanager.resource.memory-mb /etc/hadoop/conf/yarn-site.xml
    &amp;lt;property&amp;gt;
      &amp;lt;name&amp;gt;yarn.nodemanager.resource.memory-mb&amp;lt;/name&amp;gt;
      &amp;lt;value&amp;gt;5120&amp;lt;/value&amp;gt;
[root@hdptst55 ~]#
&lt;/PRE&gt;&lt;P&gt;What is wrong? Are there logs to this tool?&lt;/P&gt;&lt;P&gt;Were can I find some practical usage examples? &lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 06:01:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-use-config-py/m-p/227084#M188944</guid>
      <dc:creator>smp_yuval</dc:creator>
      <dc:date>2018-02-16T06:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to use config.py</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-use-config-py/m-p/227085#M188945</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/62198/smpyuval.html" nodeid="62198"&gt;@Yuval Smp&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;First you will need to get the yarn-site config using "action=get" option as following:&lt;/P&gt;&lt;P&gt;From Ambari Server Host.  (Please replace the Cluster name with yours)&lt;/P&gt;&lt;PRE&gt;# /var/lib/ambari-server/resources/scripts/configs.py --user=admin --password=admin --port=8080 --action=get --host=localhost --cluster=plain_ambari --config-type=yarn-site --file=/tmp/yarn_site_payload.json&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;Example Output "--action=get"&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;#  /var/lib/ambari-server/resources/scripts/configs.py --user=admin --password=admin --port=8080 --action=get --host=localhost --cluster=plain_ambari --config-type=yarn-site --file=/tmp/yarn_site_payload.json

2018-02-15 22:27:09,474 INFO ### Performing "get" content:
2018-02-15 22:27:09,474 INFO ### to file "/tmp/yarn_site_payload.json"
2018-02-15 22:27:09,600 INFO ### on (Site:yarn-site, Tag:version1517274643601)&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Now you will see that there is a file created here "/tmp/yarn_site_payload.json" that you will need to edit based on your requirement and then push it back using "action=set" (suppose i changed &lt;STRONG&gt;"yarn.nodemanager.resource.memory-mb" default value "4608 to  "5120"&lt;/STRONG&gt; so i will edit this file and will post it back) as following:
&lt;/P&gt;&lt;PRE&gt;# /var/lib/ambari-server/resources/scripts/configs.py --user=admin --password=admin --port=8080 --action=set --host=localhost --cluster=plain_ambari --config-type=yarn-site --file=/tmp/yarn_site_payload.json&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Example output of  "--action=set"&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;#  /var/lib/ambari-server/resources/scripts/configs.py --user=admin --password=admin --port=8080 --action=set --host=localhost --cluster=plain_ambari --config-type=yarn-site --file=/tmp/yarn_site_payload.json

2018-02-15 22:29:38,568 INFO ### Performing "set":
2018-02-15 22:29:38,568 INFO ### from file /tmp/yarn_site_payload.json
2018-02-15 22:29:38,569 INFO ### PUTting file: "/tmp/yarn_site_payload.json"
2018-02-15 22:29:38,569 INFO ### PUTting json into: doSet_version1518733778569710.json
2018-02-15 22:29:38,719 INFO ### NEW Site:yarn-site, Tag:version1518733778569710&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Now you should be able to see the changes in the ambari UI. Ambari will show &lt;STRONG&gt;Restart required&lt;/STRONG&gt;. Once you restart the affected service you should see that it has updated your "yarn-site.xml" on the respective hosts.&lt;/P&gt;&lt;P&gt;.&lt;BR /&gt;&lt;A rel="user" href="https://community.cloudera.com/users/62198/smpyuval.html" nodeid="62198"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 06:35:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-use-config-py/m-p/227085#M188945</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2018-02-16T06:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to use config.py</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-use-config-py/m-p/227086#M188946</link>
      <description>&lt;P&gt;Thanks @&lt;A href="https://community.hortonworks.com/users/3418/jsensharma.html"&gt;Jay Kumar SenSharma&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;Playing with your reply I learned that "--host" is mandatory. In addition, I figured that I had a typo in one of the parameters (-e instead of -c) so it is better to write out the long format and not the abriviation...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 01:47:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-use-config-py/m-p/227086#M188946</guid>
      <dc:creator>smp_yuval</dc:creator>
      <dc:date>2018-02-20T01:47:38Z</dc:date>
    </item>
  </channel>
</rss>

