Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

downgrade procedure from ambari version 2.6.1.0 to lower version

Solved Go to solution

downgrade procedure from ambari version 2.6.1.0 to lower version

dear friends and colleges

I will happy to get procedure to downgrade ambari version 2.6.1.0 to lower version

we need to create new kit that support ambari downgrade

Michael-Bronson
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: downgrade procedure from ambari version 2.6.1.0 to lower version

Super Mentor

@Michael Bronson

Unlike "ambari-server upgrade" command , unfortunately there is no "downgrade" command available.

.

For Downgrading ambari all you need is to have the Database Dump of the previous version. (I mean if you want to downgrade to Ambari 2.5 then you should have the DB dump of the state where ambari server version was 2.5) AND "/etc/ambari-server/conf" and "/etc/ambari-agent/conf" directories backups, Sothat you do not need to configure SSL/LDAP/Kerberos ...etc setups again.

Backup the current config & DB: Please collect a latest ambari DB dump of the upgraded version (for safety) and keep a backup of "/etc/ambari-server/conf" and "/etc/ambari-agent/conf" directories.

.

Ambari server can be downgraded as following:

1. Stop the ambari-server

# ambari-server stop

2. Stop all the ambari-agents on all hosts.

# ambari-agent stop

3. Download the ambari.repo of the downgraded version on all agent hosts and ambari server host.

Example:

# wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.4.2.0/ambari.repo -O /etc/yum.repos.d/ambari.repo

4. Then take a backup of "/etc/ambari-server/conf" and "/etc/ambari-agent/conf" directories (for backup).

5. Erase the ambari Binaries from Ambari Server and Ambari Agent hosts like (basically cleaning up the Ambari Server and agent binaries)

yum remove ambari-server ambari-agent
rm -f /usr/sbin/ambari*
rm -f /usr/lib/python2.6/site-packages/ambari_commons
rm -f /usr/lib/python2.6/site-packages/ambari_server
rm -rf /usr/lib/python2.6/site-packages/resource_management
rm -rf /usr/lib/python2.6/site-packages/ambari_jinja2
rm -f /usr/lib/python2.7/site-packages/ambari_commons
rm -f /usr/lib/python2.7/site-packages/ambari_server
rm -rf /usr/lib/python2.7/site-packages/resource_management
rm -rf /usr/lib/python2.7/site-packages/ambari_jinja2
rm -rf /var/lib/ambari-server 
rm -rf /var/lib/ambari-agent/
rm -rf /usr/lib/ambari-agent/
rm -rf /usr/lib/ambari-server/

6. Perform yum cleanup

# yum clean all

7. Import the OLD Database Dump of previous ambari version to the Database. (for example ambari 2.4.2 DB dump)

# su postgres -c 'psql -c "drop database ambari" '
# su postgres -c 'psql -c "create database ambari" '
# su postgres -c 'psql -f ./ambari_old_242.sql  -d ambari'

8. Install ambari-server and ambari agents (agent on all hosts)

# yum install ambari-server ambari-agent -y          (On Ambari Server)
# yum install ambari-agent -y                        (On all cluster nodes)

9. Run the ambari setup to point to the same Database where we imported the old DB dump. (OR) restore the previously saved Ambari 2.4.2 "/etc/ambari-server/conf" and "/etc/ambari-agent/conf" directories backups.

# ambari-server setup --databasehost=standaloneambari1.example.com --databasename=ambari --databaseusername=ambari --postgresschema=ambari --databasepassword=bigdata --databaseport=5432 --database=postgres -s

10. Start ambari agents and ambari server.

# ambari-server start
# ambari-agent start

.

NOTE: If you have setup LDAP or Kerberos for ambari server then you will have to runt he ambari-server setup-security option manually or get the specific properties from the Upgraded configs. In case of SSL configuration you will need to have the old SSL keystore/certificates or will need to recreate that config. (OR) restore the previously saved Ambari 2.4.2 "/etc/ambari-server/conf" and "/etc/ambari-agent/conf" directories backups.

.

NOTE: these above steps will take care of Ambari Downgrade, Which is not recommended until unless there is no other option.

The above steps will just take care of Downgrading the ambari server, But it might cause a Ambari Metrics Collector Data loss (Because there is no standard way of downgrading the dependent components like Ambari Infra, Ambari Metrics Collector...)

So better do not downgrade until there is no other option.

.

View solution in original post

4 REPLIES 4
Highlighted

Re: downgrade procedure from ambari version 2.6.1.0 to lower version

Super Mentor

@Michael Bronson

Unlike "ambari-server upgrade" command , unfortunately there is no "downgrade" command available.

