Upgrade Steps
The following steps have to be performed on the installed Ambari Server node.
Stop Infra-Solr Service
Stop the Infra-solr Service from the Ambari UI by navigate to Ambari > Infra Solr > Actions > Stop.

Stop Ambari Server and Agents
Stop the Ambari server and agents by running the following command.
ambari-server stopambari-agent stopConfiguration Backup
Take a backup of the Ambari-server configs.
cp -r /etc/ambari-server/config /etc/ambari-server/conf_bkpBack up Ambari Database
mysqldump --databases ambari > /tmp/ambari-server_db_bckp/ambari_mysql_bckp.sqlErase the Ambari Server
For RHEL:
yum erase ambari-server -yFor Ubuntu:
apt remove ambari-server -yAdd Ambari Repo on Cluster Nodes
Back up the Old Ambari Repository
For RHEL:
mv /etc/yum.repos.d/ambari.repo /tmp/For Ubuntu:
mv /etc/apt/sources.list.d/ambari.list /tmp/Update the Repository Files
Retrieve the latest Ambari repository details from Ambari Repositories and add it to all the cluster nodes.
Update ambari.repo (RedHat) or ambari.list (Ubuntu).
For RHEL:
vim /etc/yum.repos.d/ambari.repo[ambari]async = 1baseurl = https://mirror.odp.acceldata.dev/ODP/rhel/Ambari-2.7.9.1-1/gpgcheck = 0name = ambari Version - ambari-2.7.9.1-1For Ubuntu:
vim /etc/apt/sources.list.d/ambari.listdeb https://mirror.odp.acceldata.dev/ODP/ubuntu20/Ambari-2.7.9.1-1/ ODP main deb https://mirror.odp.acceldata.dev/ODP/ubuntu20/Ambari-2.7.9.1-1/ ODP-UTILS mainList the New Packages
Verify the latest Ambari package for the version - 2.7.9.1-1.
For RHEL:
yum clean allyum list ambari-*For Ubuntu 20:
apt clean allapt list ambari-*Install the Updated Ambari Packages
For RHEL:
yum clean allyum install ambari-server -yFor Ubuntu:
apt cleanapt install ambari-server -yRestore the Configuration Files
Copy ambari.properties and password.dat to /etc/ambari-server/conf/.
Once the installation is successful, make sure to set up the following versions.
Set up Java 11
Make sure to install and update the default Java version as 11 on all the cluster nodes.
For RHEL:
yum install java-11-openjdk.x86_64yum install java-11-openjdk-devel.x86_64For Ubuntu:
apt-get install openjdk-11-jdk openjdk-11-jdk-headlessEnsure not to remove the jdk8 packages at this state.
update-alternatives --config javaThere are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status------------------------------------------------------------* 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode 1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual modePress <enter> to keep the current choice[*], or type selection number: 1Set up Python 3.11
yum install python3.11Make sure to install and update the default Python version as 3.11 on all the cluster nodes.
update-alternatives --config pythonThere are 4 programs which provide 'python'. Selection Command-----------------------------------------------* 1 /usr/libexec/no-python 2 /usr/bin/python3 3 /usr/bin/python2 + 4 /usr/bin/python3.11Enter to keep the current selection[+], or type selection number: 4Update JSVC
Make sure to Instal the latest version of the bigtop-jsvc-1.2.4 on all the cluster nodes.
For RHEL:
yum install bigtop-jsvc* -yFor Ubuntu:
apt install bigtop-jsvcRestore Config Files
Restore the ambari.properties and password.dat files, which are backed-up at this step: Configuration Backup.
Restore ambari.properties file
cp /etc/ambari-server/conf_bkp/ambari.properties /etc/ambari-server/conf/Please override the file by prompting 'y'.
Restore password.dat file
cp /etc/ambari-server/conf_bkp/password.dat /etc/ambari-server/conf/Update the java.home and Stack.java.home
In this case, set JAVA_HOME to /usr/lib/jvm/java-11-openjdk
File path - /etc/ambari-server/conf/ambari.properties | grep -i java.home
java.home=/usr/lib/jvm/java-11-openjdkstack.java.home=/usr/lib/jvm/java-11-openjdkUpgrade the Ambari Server Database Schema
ambari-server upgrade -vUpon running the command, the response will be as shown in the screenshot.
Make sure to take the database backup as mentioned earlier and enter 'y' here.

