Обсуждение: Add pg server to cluster
Hi there. I'm using PostgreSQL as my main database engine. Everything works. I have one server for PostgreSQL, and space on it are lowing down. I want to buy a new server and somehow connect it with first one, that PostgreSQL will use this new server's HDD. I don't want to buy new HDD for the first server, because I don't have a space in server box. So, currently PostgreSQL data are located in /var/lib/pgsql/data folder. If I connect new server, how should I connect new server's folders to this directory, so PostgreSQL can add space for its data? Or maybe it's unreal to do? Unreal to use several network folders for data? I'm new in clustering... Maybe it's possible to split up data folder (and the mount it via NFS, for example)? Thanks for patients. -- )\._.,--....,'``. /, _.. \ _\ (`._ ,. `._.-(,_..'--(,_..'`-.;.'
On Mon, Dec 7, 2009 at 10:35 AM, AlannY <m@alanny.ru> wrote:
You have a couple of options:
NFS
Works well, just make sure you're running with 'sync' enabled, or you could lose some data
iSCSI
Works slightly better, usually a more performant solution (in my experience). It's nice too because you could always upgrade to a hardware based iSCSI controller if need be.
If you're looking to upgrade though, why not just move the database to the new server so that you can avoid this problem in the first place? Keeping the database running with local storage is usually going to perform better, unless you move up to an Enterprise SAN or something along those lines.
--Scott
Hi there.
I'm using PostgreSQL as my main database engine. Everything works.
I have one server for PostgreSQL, and space on it are lowing down.
I want to buy a new server and somehow connect it with first one, that
PostgreSQL will use this new server's HDD. I don't want to buy new HDD
for the first server, because I don't have a space in server box.
So, currently PostgreSQL data are located in /var/lib/pgsql/data
folder. If I connect new server, how should I connect new server's
folders to this directory, so PostgreSQL can add space for its data?
Or maybe it's unreal to do? Unreal to use several network folders for
data? I'm new in clustering... Maybe it's possible to split up data
folder (and the mount it via NFS, for example)?
You have a couple of options:
NFS
Works well, just make sure you're running with 'sync' enabled, or you could lose some data
iSCSI
Works slightly better, usually a more performant solution (in my experience). It's nice too because you could always upgrade to a hardware based iSCSI controller if need be.
If you're looking to upgrade though, why not just move the database to the new server so that you can avoid this problem in the first place? Keeping the database running with local storage is usually going to perform better, unless you move up to an Enterprise SAN or something along those lines.
--Scott
AlannY wrote: > Hi there. > > I'm using PostgreSQL as my main database engine. Everything works. > > I have one server for PostgreSQL, and space on it are lowing down. > > I want to buy a new server and somehow connect it with first one, that > PostgreSQL will use this new server's HDD. I don't want to buy new HDD > for the first server, because I don't have a space in server box. > For the requirements you've given above, buy an external storage array instead of a new server put a SAS card in your server, and a SAS/SATA bay as large as you need for additional disks. once these additional disks are formatted and mounted as a file system, which I'm going to call /u00 here, I'd do something like... 1) shut down postgres 2) mv /var/lib/pgsql/data /u00/pgdata 3) ln -s /u00/pgdata /var/lib/pgsql 4) restart postgres and poof, LOTS of space. example such enclosure, this one holds 12 3.5" SAS/SATA drives in a 2U chassis, and is strictly something I googled, I have no experience with the vendor or OEM http://www.aicipc.com/ProductDetail.aspx?ref=XJ1100%20series%20-%202U%2012-bay I would format a unit like this as raid10 using your OS's native raid (mdadm on linux, zpool on solaris, etc). for the SAS card, I'd lean towards a LSI Logic, such as http://www.lsi.com/storage_home/products_home/host_bus_adapters/sas_hbas/external/sas9200-8e/index.html
On Mon, Dec 07, 2009 at 01:12:03PM -0500, Scott Mead wrote: > On Mon, Dec 7, 2009 at 10:35 AM, AlannY <m@alanny.ru> wrote: > > You have a couple of options: > > NFS > > Works well, just make sure you're running with 'sync' enabled, or > you could lose some data > What should I do exactly? Create NFS folder in new server? And then? Mount NFS folder to /var/lib/pgsql/data? If so, I will confront with space problem again, when space will ends at the new server... Or maybe there are more advanced modes with NFS? -- )\._.,--....,'``. /, _.. \ _\ (`._ ,. `._.-(,_..'--(,_..'`-.;.'
On Monday 07 December 2009, AlannY <m@alanny.ru> wrote: > What should I do exactly? Create NFS folder in new server? And then? > Mount NFS folder to /var/lib/pgsql/data? If so, I will confront with > space problem again, when space will ends at the new server... > > Or maybe there are more advanced modes with NFS? You can create tablespaces on different mount points. But seriously, don't use NFS across multiple servers for a database. Like another poster suggested, buy an external storage chassis and hook it up. -- "No animals were harmed in the recording of this episode. We tried but that damn monkey was just too fast."