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 Agent
ambari-agent startRun 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=adminMake 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-openjdkAmbari 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
- If you have not temporarily disabled SELinux, you may get a warning. Accept the default (y), and continue.
- By default, the Ambari Server runs under
root. Accept the default (n) at theCustomize user account for ambari-server daemonprompt, to proceed asroot. If you want to create a different user to run the Ambari Server, or to assign a previously created user, select y at theCustomize user account for ambari-server daemonprompt, then provide a user name. - If you have not temporarily disabled iptables you may get a warning. Enter
yto continue. - Select a JDK version to download. Enter
1to 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.
- 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.
- 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 entern, 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. - Select
natEnter advanced database configurationto use the default, embedded PostgreSQL database for Ambari. The default PostgreSQL database name isambari. The default user name and password areambari/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:
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.
- To proceed with configuring remote database connection properties [y/n] choose
y. - The setup is completed successfully.
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 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: |
| --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:
|
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.
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-openjdkUsing python /usr/bin/python3.11Setup ambari-serverChecking SELinux...SELinux status is 'disabled'Customize user account for ambari-server daemon [y/n] (n)? yEnter 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 hostsWARNING: 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 finishedDo you want to change Oracle JDK [y/n] (n)? y[1] Open JDK 11[2] Custom JDK==============================================================================Enter choice (1): 2WARNING: 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-openjdkValidating JDK on Ambari Server...done.Checking GPL software agreement...GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.htmlEnable 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# distributed with this work for additional information# regarding copyright ownership. The ASF licenses this file# to you under the Apache License, Version 2.0 (the# "License"); you may not use this file except in compliance# with the License. You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.##Wed Jan 14 01:36:17 IST 2026agent.package.install.task.timeout=1800agent.stack.retry.on_repo_unavailability=falseagent.stack.retry.tries=5agent.task.timeout=900agent.threadpool.size.max=25ambari-server.user=rootambari.java.home=/usr/lib/jvm/java-17-openjdkambari.python.wrap=ambari-python-wrapbootstrap.dir=/var/run/ambari-server/bootstrapbootstrap.script=/usr/lib/ambari-server/lib/ambari_server/bootstrap.pybootstrap.setup_agent.script=/usr/lib/ambari-server/lib/ambari_server/setupAgent.pyclient.threadpool.size.max=25common.services.path=/var/lib/ambari-server/resources/common-servicescustom.action.definitions=/var/lib/ambari-server/resources/custom_action_definitionsextensions.path=/var/lib/ambari-server/resources/extensionsgpl.license.accepted=falsehttp.cache-control=no-storehttp.charset=utf-8http.pragma=no-cachehttp.strict-transport-security=max-age=31536000/pathConfiguring 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): 3Hostname (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.sqlProceed with configuring remote database connection properties [y/n] (y)?Extracting system views...java_home_type--:JavaHomeType.AMBARIjdkPath--:/usr/lib/jvm/java-17-openjdkINFO: Selected JDK /usr/lib/jvm/java-17-openjdk.Error extracting ambari-views-package-3.0.0.0-1.jar..Ambari repo file doesn't contain latest json url, skipping repoinfos modificationAdjusting ambari-server permissions and ownership...Ambari Server 'setup' completed successfully.As shown above, Error extracting ambari-views-package-3.0.0.0-x.jar can be ignored.
Start Ambari Server
ambari-server startAccess Ambari Web UI at: <http://<IP_address>:8080