Skip to content Skip to sidebar Skip to footer

Ambari Server Setup: Oserror: [errno 2] No Such File Or Directory

I'm trying to setup Hadoop on my EC2 instance using this tutorial. I'm trying to setup the ambari server when I get this error: [root@ip-xxx-xxx-xxx-xxx ec2-user]# ambari-server s

Solution 1:

Can't comment questions yet unfortunately, so putting suggestions here: Please post command outputs:

rpm -qa | grep ambari-server

cat /etc/*release

Also it will be good to know which postgres version is avaliable

rpm -qa | grep postgres

I guess it has something to do with python version, but only guess for now...

Solution 2:

It's likely that you have postgres installed in some other location. The file it's looking for is pg_hba.conf You chose the default postgres db for ambari and it will likely look for it under /var/lib/pgsql/data/

Looking at the trace, it's trying to rename the file, but just unsure what that file is exactly. To really know which file and location for sure, simply edit the python script: /usr/lib64/python2.6/fileinput.py

Add a line above the code to print the files it's looking for:

printself._filename, ':', self._backupfilename                 
os.rename(self._filename, self._backupfilename)

Note: I hit a similar situation and it was pointing to /var/lib/pgsql/data, which did not exist (real location was under /data/pghadoop). So what I did was create a symbolic link to my real location, i.e. ln -s /data/pghadoop/ /var/lib/pgsql/data.

Solution 3:

If we tried to install Ambari server under Amazon Linux with its bundled postgresql db, you should get error on ambari-server setup.

The first root cause is the startup script postgresql assumes the default data path is at: /var/lib/pgsql92/data

However, we can see nothing under: /var/lib/pgsql92/data Instead of, we should see thing under: /var/lib/pgsql9

Here is workaround:

  • Fix the default data path for Ambari bundled postgresql:

sudo ln -s /var/lib/pgsql9 /var/lib/pgsql

  • Edit postgresql script

# sudo vim /etc/init.d/postgresql

-- comment it:

#PGSUFFIX=92

-- change below:

PGDATA=/var/lib/pgsql${PGSUFFIX}/data

PGLOG=/var/lib/pgsql${PGSUFFIX}/pgstartup.log

To:

PGDATA=/var/lib/pgsql/data

PGLOG=/var/lib/pgsql/pgstartup.log

Post a Comment for "Ambari Server Setup: Oserror: [errno 2] No Such File Or Directory"