public String getDatabasePassword() {
    if (getPersistenceType() == PersistenceType.IN_MEMORY) {
      return JDBC_IN_MEMORY_PASSWORD;
    }
    String passwdProp = properties.getProperty(SERVER_JDBC_USER_PASSWD.getKey());
    String dbpasswd = null;
    boolean isPasswordAlias = false;
    if (CredentialProvider.isAliasString(passwdProp)) {
      dbpasswd = PasswordUtils.getInstance().readPasswordFromStore(passwdProp, this);
      isPasswordAlias =true;
    }

    if (dbpasswd != null) {
      return dbpasswd;
    } else if (isPasswordAlias) {
      LOG.error("Can't read db password from keystore. Please, check master key was set correctly.");
      throw new RuntimeException("Can't read db password from keystore. Please, check master key was set correctly.");
    } else {
      return PasswordUtils.getInstance().readPasswordFromFile(passwdProp, SERVER_JDBC_USER_PASSWD.getDefaultValue());
    }
  }
Check persistence type Ambari Server should use. Possible values:
in-memory - use in-memory Derby database to store data
local - use local Postgres instance
remote - use provided jdbc driver name and url to connect to database
ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java