Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| admin:tantor [2014/03/27 17:37] – rjuju | admin:tantor [2014/08/19 00:07] (Version actuelle) – rjuju | ||
|---|---|---|---|
| Ligne 12: | Ligne 12: | ||
| ===== Roles ===== | ===== Roles ===== | ||
| + | |||
| + | Serveur postgresql esclave. | ||
| ===== Log ===== | ===== Log ===== | ||
| - | === 5 juin 2012 : install par damien === | + | ==== mises à jour ==== |
| + | |||
| + | * 9.3.5 le 19/08/2014 par rjuju | ||
| + | |||
| + | ==== 5 juin 2012 : install par damien | ||
| Ligne 27: | Ligne 33: | ||
| * Datacenter : Paris | * Datacenter : Paris | ||
| * distro : debian linux 6 64 bits | * distro : debian linux 6 64 bits | ||
| + | |||
| + | ==== Mise à jour en 9.3 le 29/04/2014 par rjuju ==== | ||
| + | |||
| + | Configuration de postgres: | ||
| + | |||
| + | < | ||
| + | postgres@tantor: | ||
| + | |||
| + | data_directory = '/ | ||
| + | hba_file = '/ | ||
| + | ident_file = '/ | ||
| + | external_pid_file = '/ | ||
| + | listen_addresses = ' | ||
| + | port = 5432 # (change requires restart) | ||
| + | max_connections = 100 # (change requires restart) | ||
| + | unix_socket_directories = '/ | ||
| + | ssl = true # (change requires restart) | ||
| + | ssl_cert_file = '/ | ||
| + | ssl_key_file = '/ | ||
| + | shared_buffers = 128MB # min 128kB | ||
| + | wal_level = hot_standby # | ||
| + | checkpoint_completion_target = 0.9 # checkpoint target duration, 0.0 - 1.0 | ||
| + | archive_mode = on # allows archiving to be done | ||
| + | archive_command = 'rsync -a %p postgres@celeste.postgresql.fr:/ | ||
| + | max_wal_senders = 3 # max number of walsender processes | ||
| + | log_checkpoints = on | ||
| + | log_connections = on | ||
| + | log_disconnections = on | ||
| + | log_line_prefix = '%t [%p]: [%l-1] db=%d, | ||
| + | log_timezone = ' | ||
| + | datestyle = 'iso, dmy' | ||
| + | timezone = ' | ||
| + | lc_messages = ' | ||
| + | lc_monetary = ' | ||
| + | lc_numeric = ' | ||
| + | lc_time = ' | ||
| + | default_text_search_config = ' | ||
| + | </ | ||
| + | |||
| + | Crontabs : | ||
| + | < | ||
| + | postgres@tantor: | ||
| + | |||
| + | # m h dom mon dow | ||
| + | |||
| + | #0 1 * * * | ||
| + | #0 2 * * 1 | ||
| + | #0 3 1 * * | ||
| + | #0 4 * 1 * | ||
| + | #0 5 * * * / | ||
| + | # export vers Tantor | ||
| + | #0 6 * * * rsync -av --delete / | ||
| + | |||
| + | # purge des backups | ||
| + | 0 7 * * * / | ||
| + | </ | ||
| + | |||
| + | Script de sauvegarde PITR: | ||
| + | <code bash / | ||
| + | #!/bin/bash | ||
| + | SRVDEST=" | ||
| + | VERSION=" | ||
| + | INST=" | ||
| + | SNAPNAME=" | ||
| + | PGDIR="/ | ||
| + | DESTDIR="/ | ||
| + | |||
| + | rc=0 | ||
| + | |||
| + | psql --cluster ${VERSION}/ | ||
| + | if [ $? -ne 0 ]; then | ||
| + | echo " | ||
| + | exit 1 | ||
| + | fi | ||
| + | |||
| + | rsync -avp --exclude " | ||
| + | if [ $? -ne 0 ]; then | ||
| + | echo "Error during rsync of ${PGDIR} to postgres@${SRVDEST}: | ||
| + | rc=1 | ||
| + | fi | ||
| + | |||
| + | psql --cluster ${VERSION}/ | ||
| + | if [ $? -ne 0 ]; then | ||
| + | echo " | ||
| + | rc=1 | ||
| + | fi | ||
| + | |||
| + | exit ${rc} | ||
| + | </ | ||
| + | |||
| + | Script de purge PITR : | ||
| + | <file bash / | ||
| + | #!/bin/bash | ||
| + | RETENTION=5 | ||
| + | # Suppression des snapshots de plus de $RETENTION jours | ||
| + | find / | ||
| + | |||
| + | # Suppression des WAL de plus de $RETENTION jours | ||
| + | find / | ||
| + | </ | ||
| + | |||
| + | Recovery.conf : | ||
| + | <file conf / | ||
| + | standby_mode = on | ||
| + | primary_conninfo = ' | ||
| + | restore_command = 'cp / | ||
| + | # pas de cleanup comme on a une sauvegarde pitr, ils seront purgés par le cron PITR | ||
| + | # pas de trigger file | ||
| + | </ | ||
| + | |||
| + | Template de recovery.conf : | ||
| + | <file conf / | ||
| + | standby_mode = on | ||
| + | primary_conninfo = ' | ||
| + | restore_command = 'cp / | ||
| + | # pas de cleanup comme on a une sauvegarde pitr, ils seront purgés par le cron PITR | ||
| + | # pas de trigger file | ||
| + | </ | ||
| + | |||
| + | Liens symboliques : | ||
| + | |||
| + | * /data -> / | ||
| + | * / | ||
| + | * /var/log -> / | ||
| + | * /var/www -> / | ||
| + | |||