Support Questions

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

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

avatar
Rising Star
 
1 ACCEPTED SOLUTION

avatar

@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

avatar
Master Mentor
@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 ~]#

avatar
Master Mentor

avatar
Rising Star

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

avatar
Master Mentor
@kkane

I see.. @Paul Codding answered it

avatar

@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)
+

avatar
Rising Star

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

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

avatar

Correct Kris