Start the Ambari Server
Once started, you are able to access the Ambari UI using the same url as it was earlier.
ambari-server startAccess the Ambari UI
Use your browser to access the Ambari UI.
Check the Upgraded Version
To verify the upgraded Ambari version, navigate to Admin → About in the top-right corner of the Ambari UI.

All the services also must be working normally without any downtime.

Installing Mpacks and Restoring Configurations
Follow the steps on the Guide for Management Packs page for installing mpacks and restoring configurations.
Known Issues
Pip dependency missing
Error:
[root@ce19 ~]# ambari-server upgradeUsing python /usr/bin/python3Upgrading ambari-serverTraceback (most recent call last): File "/usr/sbin/ambari-server.py", line 28, in <module> from ambari_commons.exceptions import FatalException, NonFatalException File "/usr/lib/ambari-server/lib/ambari_commons/init.py", line 21, in <module> from ambari_commons.os_check import OSCheck, OSConst File "/usr/lib/ambari-server/lib/ambari_commons/os_check.py", line 25, in <module> import distroModuleNotFoundError: No module named 'distro'Workaround:
pip3 install distroIf still hitting the distro module not found error, follow the below steps:
Step 1:
- Download the
get-pip.pyscript:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py- Install
pipfor Python 3.11:
/usr/bin/python3.11 get-pip.pyStep 2: Install the distro module using pip3.11
Once `pip` is installed for Python 3.11, you can now use it to install the missing `distro` module:
/usr/bin/python3.11 -m pip install distroStep 3: Verify the installation.
After installing the distro module, verify that it’s correctly installed:
/usr/bin/python3.11 -c "import distro"The ambari-server upgrade -v upgrade is successfully done.
Mpacks uninstallation not done
Traceback (most recent call last): File "/usr/lib/ambari-server/lib/ambari_simplejson/scanner.py", line 49, in _scan_once nextchar = string[idx]IndexError: string index out of rangeDuring handling of the above exception, another exception occurred:Traceback (most recent call last): File "/usr/sbin/ambari-server.py", line 1083, in <module> mainBody() File "/usr/sbin/ambari-server.py", line 1053, in mainBody main(options, args, parser) File "/usr/sbin/ambari-server.py", line 999, in main action_obj.execute() File "/usr/sbin/ambari-server.py", line 78, in execute self.fn(*self.args, **self.kwargs) File "/usr/lib/ambari-server/lib/ambari_server/serverUpgrade.py", line 262, in upgrade retcode = run_schema_upgrade(args) File "/usr/lib/ambari-server/lib/ambari_server/serverUpgrade.py", line 162, in run_schema_upgrade upgrade_response = json.loads(stdout) File "/usr/lib/ambari-server/lib/ambari_simplejson/init.py", line 538, in loads return _default_decoder.decode(s) File "/usr/lib/ambari-server/lib/ambari_simplejson/decoder.py", line 378, in decode obj, end = self.raw_decode(s) File "/usr/lib/ambari-server/lib/ambari_simplejson/decoder.py", line 408, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) File "/usr/lib/ambari-server/lib/ambari_simplejson/scanner.py", line 93, in scan_once return _scan_once(string, idx) File "/usr/lib/ambari-server/lib/ambari_simplejson/scanner.py", line 51, in _scan_once raise JSONDecodeError(errmsg, string, idx)ambari_simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)Workaround: Uninstall all the ambari-mpacks.
ambari-server uninstall-mpack --mpack-name=<installed mpack>