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.
阅读(1876) | 评论(0) | 转发(0) |