Thread: Setting up data on two drives newb version.

Setting up data on two drives newb version.

From
"Joel Fradkin"
Date:
I just wanted to thank everyone who jumped in to help me.
Hopefully I have it set up ok.

Postgres install using more then one raid array for drives.

Install Postgres (I did not let the OS install it as I was wanting to use 8
and Fedora Core 3 was shipping with 7.4)
After I installed Fedora, I went to :
http://www.postgresql.org/
Downloads off main menu
FTP browser link
Binary link
8.0
Linux
rpms
fedora
fedora-core-3
http://www.postgresql.org/ftp/binary/v8.0/linux/rpms/fedora/fedora-core-3/
I was able to pull all the rpms (it did ask for the cd for fedora a few
times).

Once that is completed, you should be able to pull up the start services and
see pgsql as a service.
If you start it it will create a /var/lib/pgsql/lib/data folder. Data is the
initdb folder.
When you run initdb it creates this folder for you inside whatever folder
you are running intdb for.

What I did (I have a machine where I set up two additional raid arrays for
the data and the wal files;
 I was told it is best to use raid 10, 10k drives for the data and raid 1
15k drives for the wa/) was initdb /pgsql.
pgsql is what I called my raid 10 array and /wal is what I called my 15k
raid 1 array. This creates a data folder in /pgsql.
in /var/lib/pgsql/data I edited the pgsql.config and changed to
data_directory = '/pgdata/data'. I also:
listen_addresses = '*'
shared_buffers = 4000
max_fsm_pages = 30000        # min max_fsm_relations*16, 6 bytes each
max_fsm_relations = 1000    # min 100, ~50 bytes each
effective_cache_size = 40000    # typically 8KB each (my box is 8 gig so I
may edit this)
These settings I got from looking at
http://www.desknow.com/kb/idx/0/061/article/
It said to do a vacuum verbose total pages should be lower the
max_fsm_pages.
in pg_hba.conf I added
host    all         all         192.168.123.121 255.255.255.0       trust
to allow me to connect from my desktop.

Before starting the system up a second time (after adding the
data_directory) I went in to the
/pgsql/data folder and (A fellow from the mailing list helped me here to
relocate the wal)
0) backup your data
1) stop postmaster and verify.
2) cd $PGDATA; mv pg_xlog original_pg_xlog; ln -s /wal pg_xlog; cp
original_pg_xlog/* pg_xlog
3) start postmaster and confirm correct startup in log files.

only diference was I am not using $PGDATA I am using the directory command
in conf. So I chabged dir to /pgsql/data.

WHen I started postgres I could see data growing on both the /wal and /pgsql
drives.
I am still not 100% sure that just the data is on /pgsql/data, but at least
it is using a different drive then the OS
and the wal and data are on different drives.