Reply
New Contributor
Posts: 2
Registered: ‎04-10-2015

cloudera-scm-server-db start returns 'could not create lock file...Permission denied'

sudo service cloudera-scm-server-db start returns an error:
    pg_ctl: could not start server

 

/var/log/cloudera-scm-server/db.log shows:

    FATAL:    "/var/run/postgresql/.s.PGSQL.7432.lock": Permission denied

 

If postgresql is started independantly, it starts ok. Only when it is started as a part of CM, it returns the above error.

 

Any idea?

Posts: 307
Topics: 0
Kudos: 19
Solutions: 8
Registered: ‎08-19-2013

Re: cloudera-scm-server-db start returns 'could not create lock file...Permission denied'

Starting postgresql by itself will run it on port 5432 (if using the defaults). 

 

The "Embedded DB" for Cloudera Manager uses the version of postgres installed on the system.  It just runs it under a different configuration for the data directory and port (7432).

 

It could be a stale lock file.   It could also be the permissions on the lock file are such that the lock cannot be deleted.

 

1.  Confirm if the postgres server is running:

 

ps -ef | grep bin/postgres

 

If you see this process running, the database is already started.

 

/usr/bin/postgres -D /var/lib/cloudera-scm-server-db/data

 

2.  If the process is already running, try stopping it gracefully.   If you have to, then kill it.  (use "kill <pid>" a couple times before going for "kill -9")

 

3.  Delete the existing lock file, from root if necessary.

 

4.  Restart the cloudera-scm-server-db 



David Wilder, Community Manager


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.

Learn more about the Cloudera Community:

Terms of Service

Community Guidelines

How to use the forum

Posts: 307
Topics: 0
Kudos: 19
Solutions: 8
Registered: ‎08-19-2013

Re: cloudera-scm-server-db start returns 'could not create lock file...Permission denied'

I'm noticing on CentOS 6.6, running postgresql-8.4.20, the lock file is being created in /tmp.

What OS are you using and version of postgresql?

Another possibility is the user cloudera-scm, which runs the postgresql server for Cloudera Manager, does not have permission to write into /var/run/postgresql.


David Wilder, Community Manager


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.

Learn more about the Cloudera Community:

Terms of Service

Community Guidelines

How to use the forum

New Contributor
Posts: 2
Registered: ‎04-10-2015

Re: cloudera-scm-server-db start returns 'could not create lock file...Permission denied'

$ cat /etc/issue
Amazon Linux AMI release 2015.03
Kernel \r on an \m

$ psql --version
psql (PostgreSQL) 9.2.10

I worked around the problem by just changing the owner of the dir:
sudo chown cloudera-scm:cloudera-scm /var/run/postgresql
Thanks.