.

For Downgrading ambari all you need is to have the Database Dump of the previous version. (I mean if you want to downgrade to Ambari 2.5 then you should have the DB dump of the state where ambari server version was 2.5) AND "/etc/ambari-server/conf" and "/etc/ambari-agent/conf" directories backups, Sothat you do not need to configure SSL/LDAP/Kerberos ...etc setups again.

Backup the current config & DB: Please collect a latest ambari DB dump of the upgraded version (for safety) and keep a backup of "/etc/ambari-server/conf" and "/etc/ambari-agent/conf" directories.

.

Ambari server can be downgraded as following:

1. Stop the ambari-server

# ambari-server stop

2. Stop all the ambari-agents on all hosts.

# ambari-agent stop

3. Download the ambari.repo of the downgraded version on all agent hosts and ambari server host.

Example:

# wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.4.2.0/ambari.repo -O /etc/yum.repos.d/ambari.repo

4. Then take a backup of "/etc/ambari-server/conf" and "/etc/ambari-agent/conf" directories (for backup).

5. Erase the ambari Binaries from Ambari Server and Ambari Agent hosts like (basically cleaning up the Ambari Server and agent binaries)

yum remove ambari-server ambari-agent
rm -f /usr/sbin/ambari*
rm -f /usr/lib/python2.6/site-packages/ambari_commons
rm -f /usr/lib/python2.6/site-packages/ambari_server
rm -rf /usr/lib/python2.6/site-packages/resource_management
rm -rf /usr/lib/python2.6/site-packages/ambari_jinja2
rm -f /usr/lib/python2.7/site-packages/ambari_commons
rm -f /usr/lib/python2.7/site-packages/ambari_server
rm -rf /usr/lib/python2.7/site-packages/resource_management
rm -rf /usr/lib/python2.7/site-packages/ambari_jinja2
rm -rf /var/lib/ambari-server 
rm -rf /var/lib/ambari-agent/
rm -rf /usr/lib/ambari-agent/
rm -rf /usr/lib/ambari-server/

6. Perform yum cleanup

# yum clean all

7. Import the OLD Database Dump of previous ambari version to the Database. (for example ambari 2.4.2 DB dump)

# su postgres -c 'psql -c "drop database ambari" '
# su postgres -c 'psql -c "create database ambari" '
# su postgres -c 'psql -f ./ambari_old_242.sql  -d ambari'

8. Install ambari-server and ambari agents (agent on all hosts)

# yum install ambari-server ambari-agent -y          (On Ambari Server)
# yum install ambari-agent -y                        (On all cluster nodes)

9. Run the ambari setup to point to the same Database where we imported the old DB dump. (OR) restore the previously saved Ambari 2.4.2 "/etc/ambari-server/conf" and "/etc/ambari-agent/conf" directories backups.

# ambari-server setup --databasehost=standaloneambari1.example.com --databasename=ambari --databaseusername=ambari --postgresschema=ambari --databasepassword=bigdata --databaseport=5432 --database=postgres -s

10. Start ambari agents and ambari server.

# ambari-server start
# ambari-agent start

.

NOTE: If you have setup LDAP or Kerberos for ambari server then you will have to runt he ambari-server setup-security option manually or get the specific properties from the Upgraded configs. In case of SSL configuration you will need to have the old SSL keystore/certificates or will need to recreate that config. (OR) restore the previously saved Ambari 2.4.2 "/etc/ambari-server/conf" and "/etc/ambari-agent/conf" directories backups.

.

NOTE: these above steps will take care of Ambari Downgrade, Which is not recommended until unless there is no other option.

The above steps will just take care of Downgrading the ambari server, But it might cause a Ambari Metrics Collector Data loss (Because there is no standard way of downgrading the dependent components like Ambari Infra, Ambari Metrics Collector...)

So better do not downgrade until there is no other option.

.

View solution in original post

Highlighted

Re: downgrade procedure from ambari version 2.6.1.0 to lower version

regarding the - "Backup the current config & DB: Please collect a latest ambari DB dump of the upgraded version (for safety) and keep a backup of "/etc/ambari-server/conf" and "/etc/ambari-agent/conf" directories." , insted of that I use the barman tool its backup & restore , is it OK ?

Michael-Bronson
Highlighted

Re: downgrade procedure from ambari version 2.6.1.0 to lower version

Super Mentor

@Michael Bronson

Yes that should be fine.

Highlighted

Re: downgrade procedure from ambari version 2.6.1.0 to lower version

@Jay thank you so much

Michael-Bronson
Don't have an account?
Coming from Hortonworks? Activate your account here