Search code examples
ubuntuhadoopvirtualboxambari

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


I am one new guy to learn Hadoop with ambari from apache, and I have been trying to install ambari on my Ubuntu in VirtualBox environment, however, I am exhausted by encountering the problem.

1stly, the system reminder me that "Ambari Server 'start' completed successfully" as following

~# 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.

However, I cannot access ambari service via "http://127.0.0.1:8080", and when I check the server status as following

~# 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

When I check the file of /var/run/ambari-server/ambari-server.pid

~# cat /var/run/ambari-server/ambari-server.pid 
2875

When I check into the log file, it leads with following lines

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.

I searched the internet, and found no solution for this issue.

By the way, I haven't installed Hadoop yet, whether this is the issue or not?

Thanks in advance.


Solution

  • Finally it worked

    Instead of running the command in background, I used nohup. It worked. The content of the script which was executed in remote machine is given below.

    #!/bin/bash
    nohup ambari-server start