# Using TiDB Binlog - Binlogctl Tool

__*binglogctl*__
__*Status of Pump/Drainer*__

+ Check the status of all pumps/drainers
    + bin/binlogctl -pd-urls= http://127.0.0.1:2379 -cmd pumps
    + bin/binlogctl -pd-urls= http://127.0.0.1:2379 -cmd drainers

-------------------------------------------------------------
Check the status of all pumps/drainers:
Set cmd to pumps or drainers to view the status of all pumps or drainers. For example:
bin/binlogctl -pd-urls= http://127.0.0.1:2379 -cmd pumps
[2019/04/28 09:29:59 .016 + 00:00] [INFO] [nodes.go:48] ["query node"] [type=pump] [node=" {nodeID: 1.1.1. 1:8250, Addr: pump: 8250, State :online, MaxCommitts:408012403141509121, UpdateTime: 2019-04-28 09:29:57 +0000 UTC} "]

bin/binlogctl -pd-urls= http://127.0.0.1:2379 -cmd drainers
[2019/04/28 09:29:59 .016 + 00:00] [INFO] [nodes.go:48] ["query node"] [type=drainer] [node= "{nodeID: 1.1.1. 1:8249, Addr: 1.1.1. 1:8249, State:online, MaxCommitts:408012403141509121, UpdateTime: 2019-04-28 09:29:57 +0000 UTC} "]

Suspended/Offline Pump/Drainer
binlogctl provides the following command to pause/take down the service:
cmd specification example
pause-pump pause pump bin/binlogctl -pd-urls= http://127.0.0.1:2379 -cmd pause-pump -node-id ip-127-0- 0-1:8250
pause-drainer suspend drainer bin/binlogctl -pd-urls= http://127.0.0.1:2379 -cmd pause-drainer -node-id ip-127-0- 0-1:8249
offline-pump offline pump bin/binlogctl -pd-urls= http://127.0.0.1:2379 -cmd offline-pump -node-id ip-127-0- 0-1:8250
offline-drainer offline drainer bin/binlogctl -pd-urls= http://127.0.0.1:2379 -cmd offline-drainer -node-id ip-127-0- 0-1:8249

binlogctl will send an HTTP request to Pump/Drainer, and Pump/Drainer will actively execute the corresponding exit process after receiving the command.