日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

pg 10 wal 归档同步配置

發布時間:2025/3/20 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 pg 10 wal 归档同步配置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一.rsync server(172.16.3.226)?

CentOS 7.2 X64

# yum install -y rsync

# mkdir -p -m 0700 /db/wal_archive

# chown -R postgres.postgres /db/wal_archive


可能存在的問題:

修改目錄/db/wal_archive權限后仍報錯如下:

rsync: mkstemp "/.000000010000000000000001.2Z6cX4" (in archive) failed: Permission denied (13)


解決辦法:請查詢 /etc/selinux/config的SELINUX配置項:

SELINUX=disabled


2.rsync server(172.16.3.226)

1).修改配置

# vi /etc/rsyncd.conf

[root@localhost wal_archive]# vi /etc/rsyncd.conf?

# /etc/rsyncd: configuration file for rsync daemon mode


# See rsyncd.conf man page for more options.


# configuration example:


# uid = nobody

# gid = nobody

# use chroot = yes

# max connections = 4

# pid file = /var/run/rsyncd.pid

# exclude = lost+found/

# transfer logging = yes

# timeout = 900

# ignore nonreadable = yes

# dont compress ? = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2


# [ftp]

# ? ? ? ?path = /home/ftp

# ? ? ? ?comment = ftp export area

############# new add ##############

[archive]

# destination directory for copy

path = /db/wal_archive

# hosts you allow to access

hosts allow = 172.16.3.225

hosts deny = *

list = true

uid = postgres

gid = postgres

read only = false

[postgres@localhost wal_archive]#


2.啟動服務

# systemctl start rsyncd

# systemctl enable rsyncd?


二、傳輸文件


rync client(172.16.3.225)

1.安裝軟件

# yum install -y rsync

2.建立數據庫歸檔目錄

# mkdir -p -m 0700 /db/wal_archive

# chown -R postgres.postgres /db/wal_archive


3.同步腳本配置

1小時以外的wal同步

sync_archives.sh

#!bin/sh

export PATH=/bin:$PATH

find /db/wal_archive -name '0000*' -type f -mmin 60 | xargs -I{} rsync -avz {} 172.16.3.226::archive


歸檔刪除腳本

兩天以外的wal刪除

del_archives.sh

#!bin/sh

export PATH=/bin:$PATH

find /db/wal_archive -name '0000*' -type f -mtime +2 - delete


# crontab -e

* * * * * /opt/cron/sync_archives.sh

0 1 * * * /opt/cron/del_archives.sh


三、數據庫歸檔配置


#------------------------------------------------------------------------------

# WRITE AHEAD LOG

#------------------------------------------------------------------------------


# - Settings -


#wal_level = replica?? ? ? ? ? ? ? ? ? ?# minimal, replica, or logical

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # (change requires restart)

#fsync = on ? ? ? ? ? ? ? ? ? ? ? ? ? ? # flush data to disk for crash safety

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # (turning this off can cause

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # unrecoverable data corruption)

#synchronous_commit = on ? ? ? ? ? ? ? ?# synchronization level;

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # off, local, remote_write, remote_apply, or on

#wal_sync_method = fsync ? ? ? ? ? ? ? ?# the default is the first option

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # supported by the operating system:

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # ? open_datasync

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # ? fdatasync (default on Linux)

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # ? fsync

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # ? fsync_writethrough

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # ? open_sync

#full_page_writes = on ? ? ? ? ? ? ? ? ?# recover from partial page writes

#wal_compression = off ? ? ? ? ? ? ? ? ?# enable compression of full-page writes

#wal_log_hints = off ? ? ? ? ? ? ? ? ? ?# also do full page writes of non-critical updates

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # (change requires restart)

#wal_buffers = -1 ? ? ? ? ? ? ? ? ? ? ? # min 32kB, -1 sets based on shared_buffers

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # (change requires restart)

#wal_writer_delay = 200ms ? ? ? ? ? ? ? # 1-10000 milliseconds

#wal_writer_flush_after = 1MB ? ? ? ? ? # measured in pages, 0 disables


#commit_delay = 0 ? ? ? ? ? ? ? ? ? ? ? # range 0-100000, in microseconds

#commit_siblings = 5 ? ? ? ? ? ? ? ? ? ?# range 1-1000


# - Checkpoints -


#checkpoint_timeout = 5min ? ? ? ? ? ? ?# range 30s-1d

#max_wal_size = 1GB

#min_wal_size = 80MB

checkpoint_completion_target = 0.9 ? ? ?# checkpoint target duration, 0.0 - 1.0

