Ambari Upgrade
Ambari can be upgraded independently from the ODP stack.
1. Before You Start
- Review the Ambari release notes for your
ODPandAmbariversions to capture breaking changes. - Ensure you have administrative privileges on the Ambari Server host and every Ambari Agent host.
- Back up the Ambari Server database (
pg_dump,mysqldump, etc.) and copy/etc/ambari-server/conf/ambari.propertiessomewhere safe.
If /var/lib/ambari-server/ambari-env.sh was customized (heap size, JVM opts, and so on) you must restore those edits after the upgrade. The installer overwrites the file but keeps a .rpmsave copy.
2. Stop Ambari Services
- Place Ambari Metrics and Ambari Infra in Maintenance Mode, then stop both services.
- Stop Ambari Server on the Ambari Server host:
If systemd is not used:
systemctl stop ambari-serverambari-server stop - Stop Ambari Agent on every Agent host:
or
systemctl stop ambari-agentambari-agent stop
Running the Agent under systemd can terminate child processes during restarts. Consider the non-systemd service scripts if that behavior is undesirable.
3. Refresh the Clemlab Repositories
Download the updated repository descriptor from the repository catalog that matches your operating system and place it in the package-manager directory.
4. Install JDK 17 on Every Host
Ambari Server 2.8.1.0 requires JDK 17. Install it on all hosts before upgrading any Ambari package. You can keep JDK 8 installed in parallel.
Ubuntu 22/24
apt install -y openjdk-17-jdk
CentOS / RHEL / Rocky / AlmaLinux 7/8/9
dnf install -y java-17-openjdk java-17-openjdk-devel
A full migration to JDK 17 for the entire ODP stack is only supported on ODP 1.3+. Until then use the following order: install JDK 17, upgrade Ambari Server, point Ambari to JDK 17, restart Ambari, upgrade ODP ≥ 1.3, then switch the stack runtime to JDK 17.
5. Upgrade Ambari Packages
5.1 Ambari Server
Ubuntu 22/24
apt update -y
apt-get install --only-upgrade ambari-server
CentOS / RHEL / Rocky / AlmaLinux 7/8/9
yum upgrade -y ambari-server
Do not start Ambari Server yet. You must first reconfigure it with the dual-JDK setup described in the section 6 before touching metadata. Since Ambari 2.8.1.0 you can differentiate the stack JDK from the Ambari JDK (see the upstream change). A full JDK 17 runtime requires ODP ≥ 1.3.
5.2 Ambari Agent
Run on every Agent host.
Ubuntu 22/24
apt update -y
apt upgrade ambari-agent
CentOS / RHEL / Rocky / AlmaLinux 7/8/9
yum upgrade -y ambari-agent
5.3 Ambari Infra
Ubuntu 22/24
apt update -y
apt upgrade ambari-infra-solr ambari-infra-solr-client
CentOS / RHEL / Rocky / AlmaLinux 7/8
yum upgrade -y ambari-infra-solr ambari-infra-solr-client
5.4 Ambari Metrics
Ubuntu 22/24
apt update -y
apt upgrade ambari-metrics
CentOS / RHEL / Rocky / AlmaLinux 7/8
yum upgrade -y ambari-metrics
6. Point Ambari Server to JDK 17
Ambari Server can be configured with separate Java homes:
--java-home: the Java home distributed/used for stack components on cluster hosts.--ambari-java-home: the Java home used by the Ambari Server process itself.
Collect the database coordinates and the Java home paths before running the setup command. Example values:
- Database: Postgres on
admin01.dev01.hadoop.clemlab.com:5432 - Name:
ambari_db, userambari, passwordambari123%X - JDK 8 home:
/usr/lib/jvm/java-1.8.0-openjdk-amd64 - JDK 17 home:
/usr/lib/jvm/java-17-openjdk-amd64/
Validate that both JDKs are present and at the expected major version:
```bash
/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java -version 2>&1 | head -n 1
/usr/lib/jvm/java-17-openjdk-amd64/bin/java -version 2>&1 | head -n 1
You should see 1.8.0_... for the first command and 17.0... for the second.
ambari-server setup \
--java-home=/usr/lib/jvm/java-1.8.0-openjdk-amd64 \
--ambari-java-home=/usr/lib/jvm/java-17-openjdk-amd64/ \
--database=postgres \
--databasehost=admin01.dev01.hadoop.clemlab.com \
--databaseport=5432 \
--databasename=ambari_db \
--databaseusername=ambari \
--databasepassword='******'
7. Upgrade the Ambari Server Metadata
ambari-server upgrade
Upgrading ambari-server
INFO: Upgrade Ambari Server
INFO: Updating Ambari Server properties in ambari.properties ...
INFO: Updating Ambari Server properties in ambari-env.sh ...
INFO: Original file ambari-env.sh kept
WARNING: Original file krb5JAASLogin.conf kept
INFO: File krb5JAASLogin.conf updated.
INFO: Fixing database objects owner
Ambari Server configured for Postgres. Confirm you have made a backup of the Ambari Server database [y/n] (n)?
After acknowledging the database prompt (yes) you should see:
INFO: Upgrading database schema
INFO: Return code from schema upgrade command, retcode = 0
INFO: Console output from schema upgrade command:
INFO: {}
INFO: Schema upgrade completed
Adjusting ambari-server permissions and ownership...
Ambari repo file doesn't contain latest json url, skipping repoinfos modification
Ambari Server 'upgrade' completed successfully.
When the final line Ambari Server 'upgrade' completed successfully. appears, metadata is ready.
8. Starting services after the upgrade
Ambari Server
Only start Ambari Server after completing the JDK setup and metadata upgrade.
If you need to rerun the setup with your environment-specific values, do so now, then start the service:
systemctl start ambari-server
or
ambari-server start
Ambari Agent
ambari-agent start
Log into the Ambari UI (for example http://ambari.clemlab.com:8080 or https://ambari.clemlab.com:8442) and restart Ambari Infra and Ambari Metrics.
9. Update the Java Alternative (if needed)
Some distributions switch the default java alternative to JDK 17 automatically. ODP versions earlier than 1.3 still require JDK 8 as the default runtime, so reset it when necessary:
sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java