add install pg_auto_failover with psql 11 in ubuntu 18.04

master
Eric Chang 6 years ago
parent e148d19b33
commit 8e3c142ed6

@ -62,7 +62,7 @@ sudo apt install postgresql-11-auto-failover -y
postgresql 的相關執行檔路徑預設不會載入到PATH變數中所以要自己手動增加 postgresql 的相關執行檔路徑預設不會載入到PATH變數中所以要自己手動增加
直接加入 /etc/environment ,或者是去修改使用者的 .profile 載入正確的 $PATH 都可以 直接加入 /etc/environment ,或者是去修改使用者的 .profile 載入正確的 $PATH 都可以
```` ```
#replace PATH variable in /etc/environment #replace PATH variable in /etc/environment
PATH="/usr/lib/postgresql/11/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" PATH="/usr/lib/postgresql/11/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
@ -960,3 +960,25 @@ pgautofailover RUNNING pid 2232, uptime 0:00:04
``` ```
搞定,收工!準備寫 ansible playbook 搞定,收工!準備寫 ansible playbook
***
UPDATE
新增用logrotate 來管理 pgautofailover logfile
```
sudo vim /etc/logrotate.d/pgautofailover
/var/log/supervisor/pgautofail*.log {
daily
rotate 7
copytruncate
delaycompress # today and yesterday will not compress
compress
missingok
notifempty
}
```

Loading…
Cancel
Save