TiDB开启bilog

1.新建文件 scale-out.yaml

pump_servers:
  - host: 192.168.10.225
  - host: 192.168.10.226
  - host: 192.168.10.227
  
drainer_servers:
  - host: 192.168.10.228
  
    config:
      syncer.db-type: "mysql"
      syncer.to.host: "192.168.10.228"
      syncer.to.password: "xxx"

2.扩容安装pump_servers\drainer_servers

tiup cluster scale-out tidb-poly scale-out.yaml -user root -p

Starting component `cluster`: /root/.tiup/components/cluster/v1.12.1/tiup-cluster display tidb-poly
Cluster type:       tidb
Cluster name:       tidb-poly
Cluster version:    v6.6.0
Deploy user:        root
SSH type:           builtin
Dashboard URL:      http://192.168.10.225:2379/dashboard
Grafana URL:        http://192.168.10.228:3000
ID                    Role          Host            Ports        OS/Arch       Status  Data Dir                      Deploy Dir
--                    ----          ----            -----        -------       ------  --------                      ----------
192.168.10.228:9093   alertmanager  192.168.10.228  9093/9094    linux/x86_64  Up      /tidb-data/alertmanager-9093  /tidb-deploy/alertmanager-9093
192.168.10.225:8300   cdc           192.168.10.225  8300         linux/x86_64  Up      /tidb-data/cdc-8300           /tidb-deploy/cdc-8300
192.168.10.226:8300   cdc           192.168.10.226  8300         linux/x86_64  Up      /tidb-data/cdc-8300           /tidb-deploy/cdc-8300
192.168.10.227:8300   cdc           192.168.10.227  8300         linux/x86_64  Up      /tidb-data/cdc-8300           /tidb-deploy/cdc-8300
192.168.10.228:8249   drainer       192.168.10.228  8249         linux/x86_64  Up      /tidb-data/drainer-8249       /tidb-deploy/drainer-8249
192.168.10.228:3000   grafana       192.168.10.228  3000         linux/x86_64  Up      -                             /tidb-deploy/grafana-3000
192.168.10.225:2379   pd            192.168.10.225  2379/2380    linux/x86_64  Up|UI   /tidb-data/pd-2379            /tidb-deploy/pd-2379
192.168.10.226:2379   pd            192.168.10.226  2379/2380    linux/x86_64  Up      /tidb-data/pd-2379            /tidb-deploy/pd-2379
192.168.10.227:2379   pd            192.168.10.227  2379/2380    linux/x86_64  Up|L    /tidb-data/pd-2379            /tidb-deploy/pd-2379
192.168.10.228:9090   prometheus    192.168.10.228  9090/12020   linux/x86_64  Up      /tidb-data/prometheus-9090    /tidb-deploy/prometheus-9090
192.168.10.225:8250   pump          192.168.10.225  8250         linux/x86_64  Up      /tidb-data/pump-8250          /tidb-deploy/pump-8250
192.168.10.226:8250   pump          192.168.10.226  8250         linux/x86_64  Up      /tidb-data/pump-8250          /tidb-deploy/pump-8250
192.168.10.227:8250   pump          192.168.10.227  8250         linux/x86_64  Up      /tidb-data/pump-8250          /tidb-deploy/pump-8250
192.168.10.225:4000   tidb          192.168.10.225  4000/10080   linux/x86_64  Up      -                             /tidb-deploy/tidb-4000
192.168.10.226:4000   tidb          192.168.10.226  4000/10080   linux/x86_64  Up      -                             /tidb-deploy/tidb-4000
192.168.10.227:4000   tidb          192.168.10.227  4000/10080   linux/x86_64  Up      -                             /tidb-deploy/tidb-4000
192.168.10.225:20160  tikv          192.168.10.225  20160/20180  linux/x86_64  Up      /tidb-data/tikv-20160         /tidb-deploy/tikv-20160
192.168.10.226:20160  tikv          192.168.10.226  20160/20180  linux/x86_64  Up      /tidb-data/tikv-20160         /tidb-deploy/tikv-20160
192.168.10.227:20160  tikv          192.168.10.227  20160/20180  linux/x86_64  Up      /tidb-data/tikv-20160         /tidb-deploy/tikv-20160

3.在线编辑配置

tiup cluster edit-config tidb-poly
在global下新增

global:
  user: root
  ssh_port: 22
  ssh_type: builtin
  deploy_dir: /tidb-deploy
  data_dir: /tidb-data
  os: linux
server_config:
  tidb:
    binlog:
      enable: true
      ignore-error: true

4.重启reload

tiup cluster reload tidb-poly 

5.验证sql

show variables like "log_bin";

show pump status;

show drainer status;

你可能感兴趣的:(TiDB开启bilog)