DB設定
プライマリサーバでデータベース用ディレクトリを作成
[root@test_dev1 ~]# mkdir /data/pgsql
[root@test_dev1 ~]#
[root@test_dev1 ~]# chown postgres:postgres /data/pgsql/
[root@test_dev1 ~]#
データベースクラスタを作成
[postgres@test_dev1 ~]$ initdb --no-locale --encoding=UTF-8 /data/pgsql/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale C.
The default text search configuration will be set to "english".
creating directory /data/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers/max_fsm_pages ... 32MB/204800
creating configuration files ... ok
creating template1 database in /data/pgsql/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.
Success. You can now start the database server using:
postgres -D /data/pgsql/data
or
pg_ctl -D /data/pgsql/data -l logfile start
[postgres@test_dev1 ~]$
簡易稼動確認
[postgres@test_dev1 ~]$ pg_ctl -D /data/pgsql/data start
server starting
[postgres@test_dev1 ~]$ LOG: database system was shut down at 2009-06-02 11:06:15 JST
LOG: autovacuum launcher started
LOG: database system is ready to accept connections
[postgres@test_dev1 ~]$ psql
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
postgres=# \q
[postgres@test_dev1 ~]$
[postgres@test_dev1 ~]$ pg_ctl -D /data/pgsql/data stop
[postgres@test_dev1 ~]$
最終更新:2009年06月02日 16:53