Support Questions
Find answers, ask questions, and share your expertise

What does 'ambari-server setup -s' use to determine setup has already been executed?

Contributor
 
1 ACCEPTED SOLUTION

Accepted Solutions

Re: What does 'ambari-server setup -s' use to determine setup has already been executed?

@kkane - this is the Ambari JIRA that introduced the change: https://issues.apache.org/jira/browse/AMBARI-10270

A method was introduced that checks if the JDK name (jdk.name) and JDBC database (server.jdbc.database) properties are set to determine if setup has already been run:

+def check_setup_already_done():
+  properties = get_ambari_properties()
+  if properties == -1:
+    print_error_msg("Error getting ambari properties")
+    return -1
+
+  return properties.get_property(JDK_NAME_PROPERTY) and properties.get_property(JDBC_DATABASE_PROPERTY)
+

View solution in original post

7 REPLIES 7

Re: What does 'ambari-server setup -s' use to determine setup has already been executed?

@kkane

Please see this from my env

[root@phdns01 ~]# ambari-server setup -s

Using python /usr/bin/python2.6

Setup ambari-server

Nothing was done. Ambari Setup already performed and cannot re-run setup in silent mode. Use "ambari-server setup" command without -s option to change Ambari setup.

[root@phdns01 ~]#

Re: What does 'ambari-server setup -s' use to determine setup has already been executed?

Re: What does 'ambari-server setup -s' use to determine setup has already been executed?

Contributor

This is a result, not the reason why. The question is: What is setup using to determine this.

Re: What does 'ambari-server setup -s' use to determine setup has already been executed?

@kkane

I see.. @Paul Codding answered it

Re: What does 'ambari-server setup -s' use to determine setup has already been executed?

@kkane - this is the Ambari JIRA that introduced the change: https://issues.apache.org/jira/browse/AMBARI-10270

A method was introduced that checks if the JDK name (jdk.name) and JDBC database (server.jdbc.database) properties are set to determine if setup has already been run:

+def check_setup_already_done():
+  properties = get_ambari_properties()
+  if properties == -1:
+    print_error_msg("Error getting ambari properties")
+    return -1
+
+  return properties.get_property(JDK_NAME_PROPERTY) and properties.get_property(JDBC_DATABASE_PROPERTY)
+

View solution in original post

Re: What does 'ambari-server setup -s' use to determine setup has already been executed?

Contributor

Thanks Paul. These are read out of the /etc/ambari-server/conf/ambari.properties?

If so, I'll have to rearrange my Chef recipe.

Re: What does 'ambari-server setup -s' use to determine setup has already been executed?

Correct Kris