<pre><code>kvm: -drive file=/zp/images/100/vm-100-disk-1.qcow2,if=none,id=drive-virtio0,format=qcow2,cache=none,aio=native,detect-zeroes=on: file system may not support O_DIRECT
<pretabindex="0"><code>kvm: -drive file=/zp/images/100/vm-100-disk-1.qcow2,if=none,id=drive-virtio0,format=qcow2,cache=none,aio=native,detect-zeroes=on: file system may not support O_DIRECT
kvm: -drive file=/zp/images/100/vm-100-disk-1.qcow2,if=none,id=drive-virtio0,format=qcow2,cache=none,aio=native,detect-zeroes=on: Could not open '/zp/images/100/vm-100-disk-1.qcow2': Invalid argument
<h3id="strongfont-colorred必須手動設定路由fontstrong"><!-- raw HTML omitted --><!-- raw HTML omitted -->必須手動設定路由<!-- raw HTML omitted --><!-- raw HTML omitted --></h3>
<h4id="update">Update</h4>
<pre><code>這邊可能是我有誤解,應該不需要先在pve 本機設定 10G網卡的 IP
<pretabindex="0"><code>這邊可能是我有誤解,應該不需要先在pve 本機設定 10G網卡的 IP
"description" : "\x3cp\x3e在上一篇 \x3ca href=\x22https:\/\/h.cowbay.org\/post\/ansible-selectattr\/\x22\x3eAnsible how to use \x26lsquo;list\x26rsquo; in yaml file \x3c\/a\x3e\x3c\/p\x3e\n\x3cp\x3e有提到怎麼用 with_items \/ set_fact 來取得在yaml 檔案中的清單\x3c\/p\x3e\n\x3cp\x3e不過就是有點醜\x3c\/p\x3e",
"description" : "\u003cp\u003e在上一篇 \u003ca href=\u0022https:\/\/h.cowbay.org\/post\/ansible-selectattr\/\u0022\u003eAnsible how to use \u0026lsquo;list\u0026rsquo; in yaml file \u003c\/a\u003e\u003c\/p\u003e\n\u003cp\u003e有提到怎麼用 with_items \/ set_fact 來取得在yaml 檔案中的清單\u003c\/p\u003e\n\u003cp\u003e不過就是有點醜\u003c\/p\u003e",
<divclass="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><codeclass="language-yaml"data-lang="yaml">- <spanstyle="color:#66d9ef">name</span>: set dc_users
Tuesday 24 December 2019 14:28:58 +0800 (0:00:00.067) 0:00:00.946 ******
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Exception: b'Error: no DISPLAY environment variable specified\n'
<p>DNS 管理基本上都是大同小異啦,可是namecheap 免費賬戶不提供 API ,應該說要使用namecheap 提供的API ,需要滿足以下的條件</p>
<pre><code>I want to enable API for my account. Are there any specific requirements?
<pretabindex="0"><code>I want to enable API for my account. Are there any specific requirements?
We have certain requirements for activation to prevent system abuse. In order to have API enabled for your account, you should meet one of the following requirements:
2019-09-04 16:41:17.697 P00 INFO: last backup label = 20190904-134245F, version = 2.16
2019-09-04 16:41:18.607 P00 INFO: execute non-exclusive pg_start_backup() with label "pgBackRest backup started at 2019-09-04 16:41:17": backup begins after the next regular checkpoint completes
@ -425,7 +425,7 @@ WARN: a timeline switch has occurred since the last backup, enabling delta check
<pre><code>2019-09-10 13:24:03 [minion@hqdc075 ~]$ for i in {4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384};do sudo dd if=/dev/zero of=/mnt/"$i"k bs="$i"k count=1k;done
<pretabindex="0"><code>2019-09-10 13:24:03 [minion@hqdc075 ~]$ for i in {4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384};do sudo dd if=/dev/zero of=/mnt/"$i"k bs="$i"k count=1k;done
<pre><code>The default language for this Metabase instance.This only applies to emails, Pulses, etc. Users' browsers will specify the language used in the user interface.
<pretabindex="0"><code>The default language for this Metabase instance.This only applies to emails, Pulses, etc. Users' browsers will specify the language used in the user interface.
<divclass="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><codeclass="language-shell"data-lang="shell">swconfig dev switch0 show
<divclass="highlight"><pretabindex="0"style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><codeclass="language-shell"data-lang="shell">swconfig dev switch0 show
<divclass="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><codeclass="language-shell"data-lang="shell">root@OpenWrt-15:~# swconfig dev switch0 show
<divclass="highlight"><pretabindex="0"style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><codeclass="language-shell"data-lang="shell">root@OpenWrt-15:~# swconfig dev switch0 show
<pre><code>PG-Strom module must be loaded on startup of the postmaster process by the shared_preload_libraries. Unable to load it on demand. Therefore, you must add the configuration below.
<pretabindex="0"><code>PG-Strom module must be loaded on startup of the postmaster process by the shared_preload_libraries. Unable to load it on demand. Therefore, you must add the configuration below.
<divclass="highlight"><pretabindex="0"style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><codeclass="language-YAML"data-lang="YAML"><spanstyle="color:#75715e">######### use inxi instead ##################</span>
- <spanstyle="color:#f92672">name</span>: <spanstyle="color:#ae81ff">copy inxi binary to remote Ubnutu/Debian</span>
07:21:33 INFO Managing PostgreSQL installation at "/var/lib/postgresql/11/main"
07:21:33 INFO The version of extenstion "pgautofailover" is "1.0" on the monitor
07:21:33 INFO pg_autoctl service is starting
@ -465,7 +465,7 @@ pg_basebackup: base backup completed
07:21:34 INFO Calling node_active for node default/2/0 with current state: secondary, PostgreSQL is running, sync_state is "", WAL delta is 0.
07:21:39 INFO Calling node_active for node default/2/0 with current state: secondary, PostgreSQL is running, sync_state is "", WAL delta is 0.
</code></pre><p>開新視窗確認狀態</p>
<pre><code>2019-09-19 07:22:03 [administrator@pg-slave ~]$ sudo runuser -l postgres -c "pg_autoctl show state --pgdata /var/lib/postgresql/11/main"
<pretabindex="0"><code>2019-09-19 07:22:03 [administrator@pg-slave ~]$ sudo runuser -l postgres -c "pg_autoctl show state --pgdata /var/lib/postgresql/11/main"
Name | Port | Group | Node | Current State | Assigned State
<pre><code>03:06:02 INFO Calling node_active for node default/4/0 with current state: secondary, PostgreSQL is running, sync_state is "", WAL delta is 0.
<pretabindex="0"><code>03:06:02 INFO Calling node_active for node default/4/0 with current state: secondary, PostgreSQL is running, sync_state is "", WAL delta is 0.
03:06:08 INFO Calling node_active for node default/4/0 with current state: secondary, PostgreSQL is running, sync_state is "", WAL delta is 0.
03:06:13 INFO Calling node_active for node default/4/0 with current state: secondary, PostgreSQL is running, sync_state is "", WAL delta is 0.
03:06:18 ERROR PostgreSQL cannot reach the primary server: the system view pg_stat_wal_receiver has no rows.
@ -605,7 +605,7 @@ postgres=#
03:06:38 ERROR PostgreSQL cannot reach the primary server: the system view pg_stat_wal_receiver has no rows.
03:06:38 INFO Calling node_active for node default/4/0 with current state: secondary, PostgreSQL is running, sync_state is "", WAL delta is -1.
11:12:29 INFO Managing PostgreSQL installation at "/var/lib/postgresql/11/main"
11:12:29 INFO The version of extenstion "pgautofailover" is "1.0" on the monitor
11:12:29 INFO pg_autoctl service is starting
@ -693,7 +693,7 @@ pg_basebackup: base backup completed
11:13:03 INFO Calling node_active for node default/1/0 with current state: secondary, PostgreSQL is running, sync_state is "", WAL delta is 0.
<pre><code>03:12:34 INFO Calling node_active for node default/4/0 with current state: wait_primary, PostgreSQL is running, sync_state is "async", WAL delta is 0.
<pretabindex="0"><code>03:12:34 INFO Calling node_active for node default/4/0 with current state: wait_primary, PostgreSQL is running, sync_state is "async", WAL delta is 0.
03:12:39 INFO Calling node_active for node default/4/0 with current state: wait_primary, PostgreSQL is running, sync_state is "async", WAL delta is 0.
03:12:45 INFO Calling node_active for node default/4/0 with current state: wait_primary, PostgreSQL is running, sync_state is "async", WAL delta is 0.
03:12:50 INFO Calling node_active for node default/4/0 with current state: wait_primary, PostgreSQL is running, sync_state is "async", WAL delta is 0.
@ -704,7 +704,7 @@ pg_basebackup: base backup completed
03:12:55 INFO Calling node_active for node default/4/0 with current state: primary, PostgreSQL is running, sync_state is "sync", WAL delta is 0.
<pre><code>Sep 20 14:59:34 pg-primary systemd[1]: Started pg_auto_failover.
<pretabindex="0"><code>Sep 20 14:59:34 pg-primary systemd[1]: Started pg_auto_failover.
Sep 20 14:59:34 pg-primary pg_autoctl[7817]: 14:59:34 INFO Managing PostgreSQL installation at "/var/lib/postgresql/11/main"
Sep 20 14:59:34 pg-primary pg_autoctl[7817]: 14:59:34 INFO Found a stale pidfile at "/tmp/pg_autoctl/var/lib/postgresql/11/main/pg_autoctl.pid"
Sep 20 14:59:34 pg-primary pg_autoctl[7817]: 14:59:34 WARN Removing the stale pid file "/tmp/pg_autoctl/var/lib/postgresql/11/main/pg_autoctl.pid"
15:14:22 INFO Calling node_active for node default/1/0 with current state: secondary, PostgreSQL is running, sync_state is "", WAL delta is 0.
15:14:27 INFO Calling node_active for node default/1/0 with current state: secondary, PostgreSQL is running, sync_state is "", WAL delta is 0.
15:14:32 INFO Calling node_active for node default/1/0 with current state: secondary, PostgreSQL is running, sync_state is "", WAL delta is 0.
@ -921,7 +921,7 @@ sudo service pgautofailover restart
15:16:39 INFO pg_autoctl service stopping
2019-09-20 15:23:29 [administrator@pg-primary ~]$
</code></pre><p>可是我的服務活著啊!</p>
<pre><code>2019-09-20 15:23:29 [administrator@pg-primary ~]$ sudo service pgautofailover status
<pretabindex="0"><code>2019-09-20 15:23:29 [administrator@pg-primary ~]$ sudo service pgautofailover status
Sep 20 07:25:32 pg-slave pg_autoctl[5840]: 07:25:32 INFO Calling node_active for node default/4/0 with current state: primary, PostgreSQL is running, sync_state is "sync", WAL delta is 0.
Sep 20 07:25:37 pg-slave pg_autoctl[5840]: 07:25:37 INFO Calling node_active for node default/4/0 with current state: primary, PostgreSQL is running, sync_state is "sync", WAL delta is 0.
<pre><code>On a general basis, starting from Barman 2.0, backup over streaming replication is the recommended setup for PostgreSQL 9.4 or higher
<pretabindex="0"><code>On a general basis, starting from Barman 2.0, backup over streaming replication is the recommended setup for PostgreSQL 9.4 or higher
The reason why we recommend streaming backup is that, based on our experience, it is easier to setup than the traditional one
</code></pre><p>事實上呢,設定的確是很簡單,可是有個致命的缺點</p>
<pre><code>Because Barman transparently makes use of pg_basebackup, features such as incremental backup, parallel backup, deduplication, and network compression are currently not available. In this case, bandwidth limitation has some restrictions - compared to the traditional method via rsync.
<pretabindex="0"><code>Because Barman transparently makes use of pg_basebackup, features such as incremental backup, parallel backup, deduplication, and network compression are currently not available. In this case, bandwidth limitation has some restrictions - compared to the traditional method via rsync.
<pre><code>postgres@hqdc034:~$ psql -c 'with aa as ( select * from generate_series (1,1000000) a ) insert into test select aa.a, md5(aa.a::varchar) from aa;'
<pretabindex="0"><code>postgres@hqdc034:~$ psql -c 'with aa as ( select * from generate_series (1,1000000) a ) insert into test select aa.a, md5(aa.a::varchar) from aa;'
INSERT 0 1000000
postgres@hqdc034:~$ psql -c 'select count(*) from test;'
<pre><code>postgres@hqdc034:~$ time psql -c 'with aa as ( select * from generate_series (1,1000000) a ) insert into test select aa.a, md5(aa.a::varchar) from aa;'
<pretabindex="0"><code>postgres@hqdc034:~$ time psql -c 'with aa as ( select * from generate_series (1,1000000) a ) insert into test select aa.a, md5(aa.a::varchar) from aa;'
<pre><code>postgres@hqdc034:~$ time psql -c 'with aa as ( select * from generate_series (1,8000000) a ) insert into test select aa.a, md5(aa.a::varchar) from aa;'
<pretabindex="0"><code>postgres@hqdc034:~$ time psql -c 'with aa as ( select * from generate_series (1,8000000) a ) insert into test select aa.a, md5(aa.a::varchar) from aa;'
2019-09-06 10:18:57 [changch@hqdc034 ~]$ sudo zfs list -t snapshot
@ -519,7 +519,7 @@ sys 0m0.008s
postgres@hqdc034:~$
</code></pre><p>啊,我剛剛應該先clone的….
沒關係,我們再做一次,新增800萬筆資料,湊齊1000萬筆,然後快照</p>
<pre><code>postgres@hqdc034:~$ time psql -c 'with aa as ( select * from generate_series (1,8000000) a ) insert into test select aa.a, md5(aa.a::varchar) from aa;'
<pretabindex="0"><code>postgres@hqdc034:~$ time psql -c 'with aa as ( select * from generate_series (1,8000000) a ) insert into test select aa.a, md5(aa.a::varchar) from aa;'
"name" : "[筆記] postgresql 效能測試 \/ postgresql benchmakr using pgbench",
"headline" : "[筆記] postgresql 效能測試 \/ postgresql benchmakr using pgbench",
"description" : "\x3cp\x3e昨天老闆在slack 上面問說現在的幾台 DB Server 有沒有跑過 pgbench\x3c\/p\x3e\n\x3cp\x3e分數大概如何,想要跟他的筆電做個比較\x3c\/p\x3e\n\x3cp\x3e之前有跑過幾次,這次就順便測試一下不同的硬體配置、以及不同的軟體版本\x3c\/p\x3e\n\x3cp\x3e對於pgbench 跑分會有多大的影響\x3c\/p\x3e",
"description" : "\u003cp\u003e昨天老闆在slack 上面問說現在的幾台 DB Server 有沒有跑過 pgbench\u003c\/p\u003e\n\u003cp\u003e分數大概如何,想要跟他的筆電做個比較\u003c\/p\u003e\n\u003cp\u003e之前有跑過幾次,這次就順便測試一下不同的硬體配置、以及不同的軟體版本\u003c\/p\u003e\n\u003cp\u003e對於pgbench 跑分會有多大的影響\u003c\/p\u003e",
"name" : "[筆記] 在edgerouter上用wireguard 建立site to site VPN \/ Site to Site Vpn Using Wireguard in Two Edgerouters",
"headline" : "[筆記] 在edgerouter上用wireguard 建立site to site VPN \/ Site to Site Vpn Using Wireguard in Two Edgerouters",
"description" : "\x3cp\x3e之前總部和分公司之間 是用buffalo 的小AP 灌 openwrt\x3c\/p\x3e\n\x3cp\x3e然後用strongswan 來打 IPSEC site to site VPN\x3c\/p\x3e\n\x3cp\x3econfig 看起來不是很難 (只是看起來)\x3c\/p\x3e\n\x3cp\x3e但是實際上已經找不到當初的文件\x3c\/p\x3e\n\x3cp\x3e所以要維護很困難(光那些RSA KEY 就不知道為何、如何產生)\x3c\/p\x3e\n\x3cp\x3e後來採購了兩台edgerouter X 做測試\x3c\/p\x3e\n\x3cp\x3e也用openvpn 成功的建立了 site to site VPN\x3c\/p\x3e\n\x3cp\x3e本來想說 openvpn 已經夠簡單了\x3c\/p\x3e\n\x3cp\x3e今天看到文章說用wireguard 可以更簡單\x3c\/p\x3e\n\x3cp\x3e於是研究了一下,發現還真的很簡單!\x3c\/p\x3e",
"description" : "\u003cp\u003e之前總部和分公司之間 是用buffalo 的小AP 灌 openwrt\u003c\/p\u003e\n\u003cp\u003e然後用strongswan 來打 IPSEC site to site VPN\u003c\/p\u003e\n\u003cp\u003econfig 看起來不是很難 (只是看起來)\u003c\/p\u003e\n\u003cp\u003e但是實際上已經找不到當初的文件\u003c\/p\u003e\n\u003cp\u003e所以要維護很困難(光那些RSA KEY 就不知道為何、如何產生)\u003c\/p\u003e\n\u003cp\u003e後來採購了兩台edgerouter X 做測試\u003c\/p\u003e\n\u003cp\u003e也用openvpn 成功的建立了 site to site VPN\u003c\/p\u003e\n\u003cp\u003e本來想說 openvpn 已經夠簡單了\u003c\/p\u003e\n\u003cp\u003e今天看到文章說用wireguard 可以更簡單\u003c\/p\u003e\n\u003cp\u003e於是研究了一下,發現還真的很簡單!\u003c\/p\u003e",
<pre><code>RAID 1 is pure mirroring. No matter how many drives you add to RAID 1, the size never increases. What you increase is how many drives can fail and how good your read performance is.
<pretabindex="0"><code>RAID 1 is pure mirroring. No matter how many drives you add to RAID 1, the size never increases. What you increase is how many drives can fail and how good your read performance is.