Network Attached Tablespace
Redrock Postgres supports network attached tablespaces. Based on this capability, Redrock Postgres can deploy database computing and storage separately.
Prepare the computing server and storage server environments. The recommended environment configurations are as follows:
- Computing servers should use high processor and memory configurations.
- The storage server should use the storage device with high I/O throughput, and the storage space must meet the data storage requirements.
- Use high-bandwidth and low-latency networks between computing servers and storage servers.
If you need to create multiple network tablespaces on the database server, you need to prepare multiple storage servers.
To deploy a compute server, perform the following steps:
- Install the software package by referring to Redrock Postgres Installation Guide.
- Stop the server, if it’s running.
- Perform the backup, using any convenient file-system-backup tool such as tar or cpio (not pg_dump or pg_dumpall).
- Start the server.
To deploy the storage server, perform the following steps:
- Install the software package by referring to Redrock Postgres Installation Guide.
- Stop the server, if it’s running.
- Remove all existing files and subdirectories under the instance data directory.
- Restore the database files from your file system backup. Be sure that they are restored with the right ownership (the database system user, not root!) and with the right permissions.
- Set the listening address and port in
postgresql.conf
and create astorage.signal
file in the instance data directory. Modifypg_hba.conf
to allow connections from the compute server. - Start the server.
Log in to the computing server, connect to the postgres
database in the database service as the database superuser, and create a network attached database. The following is a simple configuration example:
CREATE DATABASE netdb STORAGE remote LOCATION
'host=192.168.1.50 port=5432 user=postgres password=pgpass';
In Redrock Postgres, creating a database creates a default tablespace in the database, and the newly created database in the example above produces a default network tablespace.
Use a database superuser to connect to the newly created database netdb
in the database service to create a network attached tablespace. The following is a simple example of a configuration that creates two network attached tablespaces using two additional storage servers:
CREATE TABLESPACE netts1 STORAGE remote LOCATION
'host=192.168.1.51 port=5432 user=postgres password=pgpass';
CREATE TABLESPACE netts2 STORAGE remote LOCATION
'host=192.168.1.52 port=5432 user=postgres password=pgpass';
You can then use these network attached tablespaces to create tables and indexes.