#checkpoint_flush_after = 256kB ? ? ? ? # measured in pages, 0 disables

#checkpoint_warning = 30s ? ? ? ? ? ? ? # 0 disables


# - Archiving -


archive_mode = on?? ? ? ? ? ? ? # enables archiving; off, on, or always

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # (change requires restart)

archive_command = 'cp -an %p > /db/wal_archive/%f'?? ? ? ? ? ? ?# command to use to archive a logfile segment

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # placeholders: %p = path of file to archive

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # ? ? ? ? ? ? ? %f = file name only

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'

archive_timeout = 86400?? ? ? ? # force a logfile segment switch after this

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # number of seconds; 0 disables



#------------------------------------------------------------------------------

# REPLICATION

#------------------------------------------------------------------------------


# - Sending Server(s) -


# Set these on the master and on any standby that will send replication data.


max_wal_senders = 20 ? ? ? ? ?# max number of walsender processes

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?# (change requires restart)

wal_keep_segments = 1000? ? ? ?# in logfile segments, 16MB each; 0 disables

#wal_sender_timeout = 60s ? ? ? # in milliseconds; 0 disables


#max_replication_slots = 10 ? ? # max number of replication slots

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # (change requires restart)

#track_commit_timestamp = off ? # collect timestamp of transaction commit

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # (change requires restart)


版權聲明:原創作品,如需轉載,請注明出處。否則將追究法律責任 本文轉自 pgmia 51CTO博客,原文鏈接:http://blog.51cto.com/heyiyi/1929482

總結

以上是生活随笔為你收集整理的pg 10 wal 归档同步配置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 中文字幕在线免费观看视频 | 国产黄视频在线观看 | 黄色片在线免费 | 黄色网页免费观看 | 午夜va | 天天燥日日燥 | 国产精品污 | 爽妇综合网| av成人| 色乱码一区二区三区在线男奴 | 日本欧美在线视频 | 中文字幕第二页 | 国产成a人亚洲精品 | 极品少妇xxxx精品少妇 | 国产超碰人人 | 欧美成人做爰猛烈床戏 | av免费入口 | 成人性爱视频在线观看 | 不卡av在线播放 | 中文字字幕在线中文乱码 | 欧美精品在欧美一区二区少妇 | 亚洲性免费 | 欧美激情图| 色.com| 男人天堂2019 | 国产精品久久视频 | 爱操在线 | 欧美性猛交xxxx乱大交 | 九草网| a视频在线观看免费 | 国产精品无码一区二区三区 | 色网综合 | 日批动态图| av在线麻豆 | 欧美在线免费看 | 日本高清视频在线播放 | 成人免费看片网站 | 有码中文字幕 | 天天干夜夜做 | 暧暧视频在线观看 | 久久久无码精品亚洲国产 | 91麻豆精品国产91久久久无需广告 | 国产极品福利 | 亚洲成人免费网站 | 亚洲干干干 | 大陆极品少妇内射aaaaa | 人妻与黑人一区二区三区 | www夜夜| 少妇高潮一区二区三区99欧美 | 河北彩花中文字幕 | 亚洲一区二区免费在线观看 | 久久综合九色综合网站 | 国产乱码精品 | 老司机午夜视频 | 国产xxx| 久久天堂| 亚洲欧洲日韩综合 | 欧美三级电影在线观看 | 黑白配高清国语在线观看 | 日韩精品高清在线观看 | 涩久久 | 久久中文字幕精品 | 亚洲欧洲综合在线 | 久久99精品久久久久子伦 | 中文在线资源天堂 | 天天久久久 | 欧美手机在线视频 | 亚洲男人天堂网站 | 芒果视频在线观看免费 | 91精品999 | 激情图片网站 | 国产一区二区在线视频观看 | av中文字幕免费观看 | 欧美一区三区 | 在线免费观看av的网站 | 精品少妇久久 | 午夜激情小视频 | 久久久久久久久影院 | 欧美日韩一区二区三区视频 | 国产成人免费av一区二区午夜 | 激情婷婷小说 | 色91在线| 午夜tv影院| 一本色道无码道dvd在线观看 | 无码人妻精品一区二区三区蜜桃91 | 69亚洲精品 | 夜夜久久久 | 欧美一级欧美三级在线观看 | 女人性做爰24姿势视频 | 国产区一区二区三区 | 久久国产柳州莫菁门 | 在线观看成人黄色 | 亚洲av无码乱码在线观看性色 | 国产在线123| 天堂网色 | 羞羞涩涩视频 | 国产黄网在线观看 | 孕期1ⅴ1高h | 加勒比一区在线 |