Created 06-27-2019 04:49 PM
When I am trying to restart the Ambari -Metrics in my cluster, It is giving me the attached error. Please suggest a workaround here.
Created 06-30-2019 12:40 PM
Can anyone please help on this?
Created 06-30-2019 01:37 PM
As we see the following error:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory Traceback (most recent call last): File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/AMBARI_METRICS/package/scripts/metrics_monitor.py", line 78, in <module> AmsMonitor().execute()
So can you please try this and then see if it works for you?
Edit the AGENT_WORKING_DIR property value inside the "/var/lib/ambari-agent/bin/ambari-agent" to something else and then try again. The default location will be something like following on all hosts.
Default setting
# grep 'AGENT_WORKING_DIR' /var/lib/ambari-agent/bin/ambari-agent AGENT_WORKING_DIR=/var/lib/ambari-agent
For example try changing it to something like "/tmp/ambari-agent " as following:
Example After change
# grep 'AGENT_WORKING_DIR' /var/lib/ambari-agent/bin/ambari-agent AGENT_WORKING_DIR=/tmp/ambari-agent
Then restart Amabri Agent on all hosts.
# ambari-agent restart
Created 07-01-2019 11:57 AM
Is this issue resolved? Are you still facing this issue?
Created 07-01-2019 02:36 PM
I tried with the above mentioned steps and tried to restart the ambari-metrics. But it is again giving the attached error:-
Created 07-01-2019 11:05 PM
We see the new Error in the logs now.
resource_management.core.exceptions.ExecutionFailed: Execution of '/usr/sbin/ambari-metrics-monitor --config /etc/ambari-metrics-monitor/conf start' returned 255. psutil build directory is not empty, continuing...
.
So please try to rebuild the "psutil" on your own to see if it works for you on the Metrics Monitor Hosts. Then try again.
# cd /usr/lib/python2.6/site-packages/resource_monitoring # python psutil/build.py
Reference:
.
Created on 07-02-2019 11:33 AM - edited 08-17-2019 02:47 PM
Please find the output from the above command. The python script is throwing some syntactical error in the script:-
Created 07-02-2019 11:46 AM
The Line 40 of "psutil/build.py" is just a Print Statement.
Please comment that line using # and then try again using.
.
Looks like you are using Python3 instead of python 2.7
# python --version
Created on 07-03-2019 07:01 AM - edited 08-17-2019 02:47 PM
@Jay Kumar SenSharma Based on your last comment, I commented out the line 40 in build.py. Still I am getting error for line 53 which was also a 'print' statement. When i commented out that line also, i am agian getting error for line 54. Please find the screenshot below:-
Created 07-04-2019 07:38 AM
Please find the latest log after commenting out the lines in build.py script. In ambari-metrics log, we can see the below error:-
raise Fail("Pid file {0} doesn't exist after starting of the component.".format(pid_file)) resource_management.core.exceptions.Fail: Pid file /var/run/ambari-metrics-collector//hbase-ams-master.pid doesn't exist after starting of the component.
I am attaching the full log of ambari-metrics:-