londiste3:常用管理命令

之前 Blog 介绍了 Londsite 的搭建和以及 Londsite 的压力测试,今天介绍下 Londsite 常用管理命令,权当整理。

Londiste 程序的起停

1.1 语法

1
2
3
4
5
6
7
8
9
10
DAEMON OPTIONS

-r, --reload::
Reload config (send SIGHUP).

-s, --stop::
Stop program safely (send SIGINT).

-k, --kill::
Kill program immediately (send SIGTERM).

1.2 安全停止 Londsite

1
[pg91@redhat6 londiste]$ londiste3 -s s_skytf.ini

1.3 立即停止

1
[pg91@redhat6 londiste]$ londiste3 -k s_skytf.ini

1.4 启动 Londsite

1
[pg91@redhat6 londiste]$ londiste3 -d s_skytf.ini worker

1.5 重新加载配置文件

1
[pg91@redhat6 londiste]$ londiste3 -r s_skytf.ini

Londiste 节点管理命令

2.1 语法

1
2
3
4
5
6
7
8
pause
Pause the consumer: the replication of the events is stopped and can be resumed later.

resume
When the consumer has been paused, let it replay again.

change-provider <tonode>
Make <tonode> become the new provider for the current node.

2.2 暂停复制 pause

1
2
3
4
[pg91@redhat6 londiste]$ londiste3 s_skytf.ini pause
2013-04-01 15:05:37,256 14808 INFO [node_s] Consumer job_skytf tagged as paused
2013-04-01 15:05:37,260 14808 INFO Waiting for worker to accept
2013-04-01 15:05:38,269 14808 INFO Consumer 'job_skytf' on node 'node_s' paused

2.3 继续开启复制 resume

1
2
3
4
[pg91@redhat6 londiste]$ londiste3 s_skytf.ini resume
2013-04-01 15:07:14,132 14831 INFO [node_s] Consumer job_skytf tagged as resumed
2013-04-01 15:07:14,139 14831 INFO Waiting for worker to accept
2013-04-01 15:07:15,152 14831 INFO Consumer 'job_skytf' on node 'node_s' resumed

2.4 更改 provider 节点

change-provider 暂没实验,以后补上。

复制管理命令

3.1 语法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
add-table <table> [args]
Add the table to the replication.
See ADD ARGUMENTS below for the list of possible arguments.

remove-table <table>
Remove the table from the replication.

add-seq <seq> [args]
Add the sequence to the replication.
See ADD ARGUMENTS below for the list of possible arguments.

remove-seq <seq>
Remove the sequence from the replication.

resync <table>
Do full copy of the table, again.

3.2 添加表到复制队列

1
2
[pg91@redhat6 londiste]$ londiste3 s_skytf.ini add-table skytf.test_lond1
2013-04-01 14:00:59,608 14036 INFO Table added: skytf.test_lond1

3.3 从复制队列删除表

1
2
[pg91@redhat6 londiste]$ londiste3 s_skytf.ini remove-table skytf.test_lond1
2013-04-01 14:00:52,437 14030 INFO Table removed: skytf.test_lond1

3.4 添加序列到复制队列

1
2
[pg92@redhatB londiste]$ londiste3 p_skytf.ini add-seq skytf.seq_test_1
2013-04-01 14:06:26,565 20599 INFO Sequence added: skytf.seq_test_1

3.5 从复制队列删除序列

1
2
[pg92@redhatB londiste]$ londiste3 p_skytf.ini remove-seq skytf.seq_test_1
2013-04-01 14:13:19,371 20886 INFO Sequence removed: skytf.seq_test_1

3.6 重新订阅表数据(全量同步)

1
2
3
4
5
6
7
8
9
[pg91@redhat6 londiste]$ londiste3 s_skytf.ini resync skytf.test_lond3
2013-04-01 15:16:07,572 15047 INFO Table skytf.test_lond3 state set to NULL

[pg91@redhat6 londiste]$ londiste3 s_skytf.ini tables
Tables on node
table_name merge_state table_attrs
---------------- --------------- ---------------
skytf.test_lond2 ok
skytf.test_lond3 in-copy

备注: resync 会从新从源节点同步数据,因此会带来较大的 IO 操作。

显示复制相关信息

4.1 显示复制相关节点信息

1
2
3
4
5
6
7
8
9
[pg91@redhat6 londiste]$ londiste3 s_skytf.ini status
Queue: testing Local node: node_s

node_p (root)
| Tables: 3/0/0
| Lag: 45s, Tick: 1944
+--node_s (leaf)
Tables: 2/1/0
Lag: 45s, Tick: 1944

4.2 显示节点成员(节点名,状态,连接信息)

1
2
3
4
5
6
[pg91@redhat6 londiste]$ londiste3 s_skytf.ini members
Member info on node_s@testing:
node_name dead node_location
--------------- --------------- ---------------------------------------------------------------------------
node_p False host=192.168.1.36 port=1921 user=postgres password=postgres123 dbname=skytf
node_s False host=192.168.1.35 port=1923 user=postgres password=postgres123 dbname=skytf

4.3 显示已加入复制队列的表

1
2
3
4
5
6
[pg91@redhat6 londiste]$ londiste3 s_skytf.ini tables
Tables on node
table_name merge_state table_attrs
---------------- --------------- ---------------
skytf.test_lond2 ok
skytf.test_lond3 ok

4.4 显示已加入复制队列的序列

1
2
3
4
5
[pg91@redhat6 londiste]$ londiste3 s_skytf.ini seqs
Sequences on node
seq_name local last_value
--------------- --------------- ---------------
skytf.seq_1 True 30101

4.5 列出订阅节点尚未加入复制队列的对象

[pg91@redhat6 londiste]$ londiste3 s_skytf.ini missing
Missing objects on node
obj_kind     obj_name
--------------- ----------------
r        skytf.test_lond1   

参考

原创文章,作者:6024010,如若转载,请注明出处:https://blog.ytso.com/237950.html

(0)
上一篇 2022年1月29日
下一篇 2022年1月29日

相关推荐

发表回复

登录后才能评论