Support Questions

Find answers, ask questions, and share your expertise

List of Ambari Substitution Variables

Rising Star

Throughout Ambari there are various substitution variables that get populated with values from the cluster. Some examples can be found under the knox configuration below. Where is there a list of the available variables? Or some way to determine what variables are available.

<service>
    <role>HIVE</role>
    <url>https://{{hive_server_host}}:{{hive_http_port}}/{{hive_http_path}}</url>
</service>

1 REPLY 1

Super Mentor

@Shawn Weeks


There is not list maintained for those properties. The values are dynamically determined from the configs. Every service provides certain configs and the "params_linux.py" reads those parameter values. Which can be found inside the following directory.

/var/lib/ambari-server/resources/common-services/$SERVICE_NAME/x.x.x.x/package/scripts


Example:

# find /var/lib/ambari-server/resources/common-services -name "params_linux.py" | xargs grep -i "hive_server_host"


/var/lib/ambari-server/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py:hive_server_hosts
 = default("/clusterHostInfo/hive_server_host", None)
/var/lib/ambari-server/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py:if
 type(hive_server_hosts) is list:
/var/lib/ambari-server/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py:
  hive_server_host = hive_server_hosts[0]
/var/lib/ambari-server/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py:
  hive_server_host = hive_server_hosts


/var/lib/ambari-server/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py:hive_server_host
 =  default("/clusterHostInfo/hive_server_host", [])
/var/lib/ambari-server/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py:has_hive_server_host
 = not len(hive_server_host)  == 0


/var/lib/ambari-server/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py:hive_server_hosts
 = default("/clusterHostInfo/hive_server_host", [])
/var/lib/ambari-server/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py:hive_server_host
 = hive_server_hosts[0] if len(hive_server_hosts) > 0 else None
/var/lib/ambari-server/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py:hive_url
 = format("jdbc:hive2://{hive_server_host}:{hive_server_port}")
/var/lib/ambari-server/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py:elif
 status_params.role == "HIVE_SERVER" and hive_server_hosts is not None 
and hostname in hive_server_host:
/var/lib/ambari-server/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py:if
 len(hive_server_hosts) == 0 and len(hive_server_interactive_hosts) >
 0:



Example:

hive_http_port = default('/configurations/hive-site/hive.server2.thrift.http.port', "10001")
hive_http_path = default('/configurations/hive-site/hive.server2.thrift.http.path', "cliservice")
hive_server_hosts = default("/clusterHostInfo/hive_server_host", None)

.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.