1. Upgrading to Ambari 2.0

Use this procedure to upgrade Ambari 1.4.1 through 1.7.0 to Ambari 2.0.0. If your current Ambari version is 1.4.1 or below, you must upgrade the Ambari Server version to 1.7.0 before upgrading to version 2.0.0. Upgrading Ambari version does not change the underlying HDP Stack being managed by Ambari.

Before Upgrading Ambari to 2.0.0, make sure that you perform the following actions:

  • You must have root, administrative, or root-equivalent authorization on the Ambari server host and all servers in the cluster.

  • You must know the location of the Nagios server before you begin the upgrade process.

  • You must know the location of the Ganglia server before you begin the upgrade process.

  • You must backup the Ambari Server database.

  • You must make a safe copy of the Ambari Server configuration file found at /etc/ambari-server/conf/ambari.properties.

  • Plan to remove Nagios and Ganglia from your cluster and replace with Ambari Alerts and Metrics. For more information, see Planning for Ambari Alerts and Metrics in Ambari 2.0.

  • If you have a Kerberos-enabled cluster, you must review Upgrading Ambari with Kerberos-Enabled Cluster and be prepared to perform post-upgrade steps required.

  • If you are using Ambari with Oracle, you must create an Ambari user in the Oracle database and grant that user all required permissions. Specifically, you must alter the Ambari database user and grant the SEQUENCE permission. For more information about creating users and granting required user permissions, see Using Ambari with Oracle.

  • If you plan to upgrade your HDP Stack, back up the configuration properties for your current Hadoop services. For more information about upgrading the Stack and locating the configuration files for your current services, see one of the following topics:

  1. Stop the Nagios and Ganglia services. In Ambari Web:

    • Browse to Services and select the Nagios service.

    • Use Service Actions to stop the Nagios service.

    • Wait for the Nagios service to stop.

    • Browse to Services and select the Ganglia service.

    • Use Service Actions to stop the Ganglia service.

    • Wait for the Ganglia service to stop.

  2. Stop the Ambari Server. On the Ambari Server host,

    ambari-server stop

  3. Stop all Ambari Agents. On each Ambari Agent host,

    ambari-agent stop

  4. Fetch the new Ambari repo and replace the old repository file with the new repository file on all hosts in your cluster.

    [Important]Important

    Check your current directory before you download the new repository file to make sure that there are no previous versions of the ambari.repo file. If you do not, and a previous version exists, the new download will be saved with a numeric extension, such as ambari.repo.1. Make sure that the version you copy is the new version.

    Select the repository appropriate for your environment from the following list:

    • For RHEL/CentOS 6/Oracle Linux 6:

      wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.0.0/ambari.repo -O /etc/yum.repos.d/ambari.repo
    • For SLES 11:

      wget -nv http://public-repo-1.hortonworks.com/ambari/suse11/2.x/updates/2.0.0/ambari.repo -O /etc/zypp/repos.d/ambari.repo
    • For Ubuntu 12:

      wget -nv http://public-repo-1.hortonworks.com/ambari/ubuntu12/2.x/updates/2.0.0/ambari.list -O /etc/apt/sources/list.d/ambari.list
    • For RHEL/CentOS 5/Oracle Linux 5: (DEPRECATED)

      wget -nv http://public-repo-1.hortonworks.com/ambari/centos5/2.x/updates/2.0.0/ambari.repo -O /etc/yum.repos.d/ambari.repo
    [Note]Note

    If your cluster does not have access to the Internet, set up a local repository with this data before you continue. See Using a Local Repository for more information.

    [Note]Note

    Ambari Server does not automatically turn off iptables. Check that your installation setup does not depend on iptables being disabled. After upgrading the server, you must either disable iptables manually or make sure that you have appropriate ports available on all cluster hosts. For more information about ports, see Configuring Network Port Numbers.

  5. Upgrade Ambari Server. On the Ambari Server host:

    • For RHEL/CentOS/Oracle Linux:

      yum clean all; yum upgrade ambari-server ambari-log4j

    • For SLES:

      zypper clean; zypper up ambari-server ambari-log4j

    • For Ubuntu:

      apt-get clean all; apt-get install ambari-server ambari-log4j

    [Important]Important

    When performing upgrade on SLES, you will see a message "There is an update candidate for 'ambari-server', but it is from different vendor. Use 'zypper install ambari-server-2.0.0-101.noarch' to install this candidate". You will need to to use yast to update the package, as follows:

    1. From the command line run: > yast.

      > yast

      You will see command line UI for YaST program.

    2. Choose Software > Software Management, then click the Enter button.

    3. In the Search Phrase field, enter ambari-server, then click the Enter button.

    4. On the right side you will see the search result ambari-server 2.0.0 . Click Actions, choose Update, then click the Enter button.

    5. Go to Accept, and click enter.

  6. Check for upgrade success by noting progress during the Ambari server installation process you started in Step 5.

    • As the process runs, the console displays output similar, although not identical, to the following:

      Setting up Upgrade Process
      Resolving Dependencies
      --> Running transaction check
      ---> Package ambari-log4j.noarch 0:1.7.0.169-1 will be updated ...
      ---> Package ambari-log4j.noarch 0:2.0.0.1129-1 will be an update ...
      ---> Package ambari-server.noarch 0:1.7.0-169 will be updated ...
      ---> Package ambari-log4j.noarch 0:2.0.0.1129 will be an update ...
    • If the upgrade fails, the console displays output similar to the following:

      Setting up Upgrade Process
      No Packages marked for Update
    • A successful upgrade displays the following output:

      Updated: ambari-log4j.noarch 0:2.0.0.111-1 ambari-server.noarch 0:2.0.0-111 Complete!
    [Note]Note

    Confirm there is only one ambari-server*.jar file in /usr/lib/ambari-server. If there is more than one JAR file with name ambari-server*.jar, move all JARs except ambari-server-2.0.0.*.jar to /tmp before proceeding with upgrade.

  7. On the Ambari Server host: If ambari-agent is also installed on this host, first run "yum upgrade ambari-agent" (or equivalent in other OS'es) Now, upgrade the server database schema by running,

    ambari-server upgrade

  8. Upgrade the Ambari Agent on each host. On each Ambari Agent host:

    • For RHEL/CentOS/Oracle Linux:

      yum upgrade ambari-agent ambari-log4j

    • For SLES:

      zypper up ambari-agent ambari-log4j

      [Note]Note

      Ignore the warning that begins with "There are some running programs that use files deleted by recent upgrade".

      [Important]Important

      When performing upgrade on SLES, you will see a message "There is an update candidate for 'ambari-agent', but it is from different vendor. Use 'zypper install ambari-agent-2.0.0-101.noarch' to install this candidate". You will need to to use yast to update the package, as follows:

      1. From the command line run: > yast

        > yast

        You will see command line UI for YaST program.

      2. Choose Software > Software Management, then click the Enter button.

      3. In the Search Phrase field, enter ambari-agent, then click the Enter button.

      4. On the right side you will see the search result ambari-agent 2.0.0 . Click Actions, choose Update, then click the Enter button.

      5. Go to Accept, and click enter.

    • For Ubuntu:

      apt-get update apt-get install ambari-agent ambari-log4j

  9. After the upgrade process completes, check each host to make sure the new 2.0.0 files have been installed:

    rpm -qa | grep ambari

  10. Start the Ambari Server. On the Ambari Server host:

    ambari-server start

  11. Start the Ambari Agents on all hosts. On each Ambari Agent host:

    ambari-agent start

  12. Open Ambari Web.

    Point your browser to http://<your.ambari.server>:8080

    where <your.ambari.server> is the name of your ambari server host. For example, c6401.ambari.apache.org.

    [Important]Important

    Refresh your browser so that it loads the new version of the Ambari Web code. If you have problems, clear your browser cache manually, then restart Ambari Server.

  13. Log in, using the Ambari administrator credentials that you have set up.

    For example, the default name/password is admin/admin.

  14. If you have customized logging properties, you will see a Restart indicator next to each service name after upgrading to Ambari 2.0.0.

    [Note]Note

    Restarting a service pushes the configuration properties displayed in Custom log4j.properties to each host running components for that service.

    To preserve any custom logging properties after upgrading, for each service:

    1. Replace default logging properties with your custom logging properties, using Service Configs > Custom log4j.properties.

    2. Restart all components in any services for which you have customized logging properties.

  15. Review the HDP-UTILS repository Base URL setting in Ambari.

    If you are upgrading from Ambari 1.6.1 or earlier, the HDP-UTILS repository Base URL is no longer set in the ambari.repo file.

    • If using HDP 2.2 Stack:

    • Browse to Ambari Web > Admin > Stack and Versions.

    • Click on the Versions tab.

    • You will see the current installed HDP Stack version displayed.

    • Click the Edit repositories icon in the upper-right of the version display and confirm the value of the HDP-UTILS repository Base URL is correct for your environment.

    • If you are using a local repository for HDP-UTILS, be sure to confirm the Base URL is correct for your locally hosted HDP-UTILS repository.

    • If using HDP 2.0 or 2.1 Stack:

    • Browse to Ambari Web > Admin > Stack and Versions.

    • Under the Services table, the current Base URL settings are displayed.

    • Confirm the value of the HDP-UTILS repository Base URL is correct for your environment or click the Edit button to modify the HDP-UTILS Base URL.

    • If you are using a local repository for HDP-UTILS, be sure to confirm the Base URL is correct for your locally hosted HDP-UTILS repository.

  16. If using HDP 2.2 Stack, you must get the cluster hosts to advertise the "current version". This can be done by restarting a master or slave component (such as a DataNode) on each host to have the host advertise it's version so Ambari can record the version. For example, in Ambari Web, navigate to the Hosts page and select any Host that has the DataNode component, then restart that DataNode component on that single host.

  17. If you have configured Ambari to authenticate against an external LDAP or Active Directory, review your Ambari LDAP authentication settings. You must re-run "ambari-server setup-ldap”. For more information, see Set Up LDAP or Active Directory Authentication.

  18. If you have configured your cluster for Hive or Oozie with an external database (Oracle, MySQL or PostgreSQL), you must re-run “ambari-server setup --jdbc-db and --jdbc-driver” to get the JDBC driver JAR file in place. For more information, see Using Non-Default Databases - Hive and Using Non-Default Databases - Oozie.

  19. Adjust your cluster for Ambari Alerts and Metrics. For more information, see Planning for Ambari Alerts and Metrics in Ambari 2.0.

  20. Adjust your cluster for Kerberos (if already enabled). For more information, see Upgrading Ambari with Kerberos-Enabled Cluster.