February 2020
Intermediate to advanced
734 pages
38h 13m
English
Stopping PostgreSQL isn't the only way to test how failover systems work. One common method is to force a network break instead of a true outage. This helps to demonstrate how systems work when only one path of communication is disrupted.
For example, assuming that pgha2 is using IP 10.0.30.2, we could instruct pgha1 to ignore all traffic from that location with a command such as this:
sudo iptables -A INPUT -s 10.0.30.2/32 -j DROP
Since network barriers such as this don't immediately break established connections, it may take some time to affect pgha2. Once it does, pgha2 will attempt to trigger an election. However, there will be one critical difference in the result, as shown here:
This outcome is due to the fact that ...
Read now
Unlock full access