Acceldata
ODP

Upgrade Ambari

Increase the NameNode Timeout Value

To ensure that Ambari requests to start the NameNode and does not timeout during an upgrade, you must configure the Ambari NameNode restart timeout parameter using upgrade.parameter.nn-restart.timeout in the /etc/ambari-server/conf/ambari.properties file on the Ambari Server host.

You may need to add the restart timeout parameter and value to the Ambari server host following a default installation. For a large cluster, you must add 50% to the usual time (in seconds) that is required to restart the NameNode.

For example, on the Ambari server, observe the time (in seconds) required to restart the active NameNode. If the time taken to restart the active NameNode is more than 10 minutes (600 seconds) and the cluster is large, then add the following parameter to the /etc/ambari-server/conf/ambari.properties file on the Ambari Server host.

parameter.upgrade.parameter.nn-restart.timeout=900
After adding or resetting the Ambari NameNode restart parameter, restart the Ambari server before upgrading it to a newer version using the below command.
ambari-server restart

Upgrade Ambari

Ensure the following prerequisites are met to upgrade to the latest Ambari.

  1. Prior to upgrading Ambari, it is essential to remove all custom management packs (mpacks) from the system. Keeping them during the upgrade process can lead to stack-related issues, as they are not compatible with our designated stack configuration.
  2. Stop Ambari server and Ambari agent using the following code:
ambari-server stop
ambari-agent stop
  1. Backup your database. It is recommended for safety to take backups of every database present in your stack.
## Sample DB backup
mkdir /tmp/backup/
mysqldump -u <your_username> -p<your_password> ambari > /tmp/backup/ambari_backup.sql
mysqldump -u <your_username> -p<your_password> hive > /tmp/backup/hive_backup.sql
mysqldump -u <your_username> -p<your_password> ranger > /tmp/backup/ranger_backup.sql
mysqldump -u <your_username> -p<your_password> rangerkms > /tmp/backup/rangerkms_backup.sql
mysqldump -u <your_username> -p<your_password> oozie > /tmp/backup/oozie_backup.sql
## If there are any other mpack DB's you can take a backup at this step
  1. Erase Ambari server and agent as shown in the code below:
##RedHat
yum erase ambari-server ambari-agent -y
##Ubuntu
apt remove ambari-server ambari-agent -y
  1. Update the ambari.repo file (RedHat) or ambari.list file (Ubuntu).
  2. Install the newly updated Ambari server and Ambari agent:
## Update ambari.repo file(Centos7)
yum clean all
yum install ambari-server ambari-agent -y
## Update ambari.list file(Ubuntu)
apt clean
apt install ambari-server ambari-agent -y
  1. Proceed with the Ambari setup and link your previously associated database (e.g., MySQL).
ambari-server setup
Using python /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is 'enabled'
SELinux mode is 'permissive'
WARNING: SELinux is set to 'permissive' mode and temporarily disabled.
OK to continue [y/n] (y)? y
Customize user account for ambari-server daemon [y/n] (n)? n
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Custom JDK
==============================================================================
Enter choice (1): 2
WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts.
WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts.
Path to JAVA_HOME: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.372.b07-1.el7_9.x86_64/jre
Validating JDK on Ambari Server...done.
Check JDK version for Ambari Server...
JDK version found: 8
Minimum JDK version is 8 for Ambari. Skipping to setup different JDK for Ambari Server.
Checking GPL software agreement...
GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? n
Completing setup...
Configuring database...
Enter advanced database configuration [y/n] (n)? y
Configuring database...
==============================================================================
Choose one of the following options:
[1] - PostgreSQL (Embedded)
[2] - Oracle
[3] - MySQL / MariaDB
[4] - PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere
[7] - BDB
==============================================================================
Enter choice (1): 3
Hostname (localhost):
Port (3306):
Database name (ambari): ambari_db
Username (ambari): ambari_user
Enter Database Password (bigdata):
Re-enter password:
Configuring ambari database...
Should ambari use existing default jdbc /usr/share/java/mysql-connector-java.jar [y/n] (y)? y
Configuring remote database connection properties...
WARNING: Before starting Ambari Server, you must run the following DDL directly from the database shell to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
Proceed with configuring remote database connection properties [y/n] (y)? y
Extracting system views...
.Error extracting ambari-views-package-2.7.6.0.0.jar
....
Ambari repo file doesn't contain latest json url, skipping repoinfos modification
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.
  1. Link mysql-connector and start Ambari server and agent:
ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar
ambari-server start && ambari-agent start