总是遇到"Ambari Server not running, Stale PID File at: /var/run/ambari-server/ambari-server.pid"

Always encounter "Ambari Server not running, Stale PID File at: /var/run/ambari-server/ambari-server.pid"

我是一个从apache学习Hadoop和ambari的新人,我一直在尝试在VirtualBox环境中的Ubuntu上安装ambari,但是,遇到这个问题让我筋疲力尽。

1、系统提醒我"Ambari Server 'start' completed successfully"如下

~# ambari-server start
Using python  /usr/bin/python2.7
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start...................
Ambari Server 'start' completed successfully.

但是,我无法通过“http://127.0.0.1:8080”访问ambari服务,当我检查服务器状态时如下

~# ambari-server status
Using python  /usr/bin/python2.7
Ambari-server status
Ambari Server not running. Stale PID File at: /var/run/ambari-server/ambari-server.pid

当我查看/var/run/ambari-server/ambari-server.pid

的文件时
~# cat /var/run/ambari-server/ambari-server.pid 
2875

当我查看日志文件时,它以以下行开头

22 May 2015 10:59:42,876  INFO [main] Configuration:527 - Reading password from existing file
22 May 2015 10:59:43,073  INFO [main] Configuration:747 - Hosts Mapping File null
22 May 2015 10:59:43,074  INFO [main] HostsMap:60 - Using hostsmap file null
22 May 2015 10:59:45,169  INFO [main] ControllerModule:172 - Detected MYSQL as the database type from the JDBC URL
22 May 2015 10:59:45,253  INFO [main] ControllerModule:214 - Using c3p0 ComboPooledDataSource as the EclipsLink DataSource
22 May 2015 10:59:45,416  INFO [main] MLog:80 - MLog clients using log4j logging.
22 May 2015 10:59:46,124  INFO [main] C3P0Registry:204 - Initializing c3p0-0.9.1.1 [built 15-March-2007 01:32:31; debug? true; trace: 10]
22 May 2015 10:59:59,830 ERROR [main] DBAccessorImpl:99 - Error while creating database accessor 
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

我在网上搜索了一下,没有找到解决这个问题的方法。

顺便问一下,我还没有安装 Hadoop,是否是这个问题?

提前致谢。

我希望这与https://issues.apache.org/jira/browse/AMBARI-9215

有关

当我登录服务器然后启动 Ambari 时,它可以正常工作。但是当我开始使用 fabric 时它不起作用。

作为解决方法,我正在尝试将脚本推送到目标主机并在后台执行命令。

而/root/scripts/Start_Ambari.sh的内容有以下内容。

!/bin/bash

ambari 服务器启动 &

终于成功了

我使用 nohup 而不是 运行 后台命令。有效。 在远程机器上执行的脚本内容如下。

#!/bin/bash
nohup ambari-server start

对于这种情况,问题可能是任何问题。让我指出其中的一些,无论哪个有效,请告诉我们。

  1. 运行 你的 ambari-server 作为 root

    $sudo ambari-server 启动

  2. 检查您的 /etc/hosts 文件

  3. 检查你的8080端口是否开放访问