Set up the Ambari Server

Before starting the Ambari Server, you must set up the Ambari Server. The setup configures Ambari to communicate to the Ambari database, installs the JDK, and allows you to customize the user account the Ambari Server daemon will run as.

Run the following command on the Ambari server host to initiate the setup process. You may also append Setup Options to the command.


Run Ambari Server Setup

ambari-server setup -s \ -j /usr/lib/jvm/java-17-openjdk \ --ambari-java-home /usr/lib/jvm/java-17-openjdk \ --stack-java-home /usr/lib/jvm/java-17-openjdk \ --database=postgres \ --databasehost=localhost \ --databaseport=5432 \ --databasename=ambari \ --databaseusername=ambari \ --databasepassword=admin

Make sure to newly added Java home properties in setup command:

--ambari-java-home /usr/lib/jvm/java-17-openjdk --stack-java-home /usr/lib/jvm/java-17-openjdk
New Feature

Ambari 3.0.0 introduces three java.home values:

  • -j (java.home): The default Java home

  • --ambari-java-home (ambari.java.home): The dedicated Java home for the Ambari Server

Reference: (AMBARI-26238: Add Ambari Java Home configuration for JDK 17 in Ambari… by JiaLiangC · Pull Request #3891 · apache/ambari )

  • --stack-java-home (stack.java.home): Java home for ODP stack services


Respond to the Setup Prompt

  1. If you have not temporarily disabled SELinux, you may get a warning. Accept the default (y), and continue.

  2. By default, the Ambari Server runs under root. Accept the default (n) at the Customize user account for ambari-server daemon prompt, to proceed as root. If you want to create a different user to run the Ambari Server, or to assign a previously created user, select y at the Customize user account for ambari-server daemon prompt, then provide a user name.

  3. If you have not temporarily disabled iptables you may get a warning. Enter yto continue.

  4. Select a JDK version to download. Enter 1 to download Oracle JDK 17.

By default, the Ambari Server setup downloads and installs Oracle JDK 17 and the accompanying Java Cryptography Extension (JCE) Policy Files.

  1. To proceed with the default installation, accept the Oracle JDK license when prompted. You must accept this license to download the necessary JDK from Oracle. The JDK is installed during the deployment phase.

Alternatively, you can enter 2 to download a Custom JDK. If you choose Custom JDK, you must manually install the JDK on all hosts and specify the Java Home path.

Note To install OpenJDK, use the Custom option. Be prepared to provide the valid JAVA_HOME value to Ambari. We strongly recommend that you install the JDK packages consistently on all hosts.

  1. Review the GPL license agreement when prompted. To explicitly enable Ambari to download and install LZO data compression libraries, you must answer y. If you enter n, Ambari will not automatically install LZO on any new host in the cluster. In this case, you must ensure LZO is installed and configured appropriately. Without LZO being installed and configured, data compressed with LZO will not be readable. If you do not want Ambari to automatically download and install LZO, you must confirm your choice to proceed.

  2. Select n at Enter advanced database configuration to use the default, embedded PostgreSQL database for Ambari. The default PostgreSQL database name is ambari. The default user name and password are ambari/bigdata. Otherwise, to use an existing PostgreSQL, MySQL/MariaDB or Oracle database with Ambari, select y.

  • If you are using an existing PostgreSQL, MySQL/MariaDB, or Oracle database instance, use one of the following prompts:

Important

You must prepare an existing database instance, before running setup and entering advanced database configuration.

Using the Microsoft SQL Server or SQL Anywhere database options are not supported.

  • To use an existing Oracle instance, and select your own database name, user name, and password for that database, enter 2.

Select the database you want to use and provide any information requested at the prompts, including host name, port, Service Name or SID, user name, and password.

  • To use an existing MySQL/MariaDB database, and select your own database name, user name, and password for that database, enter 3.

Select the database you want to use and provide any information requested at the prompts, including hostname, port, database name, user name, and password.

  • To use an existing PostgreSQL database, and select your own database name, user name, and password for that database, enter 4.

Select the database you want to use and provide any information requested at the prompts, including hostname, port, database name, user name, and password.

  1. To proceed with configuring remote database connection properties [y/n] choose y.

  2. The setup is completed successfully.

Note If your host accesses the Internet through a proxy server, you must configure the Ambari Server to use this proxy server.


Setup Options

The following options are frequently used for Ambari Server setup.

Option

Description

-j (or --java-home)

Specifies the JAVA_HOME path to use on the Ambari Server and all hosts in the cluster. By default when you do not specify this option, the Ambari Server setup downloads the Oracle JDK 11 binary and accompanying Java Cryptography Extension (JCE) Policy Files to /var/ lib/ambari-server/resources. The Ambari Server then installs the JDK to /usr/jdk64.

Use this option when you plan to use a JDK other than the default Oracle JDK 11. If you are using an alternate JDK, you must manually install the JDK on all hosts and specify the Java Home path during the Ambari Server setup. If you plan to use Kerberos, you must also install the JCE on all hosts.

This path must be valid on all hosts. For example: ambari-server setup –j /usr/java/default

--jdbc-driver

This should be the path to the JDBC driver JAR file. Use this option to specify the location of the JDBC driver JAR and to make that JAR available to the Ambari Server for distribution to cluster hosts during configuration. Use this option with the --jdbc-db option to specify the database type.

--jdbc-db

Specifies the database type. Valid values are: [postgres]

-s (or --silent)

The setup runs silently. Accepts all the default prompt values, such as:

  • User account "root" for the ambari-server

  • Oracle 11 or 17 JDK (which is installed at /usr/jdk64). This can be overridden by adding the -j option and specifying an existing JDK path.

  • Embedded PostgreSQL for the Ambari DB (with database name "ambari")

Important

By choosing the silent setup option and by not overriding the JDK selection, Oracle JDK will be installed and you will be agreeing to the Oracle Binary Code License agreement.

Do not use this option if you do not agree to the license terms.

If the Ambari Server is behind a firewall, you must instruct the ambari-server setup command to use a proxy when downloading a JDK. To do so, define the http_proxy environment variable in the shell before running the setup command. For example:

export http_proxy=http://{username}: {password}@{proxyHost}:{proxyPort} ambari-server setup

where {username} and {password} are optional.

If you do not define the http_proxy environment variable in a firewalled environment, the Oracle JDK download will not succeed.

If you want to run the Ambari Server as non-root, you must run the setup in interactive mode. When prompted to customize the ambari-server user account, provide the account information. --enable-lzo-under-gpl-license| Use this option to download and install LZO compression, subject to the General Public License. -v (or --verbose) | Prints verbose info and warning messages to the console during Setup. -g (or --debug) | Prints debug info to the console during Setup.

Sample Output

The sample output for the successful Ambari Server setup is shown below.

Info

Ambari 3.0.0.0 onwards requires ambari-java-home to be specified as argument along with setup

[root@jdk11node ~]# ambari-server setup --ambari-java-home /usr/lib/jvm/java-17-openjdk Using python /usr/bin/python3.11 Setup ambari-server Checking SELinux... SELinux status is 'disabled' Customize user account for ambari-server daemon [y/n] (n)? y Enter user account for ambari-server daemon (root): Adjusting ambari-server permissions and ownership... Checking firewall status... Checking JDK... start setting AMBARI_JAVA_HOME for Ambari... WARNING: AMBARI_JAVA_HOME /usr/lib/jvm/java-17-openjdk 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. Setting AMBARI_JAVA_HOME for Ambari finished Do you want to change Oracle JDK [y/n] (n)? y [1] Open JDK 11 [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-17-openjdk Validating JDK on Ambari Server...done. 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)? 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 (3): 3 Hostname (localhost): Port (3306): Database name (ambari): Username (ambari): Enter Database Password (ambari): Configuring ambari database... 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)? Extracting system views... java_home_type--:JavaHomeType.AMBARI jdkPath--:/usr/lib/jvm/java-17-openjdk INFO: Selected JDK /usr/lib/jvm/java-17-openjdk .Error extracting ambari-views-package-3.0.0.1-1.jar .. Ambari repo file doesn't contain latest json url, skipping repoinfos modification Adjusting ambari-server permissions and ownership... Ambari Server 'setup' completed successfully.
Info

As shown above, Error extracting ambari-views-package-3.0.0.x-x.jar can be ignored.


Start Ambari Server

ambari-server start

Access Ambari Web UI at: <http://<IP_address>:8080



  Last updated