Chinaunix首页 | 论坛 | 博客
  • 博客访问: 375689
  • 博文数量: 75
  • 博客积分: 1732
  • 博客等级: 上尉
  • 技术积分: 812
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-11 16:02
个人简介

博客很久没有更新了,原因是大多数时间都忙在研究技术上,却懒得腾时间出来把技术分享,最近在开源力量上开课《Mongodb管理与维护》,让屌丝们从0到精通,敬请关注。本博客技术原创更新滞后一些,找时间更新有关mysql,mongodb等内容,谢谢大家关注。

文章分类

全部博文(75)

文章存档

2021年(1)

2011年(20)

2010年(40)

2009年(7)

2008年(7)

分类: LINUX

2009-11-02 19:51:47

1、问题产生:
# pg_createcluster -u postgres -d /hxf_db -s /hxf_db -l /hxf_db  --start --start-conf auto 8.3 hxf_db
Creating new cluster (configuration: /etc/postgresql/8.3/hxf_db, data: /hxf_db)...
Moving configuration file /hxf_db/postgresql.conf to /etc/postgresql/8.3/hxf_db...
Moving configuration file /hxf_db/pg_hba.conf to /etc/postgresql/8.3/hxf_db...
Moving configuration file /hxf_db/pg_ident.conf to /etc/postgresql/8.3/hxf_db...
Configuring postgresql.conf to use port 5433...
pg_controldata: could not open file "/hxf_db/global/pg_control" for reading: Permission denied
Error: Could not parse locale out of pg_controldata output
 
2、描述:初步判断以为是权限存在问题或者本地locale的问题
# ls -ld /hxf_db/
drw-r----- 10 postgres postgres 392 2009-11-02 14:24 /hxf_db/
 
正确权限应该是700才对,现6400,显然执行过程中步骤没有完成。
 
查看locale也没有任何问题。
3、查看帮助语法
# pg_createcluster
Usage: /usr/bin/pg_createcluster [options]
Options:
  -u       cluster owner and superuser (default: 'postgres')
  -g       group for data files (default: primary group of owner)
  -d       data directory (default:
                /var/lib/postgresql//)
  -s       socket directory (default: /var/run/postgresql for clusters
                owned by 'postgres', /tmp for other clusters)
  -l       path to desired log file (default:
                /var/log/postgresql/postgresql--.log)
  --locale
                set cluster locale (default: inherit from environment)
  --lc-collate/ctype/messages/monetary/numeric/time
                like --locale, but only set for a particular category
  -e Default encoding (default: derived from locale)
  -p      port number (default: next free port starting from 5432)
  --start       start the cluster after creating it
  --start-conf auto|manual|disabled
                Set automatic startup behaviour in start.conf (default: 'auto')
 
对比语法和顺序都没有错。
4、把版本8.3提前至--start,去掉--start-conf 及-l,-s参数,正确执行。
# pg_createcluster -u postgres -d /hxf_db 8.3  --start  hxf_db
Error: cluster configuration already exists
# pg_createcluster -u postgres -d /hxf_db 8.3  --start  hxf_db
Creating new cluster (configuration: /etc/postgresql/8.3/hxf_db, data: /hxf_db)...
Moving configuration file /hxf_db/postgresql.conf to /etc/postgresql/8.3/hxf_db...
Moving configuration file /hxf_db/pg_hba.conf to /etc/postgresql/8.3/hxf_db...
Moving configuration file /hxf_db/pg_ident.conf to /etc/postgresql/8.3/hxf_db...
Configuring postgresql.conf to use port 5436...
 
结论:执行正确的语法结构顺序与帮助的语法并不一致。数据库的bug.
阅读(1795) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~