installation
via docker:
make docker
or:
mkdir -p ~/go/src
git clone https://github.com/evkuzin/pg_pinger.git
make
- clone repository to ~/go/src
- install golang on the host (use
make requirements
if you are on linux)
- run
make
inside cloned repo to build bin file
usage
via docker:
docker run -i -v $(pwd)/config.yaml:/app/config.yaml pg_pinger -conf /app/config.yaml
to track failover/switchover run in pinger mode. It will track all nodes and measure mode (master/replica) and downtime
# pg_pinger -h
Usage of pg_pinger:
-conf string
config file location (default "config.yaml")
-cpuprofile string
write cpu profile to file
-log string
logging level (default "info")
-mod string
choose between load generator or pinger (default "pinger")
-thread int
threads per server (generator mod only, default 20)
to add some basic load run in generator mode. It will run inserts for master and selects for replicas. New master
tracking time is 300ms. Useful to simulate split-brain situation.
For generator mode require table on a postgres side:
CREATE TABLE test_table (field1 text, field2 text,field3 text);