Installing the Ambari Agents Manually
If you lack SSH access to Ambari, you must manually install the Ambari agents.
About this task
For nodes that do not have passwordless SSH enabled for the Ambari Server, you need to install Ambari agents manually. Additionally, if you prefer to install the agents beforehand, manual installation of an Ambari agent is also an option. Follow the OS-specific instructions for each host within the cluster, based on the operating system family of your installation host.
Procedure
- Download the Ambari repository as mentioned in Installing Ambari.
- Install the Ambari agent manually.
Download the Ambari Repository
To install Ambari agents, first download the Ambari repository to a host in your cluster.
About this task
On a server host that has Internet access, use a command line editor to do the following steps.
Procedure
- Log in to your host as root.
- Download the Ambari repository file to a directory on your installation host.
- Confirm that the repository is configured by checking the repo list.
- Accept the warning about trusting the Acceldata GPG Key.
This key is automatically downloaded and used to validate the packages from Acceldata.
Install the Ambari Agents Manually
Install an Ambari Agent on each host in your Cluster.
About this task
On every host in your cluster, use a command line editor to do the following steps.
Procedure
- Install the Ambari Agent.
[RHEL8/9]
yum install ambari-agent
[Ubuntu/22]
apt-get install ambari-agent
- Using a text editor, configure the Ambari Agent by editing the ambari-agent.ini file. as shown in the following:
vi /etc/ambari-agent/conf/ambari-agent.ini
[server]
hostname=<your.ambari.server.hostname>
url_port=8440
secured_url_port=8441
- Start the agent on every host in your cluster.
ambari-agent start
The agent registers with the Server on start.
Understanding Service Users and Groups
Ambari creates Unix accounts for each service user and group during the cluster installation.
Each Hadoop service runs under the ownership of their respective Unix accounts. These accounts are known as service users. These service users belong to a special Unix group. "Smoke Test" is a service user dedicated specifically for running smoke tests on components during installation using the Services tab of the Ambari Web UI. You can also run service checks as the Smoke Test user on-demand after installation. You can customize any of these users and groups using the Misc tab during the Customize Services installation step.
Use the Skip Group Modifications option to not modify the Linux groups in the cluster. Choosing this option is typically required if your environment manages groups using LDAP and not on the local Linux machines.
If you choose to customize names, Ambari checks to see if these custom accounts already exist. If they do not exist, Ambari creates them. The default accounts are always created during installation whether or not custom accounts are specified. These default accounts are not used and can be removed post-install.
All new service user accounts, and any existing user accounts used as service users, must have a UID greater than or equal to 1000.
Default User Accounts
The Ambari Installation wizard creates default service user account names for each installed service.
Table 1: Default User Account Names for Services and Components
Service | Component | Default User Account |
---|---|---|
HBase | MasterServer RegionServer | hbase |
HDFS | NameNode SecondaryNameNode DataNode | hdfs |
Hive | Hive Metastore, HiveServer2 | hive |
HUE | HUE | hue |
Kafka | Kafka Broker | kafka |
Kafka3 | Kafka Broker | kafka |
Flink | Client, JobManager, TaskManager | flink |
MapReduce2 | HistoryServer | mapred |
Ranger | Ranger Admin, Ranger Usersync | ranger |
Ranger KMS | Ranger KMS Server | kms |
Spark | Livy Servers | livy |
Spark | Spark History Server | spark |
Tez | Tez clients | tez |
YARN | NodeManager ResourceManager | yarn |
ZooKeeper | ZooKeeper | zookeeper |
For all components, the Smoke Test user performs smoke tests against cluster services as part of the install process. It also can perform these on-demand, from the Ambari Web UI. The default user account for the smoke test user is ambari-qa.
Default Group Accounts
The Ambari Installation wizard creates default service group account names for each installed service.
Table 2: Default Group Account Names for Services and Components
Service | Components | Default Group Account |
---|---|---|
All | All | hadoop |
Ranger | Ranger Admin, Ranger Usersync | ranger |
Ranger KMS | Ranger KMS Server | kms |
Spark | Spark History Server | spark |
Setting Properties that Depend on Service or Group User Names
You must configure the service properties to match customized user and group names for each service.
About this task
Some property values must be set to match specific service or service group user names. You can set such property values using the Ambari Web UI, on the Advanced Configurations tab for the service.
Procedure
- Browse the Ambari Web UI > Services > Service.Name > Configs > Advanced > tabs.
- Set the property value.
If you have set up non-default, customized service user names for the HDFS service, you must edit the following properties in HDFS Settings: Advanced:
- dfs.permissions.superusergroup: The same as the HDFS username. The default is hdfs.
- dfs.cluster.administrators: A single space followed by the HDFS username.
If you have set up non-default, customized service user names for the HBase service, you must edit the following properties in HDFS Settings: Advanced:
dfs.block.local-path-access.user:- The HBase username. The default is hbase.
If you have set up non-default, customized service user names for the Hadoop group name, you must edit the following properties, in MapReduce Settings: Advanced:
- mapreduce.cluster.administrators: A single space followed by the Hadoop group name.
Configure a Custom Host Name
Before deploying components to a host, customize the hostname, if desired.
About this task
Do not customize the hostname of an Ambari Agent after components have already been deployed to that host. Customizing the hostname for the Ambari Agent results in a new agent being registered with the custom hostname, not the hostname of an existing agent being updated.
Procedure
- Edit the contents of the
/var/lib/ambari-agent/hostname.sh
script to return the hostname that you want the Ambari Agent to register with.
Make sure that you chmod
the script so it is executable by the user running the Ambari Agent. For most installations, 0755 is sufficient permission to use.
The following script can be used to have the Ambari Agent register with the c1r1. acceldata.local
host name.
echo 'c1r1. Acceldata.local'
- Configure the Ambari Agent to use this script, by editing the
/etc/ambari-agent/conf/ambari-agent.ini
using a text editor.
Add adding the following property to the [agent] section: host name_script=/var/lib/ambari-agent/host name.sh
In this case, the Ambari Agent uses the /var/lib/ambari-agent/host name.sh
script to determine the hostname that it uses to register with the Ambari Server.
- Restart the agent to ensure that it registers with the custom hostname.
ambari-agent restart
Moving the Ambari Server
Moving an existing Ambari Server to a new host requires installing a new Ambari Server and transferring data from the existing Ambari database to the new Ambari database.
About this task
This topic describes the high-level process for moving an Ambari Server with a default, PostgreSQL database. If your Ambari Server uses non-default databases, such as MySQL, Oracle, or an existing PostgreSQL instance, you must use backup, restore, and stop/start procedures specific to that database type.
Back up the Current Ambari Database
Creates a copy of the current Ambari database and meta info.
Procedure
- On the Ambari Server host, stop the original Ambari Server. ambari-server stop
- Create a directory to hold the database backups.
cd /tmp
mkdir dbdumps/
cd dbdumps/
- Create the database backups.
pg_dump -U [AMBARI_DB_USERNAME] -f ambari.sql
Password: [AMBARI_DB_PASSWORD]
Table 3: Database Dump Script Variables, Values, and Descriptions
Variable | Description | Default |
---|---|---|
[AMBARI_DB_USERNAME] | The database username. | ambari |
[AMBARI_DB_PASSWORD] | The database password. | bigdata |
- Create a backup of the Ambari Server meta info. ambari-server backup.
Update all the Ambari Agents
Remove existing certificates from each host and point each agent to the new Ambari server host.
Procedure
- On each agent host, stop the
agent. ambari-agent stop
. - Remove any existing agent certificates.
rm /var/lib/ambari- agent/keys/*
. - Using a text editor, edit
/etc/ambari-agent/conf/ambari-agent.ini
to point to the new host.
[server]
hostname={NEW_AMBARI_SERVER_FQDN}
url_port=8440
secured_url_port=8441
Install the new Ambari Server
Install a new Ambari server on the new host, drop the old Ambari database, and add a new Ambari database.
Procedure
- Install the new Ambari server on the new host.
yum install ambari-server
. - Execute the setup of the Ambari Server and configure it similarly to the original Ambari Server setup by running
ambari-server setup
. - Restart the PostgreSQL instance:
service postgresql restart
. - Open the PostgreSQL interactive terminal.
su - postgres
psql
- Using the interactive terminal, drop the Ambari database created by the new Ambari setup and install:
drop database Ambari
. - Check to make sure the databases have been dropped by executing
\l
.
No Ambari databases must appear in the list.
- Create a new Ambari database to hold the transferred data:
create database Ambari
- Exit the PostgreSQL interactive terminal
\q
.
Populate the new Ambari database
Add the saved, database backup to the new database.
Procedure
- Copy the saved data in
/tmp/dbdumps/ambari.sql
from the back up current Ambari Database to the new Ambari Server host. - Load the saved data into the new
database. psql -d ambari -f
/tmp/dbdumps/ambari.sql
Start the new Ambari Server and Agents
Procedure
- Start the new Server:
ambari- server start
. - On each Agent host, start the Ambari Agent:
ambari-agent start
. - Open the Ambari Web UI.
Point your browser to: [NEW_AMBARI_SERVER]:8080
Configuring the Network Port Numbers
The Ambari install wizard creates the default port number assignments for the Ambari Server and Ambari Agents which you can customize.
Ambari creates default port number assignments required to maintain communication between the Ambari Server, Ambari Agents, and Ambari Web. An Ambari Administrator can customize port number assignments for the Ambari Server and Ambari Agents.
Related Information
Configuring Ports
Default Network Port Numbers for Ambari
Reference information related to Ambari port default settings.
Table 7: Default Ports Information for Ambari Server and Ambari Agent Services
Service | Servers | Default Ports Used | Protocol | Description | Need End User Access? | Configuration Parameters |
---|---|---|---|---|---|---|
Ambari Server | Ambari Server host | 8080 | http | Interface to the Ambari Web UI and Ambari REST API | No | |
Ambari Server | Ambari Server host | 8440 | https | Handshake Port for Ambari Agents to Ambari Server | No | |
Ambari Server | Ambari Server host | 8441 | https | Registration and heartbeat Port for Ambari Agents to Ambari Server | No | |
Ambari Agent | All hosts running Ambari Agents | 8670 You can change the Ambari Agent ping port in the | tcp | Ping port used for alerts to check the health of the Ambari | No | |
Ambari Agent configuration. | Agent |
Change the Default Ambari Server Port
To change the default port number, 8080, the Ambari Server is used to access the Ambari Web UI and edit the Ambari properties file.
About this task
By default, the Ambari Server uses port 8080 to access the Ambari Web and the REST API. To change the port number, you must edit the Ambari properties file.
Before you begin
The Ambari Server must not be running when you change port numbers. Edit ambari.properties
before you start the Ambari Server the first time or stop the Ambari Server before editing properties.
Procedure
- On the Ambari Server host, open
/etc/ambari-server/conf/ambari.properties
with a text editor. - Add the client API port property and set it to your desired port value:
client.api.port=[PORT_NUMBER]
. - Start or restart the Ambari Server:
ambari-server start
.
http://[YOUR_AMBARI_SERVER_HOST]:[PORT_NUMBER]
Results
The Ambari Server now accesses the Ambari Web UI via the newly configured port.
Change the Default Ambari Server-agent Port
To change the default port number, 8187
, that the Ambari Server uses to access Ambari Agents, edit the Ambari properties file.
About this task
By default, Ambari Server uses port 8187 to communicate with Ambari Agents. To change the port number, you must edit the Ambari properties file.
Before you begin
Ambari Server should not be running when you change port numbers. Edit ambari.properties
before you start the Ambari Server the first time or stop the Ambari Server before editing properties.
Procedure
- On the Ambari Server host, open
/etc/ambari-server/conf/ambari.properties
with a text editor. - Add the following properties and set them to your desired port values:
SRVR_TWO_WAY_SSL_PORT_PROPERTY = "security.server.two_way_ssl.port" SRVR_TWO_WAY_SSL_PORT = "8441" SRVR_ONE_WAY_SSL_PORT_PROPERTY =
"security.server.one_way_ssl.port" SRVR_ONE_WAY_SSL_PORT = "8440"
- On every Ambari Agent host, open /
etc/ambari-agent/conf/ambari-agent.ini
with a text editor. - Add the following properties and set them to your desired port values:
url_port=8440 secured_url_port=8441
- Start or re-start the Ambari Server:
ambari-server start
.
http://[YOUR_AMBARI_SERVER_HOST]:[PORT_NUMBER]
Results
The Ambari Server accesses Ambari Agents via the newly configured port.