Обсуждение: separating data and logs

Поиск
Список
Период
Сортировка

separating data and logs

От
"Peter Koczan"
Дата:
Hi all,

I'm making a lot of changes for my eventual migration to postgres 8.3,
and I was considering changing how data and logs are separated for a
few of my servers.

Currently, the OS and log data are on one disk system, and the actual
data cluster (including configs) are on the other disk system.
Currently, after creating the database cluster, I copy the pg_xlog
directory to the OS system and symlink it from the actual cluster.

So, I'm wondering...

- Are there any best practices, or better practices, than symlinking
this (possible config options)?

- How have other people have this set up, or recommend setting this up
(e.g. also symlinking pg_clog or other things as well)?

I searched through the archives and found a few threads regarding
this, but not quite what I am looking for.

Thanks,
Peter

P.S. For those of you wondering exactly how I have things set up,
here's a representative sample from my test server.

[root@mitchell testing-8.2]# pwd
/scratch.1/postgres/testing-8.2

[root@mitchell testing-8.2]# ls -l
total 48
drwx------ 8 postgres postgres    83 Oct  8 16:57 base
drwx------ 2 postgres postgres  4096 Oct 12 05:07 global
drwx------ 2 postgres postgres    94 Oct  9 14:28 pg_clog
-rw------- 1 postgres postgres  3841 Aug 28 14:16 pg_hba.conf
-rw------- 1 postgres postgres  1460 Aug  8 14:06 pg_ident.conf
drwx------ 4 postgres postgres    34 Aug  8 14:06 pg_multixact
drwx------ 2 postgres postgres    17 Oct 12 00:15 pg_subtrans
drwx------ 2 postgres postgres     6 Aug  8 14:06 pg_tblspc
drwx------ 2 postgres postgres     6 Aug  8 14:06 pg_twophase
-rw------- 1 postgres postgres     4 Aug  8 14:06 PG_VERSION
lrwxrwxrwx 1 root     root        37 Oct  8 16:18 pg_xlog ->
/scratch/postgres/testing-8.2/pg_xlog
-rwxr-xr-x 1 postgres postgres 15212 Oct 11 15:05 postgresql.conf
-rw------- 1 postgres postgres    96 Oct 11 15:55 postmaster.opts
-rw------- 1 postgres postgres    57 Oct 11 15:55 postmaster.pid
-rw-r--r-- 1 postgres postgres  1805 Aug  8 14:06 server.crt
-rw------- 1 postgres postgres  1675 Aug  8 14:06 server.key

[root@mitchell testing-8.2]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              1019208    396464    570136  42% /
tmpfs                   517128         0    517128   0% /dev/shm
/dev/sda8             58191096    164436  58026660   1% /scratch
/dev/sda6              1041984       560   1041424   1% /tmp
/dev/sda2             10472128   5939032   4533096  57% /usr
/dev/sda3              4061572    172092   3679832   5% /var
/dev/sda7              1019208    300372    666228  32% /var/vice/cache
/dev/sdb1             78110004  18864924  59245080  25% /scratch.1
AFS                    9000000         0   9000000   0% /afs