Since the D: drive is used as a location to store PostgreSQL data when installing PostgreSQL, the volume resource must be activated on the appropriate node before installation.
Install PostgreSQL
- Log in to the active node (SIOS20-AD\SIOS20-NODE1) with SIOS20-AD\lkadmin.
- Launch the LifeKeeper GUI and activate the volume resource on the node you are logged into.
- Create the folder D:\pgdata as a location to store PostgreSQL data.
- Download the PostgreSQL (Windows x86-64) installation image from the following site, save it anywhere, and double-click to open. Version 14.7 is used here.
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
- Follow the prompts and enter the following details:
PostgreSQL | |
---|---|
Installation Directory | C:\Program Files\PostgreSQL\14 (Default value) |
Component | (Default value) |
Data Directory | D:\pgdata |
Password | <password> |
Port | 5432 (Default value) |
Locale | (Default value) |
- You will be asked whether you are going to install additional components, but it is not necessary here. Uncheck the box and click Finish to exit the wizard.
- Start the PowerShell for administrators and execute the following command to stop the PostgreSQL service.
Check the service.
PS > Get-Service postgre*
Stop the service.
PS > Stop-Service -Name <postgre_service_name>
- Start regedit. (Press the Win key + R to display the Run dialog, enter regedit and click OK.)
- Navigate the following hierarchy in the left pane of regedit and open postgresql-x64-11.:
\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\postgresql-x64-14
- Double-click and open ImagePath and add the following string to the end of Value data (the string at the bottom of the dialog), and click OK.
-o "-p 5432"
- Rename D:\pgdata to D:\pgdata.node1.
- Log in to the standby node (SIOS20-AD\SIOS20-NODE2) with SIOS20-AD\lkadmin and repeat steps 2 through 10 of this section.
Edit pg_hba.conf
Edit D:\pgdata\pg_hba.conf (active node SIOS20-NODE1 only).
- Log in to the active node (SIOS20-AD\SIOS20-NODE1) with SIOS20-AD\lkadmin.
- The authentication method for database cluster administrative users must be set to “trust”. (IPv4 and IPv6) … ①
- The network address of the destination client must be described. …②
- An example is shown below.
<Before editing>
# IPv4 local connections: host all all 127.0.0.1/32 scram-sha-256 # IPv6 local connections: host all all ::1/128 scram-sha-256
<After editing>
# IPv4 local connections: # ① host all postgres 127.0.0.1/32 trust # ② host all all 10.0.1.0/24 scram-sha-256 # IPv6 local connections: # ① host all postgres ::1/128 trust
Post your comment on this topic.