update some content
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
"articleSection" : "post",
|
||||
"name" : "[筆記] 在Ubuntu 18.04 下 透過 pgbarman rsync\/ssh backup 備份 postgresql 10 \/ backup postgresql 10 with pgbarman via ssh\/rsync in ubuntu 18.04",
|
||||
"headline" : "[筆記] 在Ubuntu 18.04 下 透過 pgbarman rsync\/ssh backup 備份 postgresql 10 \/ backup postgresql 10 with pgbarman via ssh\/rsync in ubuntu 18.04",
|
||||
"description" : "\x3cp\x3e這篇繼續講 pgbarman 透過 rsync\/ssh 來備份 postgresql 資料庫的方式\x3c\/p\x3e",
|
||||
"description" : "\u003cp\u003e這篇繼續講 pgbarman 透過 rsync\/ssh 來備份 postgresql 資料庫的方式\u003c\/p\u003e",
|
||||
"inLanguage" : "en",
|
||||
"author" : "Eric Chang",
|
||||
"creator" : "Eric Chang",
|
||||
@@ -21,8 +21,8 @@
|
||||
"accountablePerson" : "Eric Chang",
|
||||
"copyrightHolder" : "Eric Chang",
|
||||
"copyrightYear" : "2019",
|
||||
"datePublished": "2019-08-23 14:54:13 \x2b0800 CST",
|
||||
"dateModified" : "2019-08-23 14:54:13 \x2b0800 CST",
|
||||
"datePublished": "2019-08-23 14:54:13 \u002b0800 CST",
|
||||
"dateModified" : "2019-08-23 14:54:13 \u002b0800 CST",
|
||||
"url" : "https:\/\/h.cowbay.org\/post\/pgbarman-in-ubuntu-1804-postgresql-10-via-ssh\/",
|
||||
"wordCount" : "487",
|
||||
"image" : "https://h.cowbay.orghttps://h.cowbay.org/images/post-default-4.jpg"",
|
||||
@@ -45,9 +45,9 @@
|
||||
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
|
||||
|
||||
<link href="https://h.cowbay.org/css/style.css?v=1632901489" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
|
||||
<link href="https://h.cowbay.org/css/style.css?v=1634607506" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
|
||||
|
||||
<link href="https://h.cowbay.org/css/custom.css?v=1632901489" rel="stylesheet" type='text/css' media='all'>
|
||||
<link href="https://h.cowbay.org/css/custom.css?v=1634607506" rel="stylesheet" type='text/css' media='all'>
|
||||
<link rel="shortcut icon" href="https://h.cowbay.org/img/favicon.ico" type="image/x-icon">
|
||||
<link rel="icon" href="https://h.cowbay.org/img/favicon.ico" type="image/x-icon">
|
||||
|
||||
@@ -314,7 +314,7 @@ if (!doNotTrack) {
|
||||
<h5 id="barmand">barman.d</h5>
|
||||
<p>在/etc/barman.d/ 底下新增一個hqs019-ssh.conf</p>
|
||||
<p>內容如下</p>
|
||||
<pre><code>[hqs019-ssh]
|
||||
<pre tabindex="0"><code>[hqs019-ssh]
|
||||
description = "hqs019 (via SSH)"
|
||||
ssh_command = ssh postgres@hqs019
|
||||
conninfo = host=hqs019 user=barman dbname=database_name
|
||||
@@ -324,18 +324,18 @@ parallel_jobs = 5
|
||||
archiver = on
|
||||
</code></pre><h5 id="postgresqlconf">postgresql.conf</h5>
|
||||
<p>新增跟barman有關的設定如下</p>
|
||||
<pre><code>### for barman test
|
||||
<pre tabindex="0"><code>### for barman test
|
||||
wal_level = 'archive'
|
||||
archive_mode = on
|
||||
archive_command = 'rsync -a %p barman@192.168.11.192:/var/lib/barman/hqs019-ssh/incoming/%f'
|
||||
</code></pre><p>理論上這樣就可以了,但是實際上碰到很多問題</p>
|
||||
<p>主要都是這個錯誤訊息</p>
|
||||
<pre><code>WAL archive: FAILED (please make sure WAL shipping is setup)
|
||||
<pre tabindex="0"><code>WAL archive: FAILED (please make sure WAL shipping is setup)
|
||||
</code></pre><p>碰到這狀況,google 都會告訴你,在 postgresql.conf 裡面 archive_command 的路徑,要和 barman server 上的設定一致
|
||||
<img src="https://i.imgur.com/3dMdytn.png" alt=""></p>
|
||||
<p>但是我的路徑就沒有問題,還是一直跳這個錯誤</p>
|
||||
<p>接著我又在 barman server 這邊做了這些事情</p>
|
||||
<pre><code>barman check hqs019-ssh
|
||||
<pre tabindex="0"><code>barman check hqs019-ssh
|
||||
barman check hqs019-ssh
|
||||
barman check hqs019-ssh
|
||||
ssh postgres@hqs019
|
||||
@@ -363,7 +363,7 @@ barman check hqs019
|
||||
<p>想說確認一下psql 連接是不是正確(也的確正確無誤)</p>
|
||||
<p>接著第一次 check 還是FAILED 喔,過沒多久我再跑一次 check 又正常了… WTF !!!</p>
|
||||
<p>只要check 正常,接著跑 backup 應該就會很順利</p>
|
||||
<pre><code>barman@barman:~$ barman backup hqs019-ssh
|
||||
<pre tabindex="0"><code>barman@barman:~$ barman backup hqs019-ssh
|
||||
Starting backup using rsync-exclusive method for server hqs019-ssh in /var/lib/barman/hqs019-ssh/base/20190823T113229
|
||||
Backup start at LSN: 264/B7000028 (0000000100000264000000B7, 00000028)
|
||||
This is the first backup for server hqs019-ssh
|
||||
@@ -383,10 +383,10 @@ Processing xlog segments from file archival for hqs019-ssh
|
||||
0000000100000264000000B7.00000028.backup
|
||||
barman@barman:~$
|
||||
</code></pre><p>檢查一下狀態</p>
|
||||
<pre><code>barman@barman:~$ barman list-backup hqs019-ssh
|
||||
<pre tabindex="0"><code>barman@barman:~$ barman list-backup hqs019-ssh
|
||||
hqs019-ssh 20190823T113229 - Thu Aug 22 20:38:13 2019 - Size: 132.9 GiB - WAL Size: 0 B (tablespaces: tablespace_a:/var/lib/postgresql/10/main/tablespace_A, tablespace_b:/var/lib/postgresql/10/main/tablespace_B)
|
||||
</code></pre><p>然後為了驗證是不是跑增量備份,所以再執行一次 backup</p>
|
||||
<pre><code>barman@barman:~$ barman backup hqs019-ssh
|
||||
<pre tabindex="0"><code>barman@barman:~$ barman backup hqs019-ssh
|
||||
Starting backup using rsync-exclusive method for server hqs019-ssh in /var/lib/barman/hqs019-ssh/base/20190823T132124
|
||||
Backup start at LSN: 264/B9000028 (0000000100000264000000B9, 00000028)
|
||||
Starting backup copy via rsync/SSH for 20190823T132124 (5 jobs)
|
||||
@@ -696,7 +696,7 @@ title="pinterest icon"></i>
|
||||
</div>
|
||||
<script src="https://h.cowbay.org/js/jquery.min.js"></script>
|
||||
<script src="https://h.cowbay.org/js/jquerymigrate.js"></script>
|
||||
<script src="https://h.cowbay.org/js/production.min.js?v=1632901489"></script>
|
||||
<script src="https://h.cowbay.org/js/production.min.js?v=1634607506"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user