Search This Blog

Starting and stopping Ambari agents

In this article we will learn how to work with Ambari agents.We will learn how to start, stop , restart and some more operations of ambari agents from command line.
 If you are not using root user, you have to prefix sudo to all commands listed in below steps.

 1) Check the status of Ambari agents.

This command tells us wether Ambari agent is in running state or not. If  Ambari agent is in running state , Command also gives us pid of the Ambari agent process.

Command :

ambari-agent status
OR

sudo ambari-agent status

OR

service ambari-agent status



2) Stopping  Ambari agent

You can use any one of the commands to stop ambari agent.

sudo ambari-agent stop

OR

ambari-agent stop

OR

service ambari-agent stop



If ambari agent is stopped, Ambari server shows heart beat lost message for the node where ambari-agent is stopped.


3) Starting  Ambari agent

You can use any one of the commands to start ambari agent.

ambari-agent start

OR

sudo ambari-agent start

OR

service ambari-agent  start



Once ambari agent is started, heart beat issues in Ambari user interface will be fixed.

4) Restarting Ambari agent

You can use any one of the commands to restart ambari agent.

ambari-agent restart

OR

sudo ambari-agent restart

OR

service ambari-agent restart






5) Othe options

Ambari agent process also comes with some more commands, You can check them all using --help option.

ambari-agent --help



1 comment:

  1. Hi



    By mistake i deleted one file in ambari agent that is

    rm -f /run/ambari-agent/ambari-agent.pid



    after that its showing this error



    ambari-agent restart
    Restarting ambari-agent
    Verifying Python version compatibility...
    Using python /usr/bin/python
    ambari-agent is not running. No PID found at /run/ambari-agent/ambari-agent.pid
    Verifying Python version compatibility...
    Using python /usr/bin/python
    Checking for previously running Ambari Agent...
    Checking ambari-common dir...
    Starting ambari-agent
    Verifying ambari-agent process status...
    ERROR: ambari-agent start failed. For more details, see /var/log/ambari-agent/ambari-agent.out:
    ====================
    No handlers could be found for logger "root"
    Failed to start ping port listener of: Could not open port 8670 because port already used by another process:
    UID PID PPID C STIME TTY TIME CMD
    root 23758 23754 0 Aug19 pts/4 00:00:17 /usr/bin/python /usr/lib/ambari-
    ====================
    Agent out at: /var/log/ambari-agent/ambari-agent.out
    Agent log at: /var/log/ambari-agent/ambari-agent.log

    ReplyDelete