Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

where is the code about /var/lib/ambari-agent/data/command-1404.json in ambari custom service?

Highlighted

where is the code about /var/lib/ambari-agent/data/command-1404.json in ambari custom service?

New Contributor

I try to do ascould-i-manage-multiple-hbase-cluster-in-the-same, the "HBASE2" solution.

I have changed params.py, params_linux.py. When I install the regienserver, it always run by ''/usr/bin/yum -d 0 -e 0 -y install hbase_lv''.

I tracd the code about this. Found the argvs passed to hbaseregionserver.execute method includes a json file: `/var/lib/ambari-agent/data/command-1404.json`, and it contains a package_list filed.

I want to know where the pacakge_list comes from?

1 REPLY 1

Re: where is the code about /var/lib/ambari-agent/data/command-1404.json in ambari custom service?

Super Mentor

@will chen

Regarding your query: "I want to know where the pacakge_list comes from?"

.

Please check the following line of code:https://github.com/apache/ambari/blob/release-2.4.2/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py#L153-L154

It's simple Yum python APIs that are used to determine the 'package_list'

    import yum 
    yb = yum.YumBase()
    name_regex = re.escape(name).replace("\\?", ".").replace("\\*", ".*") + '$'
    regex = re.compile(name_regex)
    
    with suppress_stdout():
      package_list = yb.rpmdb.simplePkgList()

On your ambari installation you can find it in :

/usr/lib/ambari-server/lib/resource_management/core/providers/package/__init__.py

.

Don't have an account?
Coming from Hortonworks? Activate your account here