本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
了解 pgactive 結構描述
pgactive 結構描述會管理 RDS for PostgreSQL 中的主動-主動複寫。此結構描述包含存放複寫組態和狀態資訊的資料表。
注意
pgactive 結構描述正在演進,可能會有所變更。請勿直接修改這些資料表中的資料。
pgactive 結構描述中的索引鍵資料表包括:
-
pgactive_nodes
– 存放主動-主動複寫群組中節點的相關資訊。 -
pgactive_connections
– 儲存每個節點的連線詳細資訊。
pgactive_nodes
pgactive_nodes 會儲存參與主動-主動複寫群組之節點的相關資訊。
資料行 |
Type |
定序 |
Nullable |
預設 |
---|---|---|---|---|
node_sysid | text | – | 不是 null | – |
node_timeline | oid | – | 不是 null | – |
node_dboid | oid | – | 不是 null | – |
node_status | char | – | 不是 null | – |
node_name | text | – | 不是 null | – |
node_dsn | text | – | 不是 null | – |
node_init_from_dsn | text | – | 不是 null | – |
node_read_only | boolean | – | – | false |
node_seq_id | smallint | – | 不是 null | – |
- node_sysid
-
節點的唯一 ID,在
pgactive_create_group
或 期間產生pgactive_join_group
- node_status
-
節點的準備度:
-
b - 開始設定
-
i - 初始化
-
c - 補上
-
o - 建立傳出插槽
-
r - 就緒
-
k - 已終止
注意
此欄不會指出節點是否已連線或中斷連線。
-
- node_name
-
使用者提供的唯一節點名稱。
- node_dsn
-
連線字串或使用者映射名稱
- node_init_from_dsn
-
建立此節點的 DSN。
pgactive_connection
pgactive_connections 會儲存每個節點的連線詳細資訊。
資料行 | Type | 定序 | Nullable | 預設 |
---|---|---|---|---|
conn_sysid | text | 無 | 不是 null | 無 |
conn_timeline | oid | 無 | 不是 null | 無 |
conn_dboid | oid | 無 | 不是 null | 無 |
conn_dsn | text | 無 | 不是 null | 無 |
conn_apply_delay | integer | 無 | 無 | 無 |
conn_replication_sets | text | 無 | 無 | 無 |
- conn_sysid
-
此項目所指節點的節點識別符。
- conn_dsn
-
與 pgactive.pgactive_nodes 相同
node_dsn
。 - conn_apply_delay
-
如果設定,在從遠端節點套用每個交易之前,要等待幾毫秒。主要用於偵錯。如果為 null,則套用全域預設值。
使用複寫集
複寫集會決定要從複寫操作中包含或排除哪些資料表。根據預設,除非您使用下列函數另外指定,否則所有資料表都會複寫:
-
pgactive_exclude_table_replication_set()
- 從複寫中排除指定的資料表 -
pgactive_include_table_replication_set()
- 在複寫中包含指定的資料表
注意
設定複寫集之前,請考慮下列事項:
-
您只能在執行 之後
pgactive_create_group()
但在 之前設定資料表包含或排除pgactive_join_group()
。 -
使用 之後
pgactive_exclude_table_replication_set()
,您就無法使用pgactive_include_table_replication_set()
。 -
使用 之後
pgactive_include_table_replication_set()
,您就無法使用pgactive_exclude_table_replication_set()
。
系統會根據您的初始組態,以不同的方式處理新建立的資料表:
-
如果您排除資料表:在 之後建立的任何新資料表
pgactive_join_group()
都會自動包含在複寫中 -
如果您包含資料表:在 建立的任何新資料表
pgactive_join_group()
都會自動從複寫中排除。
若要檢視特定資料表的複寫集組態,請使用 pgactive.pgactive_get_table_replication_sets()
函數。