Tim Thorpe created AMBARI-24606:
-----------------------------------

             Summary: Deleting a service should do a better job of cleaning up 
the Ambari DB
                 Key: AMBARI-24606
                 URL: https://issues.apache.org/jira/browse/AMBARI-24606
             Project: Ambari
          Issue Type: Bug
          Components: ambari-server
    Affects Versions: 2.7.0
            Reporter: Tim Thorpe


When a service is deleted, there are artifacts that are left behind in the 
Ambari DB such as configuration versions.

These are no longer needed and can cause issues.

When restarting the ambari server, you will see the following error:
DB configs consistency check found warnings. See 
/var/log/ambari-server/ambari-server-check-database.log for more details.

/var/log/ambari-server/ambari-server-check-database.log:
2018-09-06 11:12:49,455  WARN - You have config(s): ... that is(are) not mapped 
(in serviceconfigmapping table) to any service!

You can use following command to cleanup the postgress database:

grep WARN /var/log/ambari-server/ambari-server-check-database.log | tail -n 1 | 
awk '\{print $8}'| sed 's/,/\n/g' | sed 's/-version/ version/g' | awk '\{printf 
"delete from clusterconfig WHERE type_name='\''%s'\'' AND 
version_tag='\''%s'\'';\n", $1, $2}' | psql -U ambari ambari

There are no REST API calls that can be used to clean up the unwanted 
configurations.

There are many defects related to this which are still opened:

https://issues.apache.org/jira/browse/AMBARI-18358

https://issues.apache.org/jira/browse/AMBARI-14624

https://issues.apache.org/jira/browse/AMBARI-19990

https://issues.apache.org/jira/browse/AMBARI-21269

https://issues.apache.org/jira/browse/AMBARI-12573

https://issues.apache.org/jira/browse/AMBARI-11713

 

I haven't verified whether all of the issues described are still valid or not.



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

Reply via email to