由于wal文件而空间不足

时间:2017-11-13 14:13:59

标签: postgresql

周末,我的postgresql服务器停止运行。经过一些故障排除后,我意识到我在1 TB驱动器上的空间不足。我有办法从中恢复过来吗?

  • 我没有空间暂时移动文件。删除中的任何一个都是安全的吗?
  • 使用Postgresql 10设置逻辑复制 - 我可以调整这些设置以防止再次发生这种情况吗?
  

/ pg_replslot = 395 GB

     

/ pg_wal = 283 GB

 - Settings -

wal_level = logical                     # 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 = 16MB                      # 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 = 40min # range 30s-1d
max_wal_size = 6GB
min_wal_size = 2GB
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


# - Sending Server(s) -

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

max_wal_senders = 3             # max number of walsender processes
                                # (change requires restart)
#wal_keep_segments = 0          # in logfile segments, 16MB each; 0 disables
#wal_sender_timeout = 60s       # in milliseconds; 0 disables

max_replication_slots = 4       # max number of replication slots

0 个答案:

没有答案