Changing the default web portBy 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:
- Stop the Ambari server ( sudo ambari-server stop )
- Edit the file /etc/ambari-server/conf/ambari.properties
- 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.
- Start the Ambari server ( sudo ambari-server start )
The simplest way to do it can be to add the following lines to the /etc/rc.local file:
This way, the setting will be reapplied at each reboot, because by default the parameter is set on “always”, so it is enabled.
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
You can change this setting on the fly by doing:
Note the use of tee because you need to be root to write in the mentioned system file.
Node1(admin):~ echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
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 serviceOn 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.
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 serviceIf 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.
The list will show you only the already installed services that can run on multiple hosts.
Actions on existing serviceGo 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).
Add a new hostGo 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, …
Actions on group of hostsFrom 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 on a single hostVia 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.
Auto-starting servicesIn 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.)