Skip to main content
Version: 2.2.0

Apache Ambari Update

Prerequisites

Updating Apache Ambari

Package Repository

Carry out the following procedures on all Cluster machines to define a new package repository for Apache Ambari:

  • Access the directory where the Ambari package repository file (repo file) is located:

    Terminal input
    cd /etc/yum.repos.d/
  • Execute the command below to download the ambari.repo file and save it in the local directory /etc/yum.repos.d/, to be used by the YUM package manager.

    • Terminal input
      wget -O /etc/yum.repos.d/ambari.repo https://repo.tecnisys.com.br/repository/public/tdp/2.2.0/el-9-x86_64/ambari.repo
    • Terminal input
      curl -o /etc/yum.repos.d/ambari.repo https://repo.tecnisys.com.br/repository/public/tdp/2.2.0/el-9-x86_64/ambari.repo
    warning

    The commands suggested below overwrite the file /etc/yum.repos.d/ambari.repo, if it already exists in the directory. If necessary, perform a backup of the file with the current definitions first.

  • In the ambari.repo file, replace the USER and PASS variables, present in the URLs of the baseurl and gpgkey properties, respectively, with your user and password registered on the Site da Tecnisys . If using a local repository, adjust these URLs.

  • After defining the package repository of the new TDP version, we recommend updating the yum/dnf cache:

    Terminal input
        yum clean all; yum makecache fast;

Updating the Ambari Agent

With the new package repository defined, begin updating the Ambari Agent component.

warning

Communication between the Ambari Agent and the Ambari Server is suspended during the update. However, the services of other Cluster components continue to operate.

Figure 1 - Service situation during the Ambari Agent update
Figure 1 - Service situation during the Ambari Agent update

To update the Ambari Agent, perform the following procedure on all Cluster machines:

  • Stop the Ambari Agent service:

    Terminal input
        ambari-agent stop
  • Update the Ambari Agent binaries:

    Terminal input
        yum upgrade ambari-agent -y
    note

    Any customizations of the ambari-agent.ini file can be recovered from the backup file generated: ambari-agent.ini.old

  • Start the Ambari Agent service:

    Terminal input
        ambari-agent start

Updating the Ambari Server

After updating the Ambari Agent on all Cluster machines, proceed to update the Ambari Server.

warning

This operation requires stopping the Ambari Server service.

warning

It is recommended to perform a backup of the Ambari metadata database before starting this operation.

Carry out the following procedure only on the machine where the Ambari Server is installed:

  • Stop the Ambari Server service:

    Terminal input
        ambari-server stop
  • Update the Ambari Server binaries:

    Terminal input
        yum upgrade ambari-server -y
    Figure 2 - Updating the Ambari Server binaries
    Figure 2 - Updating the Ambari Server binaries
  • Update the Ambari Server metadata:

    Terminal input
        ambari-server upgrade
    note

    Basically, this command performs the following operations:

    • Adjustments of Ambari properties.
    • Update of the metadata database schema.
    • Verification of new versions of the TDP stack.
    Figure 3 - Ambari Server Upgrade
    Figure 3 - Ambari Server Upgrade
  • Start the Ambari Server:

    Terminal input
    ambari-server start
  • Check the new version of Ambari in the web interface by clicking on the user button, located at the top right of the page, and then on the About option.

    Figure 4 - Ambari Version
    Figure 4 - Ambari Version
  • Check the new version of the TDP stack in the web interface by clicking on the Stack and Versions option from the sidebar menu, and then on the VERSIONS tab.

    important

    If the alert "Host component out of sync" is displayed on the VERSIONS tab, perform the procedure defined in Updating the Current Stack Version to correct this inconsistency.

Updating the Current Stack Version

If the alert "Host component out of sync" is displayed when checking the versions of the TDP stack in the Ambari web interface, carry out the detailed procedure in this section to correct this occasional inconsistency between the current stack version and the information defined in the Ambari metadata database.

Figure 5 - Alert on the _VERSIONS_ tab
Figure 5 - Alert on the _VERSIONS_ tab
warning

This operation requires stopping the Ambari Server service.

warning

It is recommended to perform a backup of the Ambari metadata database before starting this operation.

Carry out the following procedure on the machine where the Ambari Server is installed:

  • Stop the Ambari Server:

    Terminal input
    ambari-server stop
  • Update the Ambari metadata database.

    If the metadata database is NOT on PostgreSQL, access the relevant database and execute the following command:

    Terminal input
        UPDATE ambari.host_version SET state = 'CURRENT' WHERE state!= 'CURRENT';

    If the metadata database is on PostgreSQL:

    Terminal input
        ambari server set current --cluster name <CLUSTER-NAME> --version display name TDP<VERSION>
    Figure 6 - Setting the current stack version
    Figure 6 - Setting the current stack version
    note

    Ensure that the CLUSTER-NAME and VERSION are correct by consulting the Stack and Versions page of the Ambari web interface.

  • Start the Ambari Server:

    Terminal input
    ambari-server start
  • Check if the inconsistency has been resolved by accessing the Ambari web interface, clicking on the Stack and Versions option from the sidebar menu, and then on the VERSIONS tab.

    Figure 7 - Inconsistency resolved
    Figure 7 - Inconsistency resolved