Set Up the Ambari Server
Before starting the Ambari Server, you must set up the Ambari Server. The setup configures Ambari to talk 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.
ambari-server setup
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, Ambari Server runs under
root
. Accept the default (n) at theCustomize user account for ambari-server daemon
prompt, 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 daemon
prompt, then provide a user name. - If you have not temporarily disabled iptables you may get a warning. Enter y to continue.
- Select a JDK version to download. Enter 1 to download Oracle JDK 1.8.
By default, Ambari Server setup downloads and installs Oracle JDK 1.8 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 deploy 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 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.
- Select n at
Enter advanced database configuration
to 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 host name, 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 host name, port, database name, user name, and password.
- At Proceed with configuring remote database connection properties [y/n] choose y.
- Setup completes.
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, Ambari Server setup downloads the Oracle JDK 1.8 binary and accompanying Java Cryptography Extension (JCE) Policy Files to /var/ lib/ambari-server/resources. 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 1.8. If you are using an alternate JDK, you must manually install the JDK on all hosts and specify the Java Home path during 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 | 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 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) | 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 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 for successful Ambari Server setup is shown below.
root@odp002:~# ambari-server setup
Using python /usr/bin/python
Setup ambari-server
Checking SELinux...
WARNING: Could not run /usr/sbin/sestatus: OK
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...
[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-8-openjdk-amd64
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): <IP_address>
Port (3306):
Database name (ambari): <ambari-db-name>
Username (ambari): <db-ambari-user-name>
Enter Database Password (password): <ambari-user-password>
Configuring ambari database...
Enter full path to custom jdbc driver: /usr/share/java/mysql-connector-j-8.0.32.jar
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.8.2-2.jar
....ambari-admin-2.7.8.2-2.jar
Ambari repo file doesn't contain latest json url, skipping repoinfos modification
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.
As shown above, Error extracting ambari-views-package-2.7.8.2-2.jar
can be ignored.