Support Questions

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

How to query ambari internal variable?

avatar
Expert Contributor

Config_Type "ranger-hive-audit" /Config_Key "xasecure.audit.destination.db.jdbc.url" is defined as "{{audit_jdbc_url}}". Where can I find the value of {{audit_jdbc_url}} and how could I change it?

1 ACCEPTED SOLUTION

avatar

Whenever you see a property enclosed by {{ }} it means that the value is interpreted dynamically by reading params.py or params_linux.py

E.g., https://github.com/apache/ambari/blob/release-2.2.1-rc2/ambari-server/src/main/resources/common-serv... To change it, you can either modify params*.py to use different logic, edit the value in the Config tab of the UI from the Service Dashboard page, or use configs.sh to edit directly (which calls the API).

View solution in original post

4 REPLIES 4

avatar

Whenever you see a property enclosed by {{ }} it means that the value is interpreted dynamically by reading params.py or params_linux.py

E.g., https://github.com/apache/ambari/blob/release-2.2.1-rc2/ambari-server/src/main/resources/common-serv... To change it, you can either modify params*.py to use different logic, edit the value in the Config tab of the UI from the Service Dashboard page, or use configs.sh to edit directly (which calls the API).

avatar
Expert Contributor

Thanks. I wonder how Ranger plugins pick up the changes on Ranger. My understanding is that HDFS NN still looks at configuration files in /etc/hadoop/conf. Property xasecure.audit.destination.db.jdbc.url defined in Ranger HDFS NN plugin ranger-hdfs-audit.xml is not changed even though audit_jdbc_url has been changed. The xml file should be changed by Ambari once Ranger DB host is changed.

avatar

@Alejandro Fernandez does this work the same for Ranger 0.6.0 or is that specific to Ranger 0.4.0?

avatar
Super Collaborator

@wayne2chicago

You will need to make changes in multiple places to achieve this:

1. Change the code as pointed by @Alejandro Fernandez: link

2. Now to make this reflect for HDFS, you will need to make similar change at link

3. Same code snippet exists in all service's params_linux.py which supports Ranger. you will need to make changes in all such places.

4. You need to make sure the changes you did reaches to all ambari-agents on deployed cluster. So do these changes to the files at /var/lib/ambari-server/resources/* location on ambari-server host and finally restart ambari-server. This will push changes to all nodes on the cluster.

5 At this point changing Ranger DB host config via Ambari and restarting a HDFS component on a host via Ambari will change "xasecure.audit.destination.db.jdbc.url" in "ranger-hdfs-audit". Same applies for other ranger supported services.