As your environment grows, you may need to add new PostgreSQL Server database clusters on existing or new shared or replicated volumes.
To add and protect a new database cluster and the associated volume follow these steps:
- Create the volume resource. On the server where the PostgreSQL database cluster will be placed, create and extend a volume resource.
- Create the database cluster. Run initdb to create the new database cluster. Be sure to locate the data directory on the volume resource created above.
- Set access permissions. In order to start and stop the PostgreSQL database cluster, the data directory and all files and sub-directories must have access rights that are recognized by all nodes in the cluster. By default the data directory and all files and sub-directories will have access rights based on the user running initdb. If the user is the local administrator, then attempting to start the database cluster on any other server will fail as that server will not have access rights. Either running initdb while logged on as a domain user or adding access rights for NT AUTHORITY\NetworkService is recommended. The account is used to provide access across all servers and should be the same account used for the Windows service logon credentials when creating the PostgreSQL resource.
- Configure for unattended connections. The database cluster must be configured to allow connections without requiring a password. See Configuration for Unattended Connections for more information.
- Start the database cluster. The database cluster must be running to create the PostgreSQL resource. Start the database cluster via pg_ctl.exe with the –o “-p port” argument. See Configuring the Postmaster Port Argument for more information on how to verify and start PostgreSQL with the postmaster port argument.
- Create the PostgreSQL resource. On the server that the new database cluster was created on, create and extend a PostgreSQL resource. During the resource create you will be prompted for a Windows service name along with the logon credentials (user account and password). The Windows service name can be anything and will be used to create a Service account for administration (starting, stopping …) of the database cluster. The logon credentials used should be the ones setup in step 3 to ensure access rights on all servers.