This gist summarises a way to simulate point-in-time recovery (PITR) using WAL-G. Most of the material is adapted from Creston's tutorial.
First we initialize a database cluster
pg_ctl init -D cluster
| ## convert HTML POST data or HTTP GET query string to JSON | |
| ## get the raw post data from the AWS built-in variable and give it a nicer name | |
| #if ($context.httpMethod == "POST") | |
| #set($rawAPIData = $input.path('$')) | |
| #elseif ($context.httpMethod == "GET") | |
| #set($rawAPIData = $input.params().querystring) | |
| #set($rawAPIData = $rawAPIData.toString()) | |
| #set($rawAPIDataLength = $rawAPIData.length() - 1) | |
| #set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength)) |
| obj-m += tcp_svr_sample.o | |
| all: | |
| make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules | |
| clean: | |
| make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clea |
| ############## | |
| # xprintidle # | |
| ############## | |
| # install xprintidle dependencies | |
| sudo yum -y install libXScrnSaver-devel libX11-devel | |
| # download xprintidle source | |
| wget https://launchpad.net/ubuntu/+archive/primary/+files/xprintidle_0.2.orig.tar.gz | |
| # extract | |
| tar -xf xprintidle_0.2.orig.tar.gz | |
| cd xprintidle-0.2/ |
| #!/bin/sh | |
| TMPFILE="/tmp/innobackupex-runner.$$.tmp" | |
| USEROPTIONS="--user=XXX --password=XXX" | |
| FILTERTABLES="--include=.*[.].*" | |
| BACKDIR=/var/mysql-bak | |
| BASEBACKDIR=$BACKDIR/base | |
| INCRBACKDIR=$BACKDIR/incr | |
| FULLBACKUPLIFE=3600 #604800 # How long to keep incrementing a backup for, minimum 60 | |
| KEEP=1 # Keep this number of backups, appart form the one currently being incremented |
| --- | |
| # ^^^ YAML documents must begin with the document separator "---" | |
| # | |
| #### Example docblock, I like to put a descriptive comment at the top of my | |
| #### playbooks. | |
| # | |
| # Overview: Playbook to bootstrap a new host for configuration management. | |
| # Applies to: production | |
| # Description: | |
| # Ensures that a host is configured for management with Ansible. |
| #! /usr/bin/perl | |
| # | |
| # to test: | |
| # 1) run this script with either "accept" or "select-accept" as the argument | |
| # (the script listens to 127.0.0.1:12345) | |
| # 2) telnet localhost 12345 | |
| # 3) if you see "accept failed", there is the thundering herd problem | |
| # | |
| # | |
| use strict; |
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| import datetime | |
| import json | |
| import logging | |
| import os | |
| import socket | |
| import time |
| vrrp_script chk_redis_master { | |
| script "redis-cli info replication | grep -q 'role:master'" | |
| interval 2 | |
| weight 2 | |
| rise 2 | |
| fall 2 | |
| } | |
| vrrp_instance redis_vip { | |
| interface eth0 |
| # Change the path below to your own audit log path. | |
| /var/log/vault/audit.log { | |
| rotate 30 | |
| daily | |
| # Do not execute rotate if the log file is empty. | |
| notifempty | |
| missingok | |
| compress | |
| # Set compress on next rotate cycl to prevent entry loss when performing compression. | |
| delaycompress |
This gist summarises a way to simulate point-in-time recovery (PITR) using WAL-G. Most of the material is adapted from Creston's tutorial.
First we initialize a database cluster
pg_ctl init -D cluster