You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Vsevolod Ostapenko (JIRA)" <ji...@apache.org> on 2018/09/27 14:20:00 UTC

[jira] [Commented] (AMBARI-24701) Stop overwriting amabri.properties file in place

    [ https://issues.apache.org/jira/browse/AMBARI-24701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16630507#comment-16630507 ] 

Vsevolod Ostapenko commented on AMBARI-24701:
---------------------------------------------

It's not even clear why ambari.properties need to be overwritten on startup, when there is no changes to the configuration at all.

Even if there is a good reason for that, don't do it in place and keep a backup of a most recent incarnation of the properties file.

> Stop overwriting amabri.properties file in place
> ------------------------------------------------
>
>                 Key: AMBARI-24701
>                 URL: https://issues.apache.org/jira/browse/AMBARI-24701
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>    Affects Versions: 2.5.2
>         Environment: HDP 2.5.6, CentOS 7.2, Ambari 2.5.2
>            Reporter: Vsevolod Ostapenko
>            Priority: Major
>
> ambari.properties file is being overwritten in place on each server startup.
> If system looses power or is rebooted at exactly the moment the file is being overwritten, ambari.properties will have zero byte length on the next start, which would result in ambari server startup failure. Since file is being re-written in place, there is no backup or prior version and recovery from this condition can be rather tedious.
> When ambari.propties is of zero length, a bunch of other bugs are being triggered - first of all, there is no check that file is empty, second of all all the working directory names are set to either empty strings or None's, which manifests itself in error stack like below (even if all the working directories do actually exist):
> ambari-server status
> Using python /usr/bin/python
> Ambari-server status
> Traceback (most recent call last):
>  File "/usr/sbin/ambari-server.py", line 36, in <module>
>  from ambari_server.dbConfiguration import DATABASE_NAMES, LINUX_DBMS_KEYS_LIST
>  File "/usr/lib/python2.6/site-packages/ambari_server/dbConfiguration.py", line 28, in <module>
>  from ambari_server.serverConfiguration import decrypt_password_for_alias, get_ambari_properties, get_is_secure, \
>  File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 590, in <module>
>  configDefaults = ServerConfigDefaults()
>  File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 500, in __init__
>  super(ServerConfigDefaultsLinux, self).__init__()
>  File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 384, in __init__
>  self.check_if_directories_writable([self.OUT_DIR, self.PID_DIR])
>  File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 436, in check_if_directories_writable
>  raise FatalException(-1, "Unable to access \{0} directory. Confirm the directory is created and is writable by Ambari Server user account '\{1}'".format(directory, getpass.getuser()))
> ambari_commons.exceptions.FatalException: "Fatal exception: Unable to access directory. Confirm the directory is created and is writable by Ambari Server user account 'root', exit code -1"



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)