Quantcast
Channel: Hortonworks » All Replies
Viewing all articles
Browse latest Browse all 3435

Reply To: Ambari server upgrade 1.7 > 2.0.1 fails

$
0
0

Slackers! I had to figure it out myself…

Ok, I put on the thinking cap and realized that the ALTER operations were failing due to duplicates in that table. Now to find and remove the duplicates and get the upgrade done;

su – postgres
psql -d ambari
SET search_path TO ambari;
\dt
delete from hosts where ctid not in (select max(ctid) from hosts group by hosts.*);
delete from hoststate where ctid not in (select max(ctid) from hoststate group by hoststate.*);
delete from clusterhostmapping where ctid not in (select max(ctid) from clusterhostmapping group by clusterhostmapping.*);
delete from hostcomponentstate where ctid not in (select max(ctid) from hostcomponentstate group by hostcomponentstate.*);
delete from hostcomponentdesiredstate where ctid not in (select max(ctid) from hostcomponentdesiredstategroup by hostcomponentdesiredstate.*);

## you can do the same from * or other methods but those kinda scared the heck out of me. Oh, be sure to pg_dump to backup before doing any of this.

The result was a solid win

ambari-server upgrade
Using python /usr/bin/python2.6
Upgrading ambari-server
Updating properties in ambari.properties …
Fixing database objects owner
Upgrading database schema
Adjusting ambari-server permissions and ownership…
Ambari Server ‘upgrade’ completed successfully.


Viewing all articles
Browse latest Browse all 3435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>