?
Solved

Don't see the folder

Posted on 2014-07-11
24
Medium Priority
?
369 Views
Last Modified: 2014-07-22
Hi,
I have already set up
postgresql-server-8.4.20-1.el6_5.x86_64

on Linux Redhat, but I do not see this folder

/usr/local/pgsql

why?
0
Comment
Question by:HuaMinChen
  • 12
  • 6
  • 6
24 Comments
 
LVL 13

Expert Comment

by:duncanb7
ID: 40189972
Is it at /var/lib/pgsql ?
Please take a look this link, the variable setting is set to /var/lib/pgsql
https://wiki.postgresql.org/wiki/PostgreSQL_on_RedHat_Linux

Duncan
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40190097
Sorry, I get this

[huamin@CentOS65x64 lib]$ cd /var/lib
[huamin@CentOS65x64 lib]$ postgres
postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the PGDATA environment variable.
[huamin@CentOS65x64 lib]$ 

Open in new window

0
 
LVL 13

Expert Comment

by:duncanb7
ID: 40190102
Is there any file or directory in /var/lib/ ? If so, it proved you did installation before
Supposed the installation will do setup for you so you don't need to do environment setup

just run

service postgresql start

you can take sometime to review the link in previous post

Duncan
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 11

Author Comment

by:HuaMinChen
ID: 40190116
Sorry, I still get this
[root@CentOS65x64 huamin]# service postgresql start
Starting postgresql service:                               [  OK  ]
[root@CentOS65x64 huamin]# exit
exit
[huamin@CentOS65x64 ~]$ postgres -D /var/lib/pgsql/data
postgres cannot access the server configuration file "/var/lib/pgsql/data/postgresql.conf": Permission denied
[huamin@CentOS65x64 ~]$ 

Open in new window

0
 
LVL 13

Expert Comment

by:duncanb7
ID: 40190139
In the link posted previously, for older version linux
Please try it again
----------------------------------------
chkconfig postgresql on
service postgresql start

What is Linux version?

Duncan
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40190161
Many thanks. This is in CentOS 6.5.

i still get this
[root@CentOS65x64 huamin]# chkconfig postgresql on
[root@CentOS65x64 huamin]# service postgresql start
Starting postgresql service:                               [  OK  ]
[root@CentOS65x64 huamin]# exit
exit
[huamin@CentOS65x64 ~]$ postgres -D /var/lib/pgsql/data
postgres cannot access the server configuration file "/var/lib/pgsql/data/postgresql.conf": Permission denied
[huamin@CentOS65x64 ~]$ 

Open in new window

0
 
LVL 13

Expert Comment

by:duncanb7
ID: 40190174
Take a look at this article
http://blog.endpoint.com/2009/09/permission-denied-for-postgresqlconf.html

about  "postgres cannot access the server configuration file "/var/lib/pgsql/data/postgresql.conf": Permission denied"


Duncan
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40191682
Sorry, I get this
[root@CentOS65x64 huamin]# service postgresql start
Starting postgresql service:                               [  OK  ]
[root@CentOS65x64 huamin]# exit
exit
[huamin@CentOS65x64 ~]$ postgres -D /usr/local/pgsql/data
postgres cannot access the server configuration file "/usr/local/pgsql/data/postgresql.conf": No such file or directory

Open in new window

I don't know how to create "postgresql.conf".
0
 
LVL 13

Expert Comment

by:duncanb7
ID: 40191683
Take a look at this link to explain the process for postresql
http://www.kelvinwong.ca/tag/postgresql-conf/

Is there any postgresql.conf, conf file at /var/lib/pgsql/data/ ?

Duncan
0
 
LVL 13

Expert Comment

by:duncanb7
ID: 40191685
(in the first post) editing /etc/sysconfig/pgsql/postgresql and check this out

PGDATA=/var/lib/pgsql/data
PGPORT=5432
PGLOG=/var/lib/pgsql/pgstartup.log
PGOPTS=


Duncan
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40193620
Many thanks.
It means huamin user below, is not able to access the folder,

[huamin@CentOS65x64 ~]$ cd /var/lib/pgsql/data/
bash: cd: /var/lib/pgsql/data/: Permission denied
[huamin@CentOS65x64 ~]$ su
Password: 
[root@CentOS65x64 huamin]# cd /var/lib/pgsql/data/
[root@CentOS65x64 data]# 

Open in new window

then which privileges should be added to "huamin"?
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40196322
what to adjust then?
Hi,
I've edited this file
/etc/sysconfig/pgsql/postgresql

but I still get this
[root@CentOS65x64 huamin]# service postgresql start
Starting postgresql service:                               [  OK  ]
[root@CentOS65x64 huamin]# exit
exit
[huamin@CentOS65x64 ~]$ postgres -D /var/lib/pgsql/data
postgres cannot access the server configuration file "/var/lib/pgsql/data/postgresql.conf": Permission denied

Open in new window

0
 
LVL 22

Accepted Solution

by:
earth man2 earned 920 total points
ID: 40205578
use postgres user account rather than change file privielges
ie
as root
su - postgres
postgres -D /var/lib/pgsql/data
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40205737
Many thanks. Any advice to these?

[root@CentOS65x64 huamin]# su - postgres
su: warning: cannot change directory to /var/lib/pgsql: Permission denied
-bash: /var/lib/pgsql/.bash_profile: Permission denied
-bash-4.1$ postgres -D /var/lib/pgsql/data
postgres cannot access the server configuration file "/var/lib/pgsql/data/postgresql.conf": Permission denied
-bash-4.1$ 

Open in new window

0
 
LVL 22

Expert Comment

by:earth man2
ID: 40206594
Your installation is messed up.
Try this for starters as root, until user postgres can logon nothing will work as intended

chown -r postgres /var/lib/pgsql

Open in new window

0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40206718
Sorry, please advise to this

[root@CentOS65x64 huamin]# chown -r postgres /var/lib/pgsql
chown: invalid option -- 'r'
Try `chown --help' for more information.
[root@CentOS65x64 huamin]# 

Open in new window

0
 
LVL 22

Expert Comment

by:earth man2
ID: 40207152
-R
0
 
LVL 22

Expert Comment

by:earth man2
ID: 40207165
Set password for user postgres if you haven't done so already as root
passwd postgres

Then logon as postgres.  Were you successful?

Then consider if SELinux is the problem
http://docs.fedoraproject.org/en-US/Fedora/13/html/Managing_Confined_Services/sect-Managing_Confined_Services-PostgreSQL-Configuration_Examples.html
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40207324
Thanks a lot.
I've already successfully changed the password of user "postgres" and then what to check next?
0
 
LVL 22

Expert Comment

by:earth man2
ID: 40209908
logon as postgres.  Were you successful?
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40210594
Sorry Earthman.

I was confused to this as other people told me that it is suggested not to log into a service account, in this
http://www.experts-exchange.com/Database/PostgreSQL/Q_28479805.html#a40208103
0
 
LVL 22

Assisted Solution

by:earth man2
earth man2 earned 920 total points
ID: 40210885
The postgres account is used to administrate the database.  Eg set up database roles and table access privileges.  If you need to set logon restrictions then you would only allow logon if sat at the server console.
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40213398
Sorry, how to resolve this error attached, when logging into the OS using postgres account?
t763.png
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 40213429
Please omit the last post above.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question