Rollback Ambari to 2.6.5

You must use the backup of Ambari 2.6.x to perform the following steps.

  1. Stop all services in Ambari UI.
  2. On the Ambari Server host, stop the Ambari Server.
    ambari-server stop
    Stop  Ambari Agent on all host
    ambari-agent stop
  3. Obtain Ambari Repositories:
    wget -nv 
    https://archive.cloudera.com/p/ambari/2.x/${your_ambari_version}/centos7/ambari.repo -O 
    /etc/yum.repos.d/ambari.repo
    yum clean all
  4. Downgrade ambari-server, ambari-agent packages manually using “yum downgrade <packagename>”
    yum  downgrade ambari-server
    yum  downgrade ambari-agent # on all hosts
  5. Reinitialize Ambari DB - Drop the old schema and initialize blank new schema :
    Example - Postgres
    psql -W -d ${AMBARI_DB_NAME} --user ${AMBARI_DB_USER}
    DROP SCHEMA ${AMBARI_DB_NAME} CASCADE;
    CREATE SCHEMA ambari;
    GRANT ALL ON SCHEMA ambari TO ambari;
    MYSQL
    mysql -u ${AMBARI_DB_USER} 
    drop database ${AMBARI_DB_NAME}; 
    create database ${AMBARI_DB_NAME};
  6. Populate the Ambari database with backup data:
    POSTGRES
    psql -W -d ${AMBARI_DB_NAME} --user ${AMBARI_DB_USER} < pre_upgrade.sql
    MYSQL
    mysql -u ${AMBARI_DB_USER} ${AMBARI_DB_NAME} < pre_upgrade.sql
  7. Clear views cache (it has views for 7.1 cached, some of which are not supported):
    rm -f /var/lib/ambari-server/resources/views/work/*
  8. Restore these files from the backup:
    /etc/ambari-server/conf/ambari.properties
    /etc/ambari-agent/conf/ambari-agent.ini
  9. Restore old stack symlinks on Agent nodes:
    hdp-select set all 2.6.5.0-292
  10. Check ambari-server user:
    grep ambari-server.user /etc/ambari-server/conf/ambari.properties
    If ambari-server is running as non-root user, set permissions for files by running: ambari-server setup
  11. Start Ambari