[Postgres]postgresql.conf : Permission denied处理一法
2013-10-08 10:26
351 查看
使用yum安装完postgresql,没有使用默认的DATA地址,自己配置了DATA地址以后,使用root权限启动service
,报出了"FAILED"
不解,检查Log文件 /var/lib/pgsql/pgstartup.log. 发现如下记录
于是检查postgres用户的文件权限,没有明显的问题,可读可写(忘了好像是700),于是上网一查,基本怀疑问题在SELinux上
先检查SELinux状态
果然是运行状态,并且还是在"enforcing"模式,检查SELinux的Log(大部分情况在/var/log/audit/,有时也会被配置到/var/log/messages)
有一条拒绝记录!就这玩意干的。
这里说个最简单干脆的方法,停用SELinux.
编辑/etc/selinux/config:
将SELINUX=enforcing 改成 SELINUX=permissive或者SELINUX=disabled,重启系统
再次启动postgresql,问题解决
可参考:http://blog.endpoint.com/2009/09/permission-denied-for-postgresqlconf.html
http://www.crypt.gen.nz/selinux/disable_selinux.html
http://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html
service postgresql start
,报出了"FAILED"
不解,检查Log文件 /var/lib/pgsql/pgstartup.log. 发现如下记录
postmaster cannot access the server configuration file
"/var/lib/pgsql/data/postgresql.conf": Permission denied
于是检查postgres用户的文件权限,没有明显的问题,可读可写(忘了好像是700),于是上网一查,基本怀疑问题在SELinux上
先检查SELinux状态
# sestatus
果然是运行状态,并且还是在"enforcing"模式,检查SELinux的Log(大部分情况在/var/log/audit/,有时也会被配置到/var/log/messages)
有一条拒绝记录!就这玩意干的。
这里说个最简单干脆的方法,停用SELinux.
编辑/etc/selinux/config:
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=enforcing # SELINUXTYPE= can take one of these two values: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted
将SELINUX=enforcing 改成 SELINUX=permissive或者SELINUX=disabled,重启系统
再次启动postgresql,问题解决
可参考:http://blog.endpoint.com/2009/09/permission-denied-for-postgresqlconf.html
http://www.crypt.gen.nz/selinux/disable_selinux.html
http://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html
相关文章推荐
- 一个老外对postgresql.conf的重新组织[换博客]
- postgresql pg_hba.conf 文件
- postgresql-9.X 的 slave 端的 recovery.conf 文件
- postgres启动服务器时missing or erroneous pg_hba.conf file
- postgreSQL数据库中postgresql.conf配置
- postgresql.conf文件中的一些重要设置
- 连接postgres特别消耗cpu资源而引发的PostgreSQL性能优化考虑
- PostgresQL FDW 源码分析之 postgresGetForeignPlan()
- PostgreSQL的 pg_hba.conf 文件简析
- 基于PostgreSQL的可扩展的开源大数据集群数据库:Postgres-XL
- postgresql.conf 影响postgresql性能的几个重要参数
- PostgreSQL9.4: jsonb 性能测试 - Postgres2015全国用户大会--重磅嘉宾佳作分享(谭峰)
- postgresql.conf配置
- Windows平台编译 PostgreSQL - Postgres2015全国用户大会--重磅嘉宾佳作分享(权宗亮)
- postgres访问认证配置文件pg_hba.conf
- PostgreSQL pg_hba.conf 文件简析
- 如何实现Postgresql数据库的重装与postgres密码重置
- centos针对postgres出现的postgresql Ident authentication failed for user
- Postgres访问其他PostgresQL数据库的功能DBLINK
- postgresql.conf 部分参数说明