Disk rules
Following best practices are recommended while configuring PostgreSQL on RHEL system.
- It is recommended that you use UDEV rules so that the device IDs are used in a persistent manner to set permissions and accessible aliases. The UDEV rules identify the disks by using a unique WWN for each device to create a symbolic link and associate permissions to the device that is persistent across the reboots. Aliases and permissions are often set differently by different customers. The following examples show a sample configuration file with UDEV rules.
- To get the device identifier, run a command similar to the following:
# /lib/udev/scsi_id --page=0x83 --whitelisted --device=/dev/scinia
The following example shows a sample UDEV rule that uses the device identifiers to set device permissions and user-friendly aliases that can be used for the PostgreSQL database:
- # cat /etc/udev/rules.d/99-my-disk.rules
##Postgres disk information
KERNEL=="scini*", SUBSYSTEM=="block", PROGRAM="/lib/udev/scsi_id --page=0x83 --whitelisted --device=/dev/%k", RESULT=="29542b332e1be630fca160dcb0000002b", SYMLINK+="disk1-scinia-logs" OWNER="postgres", GROUP="postgres", MODE="0700" - KERNEL=="scini*", SUBSYSTEM=="block", PROGRAM="/lib/udev/scsi_id --page=0x83 --whitelisted --device=/dev/%k", RESULT=="29542b332e1be630fca160aa500000007", SYMLINK+="disk2-scinib2t-pgdata1" OWNER="postgres", GROUP="postgres", MODE="0700"
- To reload udev rules:
udevadm control --reload-rules && udevadm trigger
- Use separate volumes for the database and log files as a best practice to avoid performance bottlenecks.
- Add the following entries of scini volume mount points in: /etc/fstab:
/dev/scinia /mnt/logs xfs _netdev 0 0
/dev/scinib /mnt/xfs-pgdata xfs _netdev 0 0
/dev/scinic /mnt/xfs-pgdata2 xfs _netdev 0 0
System tuning
For information about the general guidelines for tuning the setup based on the system configuration, workload, and available resources, see system tuning.