Ambari usage and tweaking

Changing the default web port

By default, the Ambari web GUI is listening on port 8080. It is really easy to change this port.
On the command line of your Ambari Server, you will just do that:
  1. Stop the Ambari server ( sudo ambari-server stop )
  2. Edit the file /etc/ambari-server/conf/
  3. Add the line client.api.port=<your port>
In a new installation, the above line is not yet present and you just have to add the line at the end of the file.
If someone already changed this setting, you will have the line already existing somewhere in the file.
  1. Start the Ambari server ( sudo ambari-server start )

Disabling transparent huge pages

In the process of adding a node to a cluster, you may get a warning asking you to disable the Transparent Huge Pages on your server(s). This is a Linux kernel feature enabling the use of very large memory page. When this can improve some specific applications dealing a lot with memory, it can have a negative performance impact on a Hadoop stack. This is why it is recommended to disable it.
The simplest way to do it can be to add the following lines to the /etc/rc.local file:
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
   echo never > /sys/kernel/mm/transparent_hugepage/enabled
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
   echo never > /sys/kernel/mm/transparent_hugepage/defrag
This way, the setting will be reapplied at each reboot, because by default the parameter is set on “always”, so it is enabled.
You can change this setting on the fly by doing:
Node1(admin):~ echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
Note the use of tee because you need to be root to write in the mentioned system file.

Some hints about the Ambari GUI usage.

Once you have a running cluster, you can expand it or shrink it with the help of various commands present in the Ambari GUI. Here is a summary of where to go to perform some common tasks.

Adding a new service

On the main dashboard, in the left column, you see the list of the services already installed on your cluster. By selecting the menu “Actions” below this list, you can add service that are not yet present in your cluster.
1.Add new service.PNG
Once you click on “+Add Service”, you will be brought to the same wizard you add when adding hosts for the first time to your cluster, starting at the point when you have to choose services.

Adding more instance of an already installed service

If you have an already installed and running service, but you want to make it run on more hosts of the cluster, thus adding more instances of it, you can do this from the host view.
You go to the “Hosts” page of Amabari and you select a host. On the host page, at the left, you have the list of services running on this host. On top of the frame, you have a “+Add” button that you can use to add an instance of an already installed service to this host.
6.add service nstance.PNG
The list will show you only the already installed services that can run on multiple hosts.

Actions on existing service

Go to the Service page of Ambari and on the right select the “Service Actions” menu. This gives you different management possibilities (start, stop, maintenance …) on the service selected in the left.
When a service or a host is put in maintenance, you won’t get any alerts if the service / host goes down.
You have also a view on some metrics about the service that you select at the left. And a “Config” tab giving you access to all the configuration parameters and value of the service configuration file(s).
2.Service actions.PNG

Add a new host

Go to the Hosts page of Ambari, you will see the full list of hosts present in your cluster. On top of this list, at the left, you have an “Actions” buttons that will propose you to “Add New Hosts”.
If you click on it, you will see the same wizard as the one you got when initializing the cluster for the first time. You need to give the name of the host, the SSH key, review some check results, add services, …
3.Add host.PNG

Actions on group of hosts

From the same page as above, in the same menu “Actions”, you can perform stop and start of components (service instances on a given host), reinstallation …
These commands can be applied on all hosts, the selected host(s) only or a sub-set of the whole hosts list based on a filter. actions.png

Actions on a single host

Via the Hosts page and the hosts list, you can select one of them and open the host page where you have, at the top-right, an “Host Actions” menu.
The same commands are offered: start, stop, maintenance mode, delete …
ON this page, you also have metrics about the host like CPU, memory, disk and network usage.
And the list of the service instances (components) running on this host. You can then individually stop one instance only of one service, without stopping the whole service in the cluster.
5.single host actions.png

Auto-starting services

In the Admin page, you have a “Service Auto Start” menu at the left.
On this page, you are able to decide which service to start in case of reboot of the host.
Only the Ambari server (and its DB) and the Ambari agents are installed with startup scripts in the standard Linux RC directories. Because the HDP and HDF services are managed via Ambari, it’s only inside Ambari that you can enable or not their auto-start capability in case of reboot of one host.
In earlier versions of Ambari, this option wasn’t present at all. Therefore in case of reboot of host, you had to manually do the start of the services. Fortunately, it was possible to automate this via a script using the REST API of the Ambari server, but it was not fully optimal (need to be sure that Ambari server is well started first, etc.)
7.Services auto-start.png