- PostgreSQL 9.4 Server
- Disable TCP/IP socket authentication
- Configure maximum connections limit to 500
- Enable all SQL statements logging
We already had 10G free space available in a volume group on the servers so I decided to create a separate logical volume but keep the default PostgreSQL directory structure.
Here is the python fabfile that I created for the deployment,
This script can be used in multiple ways but first make sure Python package Fabric is installed on your deployment machine. In my case my deployment machine was my MacBook Air laptop. Python package Fabric can be easily installed using,
pip install Fabric
We can test this script on our vagrant machine,
- Download the script in the same directory as your Vagrantfile.
- Uncomment the line
execute(vagrant)in the script.
- Make the script executable,
chmod +x install_postgresql_94.py
- Just run the script
fab -H <comma-separated list of hosts> -u <username> -f ./install_postgresql_94.py postgresql
Also, we can update the script with hosts, username, password or path to SSH private key file and just execute the script.
Any feedback will be highly appreciated.