From bda5ac198231aeb24ee78196698e6f6cb9f4f063 Mon Sep 17 00:00:00 2001 From: liubo Date: Wed, 28 Aug 2019 17:44:26 +0800 Subject: [PATCH] Update binlog (#920) (#921) * Update binlog --- conf/drainer-kafka.toml | 62 ------------------- conf/{drainer-cluster.toml => drainer.toml} | 0 conf/{pump-cluster.yml => pump.yml} | 0 deploy_drainer.yml | 2 +- .../defaults/main.yml | 0 .../files/make-ssl.sh | 0 .../meta/main.yml | 0 .../tasks/binary_deployment.yml | 0 .../tasks/check_certs.yml | 0 .../tasks/gen_certs.yml | 0 .../tasks/install_certs.yml | 0 .../tasks/main.yml | 10 +-- .../tasks/supervise_deployment.yml | 0 .../tasks/systemd_deployment.yml | 0 .../templates/run_drainer_binary.sh.j2 | 0 .../vars/default.yml | 0 roles/pump/tasks/main.yml | 2 +- 17 files changed, 7 insertions(+), 69 deletions(-) delete mode 100644 conf/drainer-kafka.toml rename conf/{drainer-cluster.toml => drainer.toml} (100%) rename conf/{pump-cluster.yml => pump.yml} (100%) rename roles/{drainer_cluster => drainer}/defaults/main.yml (100%) rename roles/{drainer_cluster => drainer}/files/make-ssl.sh (100%) rename roles/{drainer_cluster => drainer}/meta/main.yml (100%) rename roles/{drainer_cluster => drainer}/tasks/binary_deployment.yml (100%) rename roles/{drainer_cluster => drainer}/tasks/check_certs.yml (100%) rename roles/{drainer_cluster => drainer}/tasks/gen_certs.yml (100%) rename roles/{drainer_cluster => drainer}/tasks/install_certs.yml (100%) rename roles/{drainer_cluster => drainer}/tasks/main.yml (83%) rename roles/{drainer_cluster => drainer}/tasks/supervise_deployment.yml (100%) rename roles/{drainer_cluster => drainer}/tasks/systemd_deployment.yml (100%) rename roles/{drainer_cluster => drainer}/templates/run_drainer_binary.sh.j2 (100%) rename roles/{drainer_cluster => drainer}/vars/default.yml (100%) diff --git a/conf/drainer-kafka.toml b/conf/drainer-kafka.toml deleted file mode 100644 index 9df556d5e..000000000 --- a/conf/drainer-kafka.toml +++ /dev/null @@ -1,62 +0,0 @@ -# drainer Configuration. - -# the interval time (in seconds) of detect pumps' status -detect-interval = 10 - -# syncer Configuration. -[syncer] - -# disable sync these schema -ignore-schemas = "INFORMATION_SCHEMA,PERFORMANCE_SCHEMA,mysql" - -# number of binlog events in a transaction batch -txn-batch = 20 - -# work count to execute binlogs -# if the latency between drainer and downstream(mysql or tidb) are too high, you might want to increase this -# to get higher throughput by higher concurrent write to the downstream -worker-count = 16 - -disable-dispatch = false - -# safe mode will split update to delete and insert -safe-mode = false - -# downstream storage, equal to --dest-db-type -# valid values are "mysql", "file", "tidb", "flash", "kafka" -db-type = "mysql" - -##replicate-do-db priority over replicate-do-table if have same db name -##and we support regex expression , start with '~' declare use regex expression. -# -#replicate-do-db = ["~^b.*","s1"] -#[[syncer.replicate-do-table]] -#db-name ="test" -#tbl-name = "log" - -#[[syncer.replicate-do-table]] -#db-name ="test" -#tbl-name = "~^a.*" - -# the downstream mysql protocol database -[syncer.to] -host = "127.0.0.1" -user = "root" -password = "" -port = 3306 - -# Uncomment this if you want to use file as db-type. -#[syncer.to] -#dir = "data.drainer" - -# when db-type is kafka, you can uncomment this to config the down stream kafka, it will be the globle config kafka default -#[syncer.to] -# only need config one of zookeeper-addrs and kafka-addrs, will get kafka address if zookeeper-addrs is configed. -# zookeeper-addrs = "127.0.0.1:2181" -# kafka-addrs = "127.0.0.1:9092" -# kafka-version = "0.8.2.0" -# kafka-max-messages = 1024 - -# the topic name drainer will push msg, the default name is _obinlog -# be careful don't use the same name if run multi drainer instances -# topic-name = "" diff --git a/conf/drainer-cluster.toml b/conf/drainer.toml similarity index 100% rename from conf/drainer-cluster.toml rename to conf/drainer.toml diff --git a/conf/pump-cluster.yml b/conf/pump.yml similarity index 100% rename from conf/pump-cluster.yml rename to conf/pump.yml diff --git a/deploy_drainer.yml b/deploy_drainer.yml index 3eb1edf0f..13e309c9c 100644 --- a/deploy_drainer.yml +++ b/deploy_drainer.yml @@ -43,7 +43,7 @@ tags: - drainer roles: - - { role: drainer_cluster, when: enable_binlog|default(false) } + - { role: drainer, when: enable_binlog|default(false) } - name: finalizing deployment target hosts: all diff --git a/roles/drainer_cluster/defaults/main.yml b/roles/drainer/defaults/main.yml similarity index 100% rename from roles/drainer_cluster/defaults/main.yml rename to roles/drainer/defaults/main.yml diff --git a/roles/drainer_cluster/files/make-ssl.sh b/roles/drainer/files/make-ssl.sh similarity index 100% rename from roles/drainer_cluster/files/make-ssl.sh rename to roles/drainer/files/make-ssl.sh diff --git a/roles/drainer_cluster/meta/main.yml b/roles/drainer/meta/main.yml similarity index 100% rename from roles/drainer_cluster/meta/main.yml rename to roles/drainer/meta/main.yml diff --git a/roles/drainer_cluster/tasks/binary_deployment.yml b/roles/drainer/tasks/binary_deployment.yml similarity index 100% rename from roles/drainer_cluster/tasks/binary_deployment.yml rename to roles/drainer/tasks/binary_deployment.yml diff --git a/roles/drainer_cluster/tasks/check_certs.yml b/roles/drainer/tasks/check_certs.yml similarity index 100% rename from roles/drainer_cluster/tasks/check_certs.yml rename to roles/drainer/tasks/check_certs.yml diff --git a/roles/drainer_cluster/tasks/gen_certs.yml b/roles/drainer/tasks/gen_certs.yml similarity index 100% rename from roles/drainer_cluster/tasks/gen_certs.yml rename to roles/drainer/tasks/gen_certs.yml diff --git a/roles/drainer_cluster/tasks/install_certs.yml b/roles/drainer/tasks/install_certs.yml similarity index 100% rename from roles/drainer_cluster/tasks/install_certs.yml rename to roles/drainer/tasks/install_certs.yml diff --git a/roles/drainer_cluster/tasks/main.yml b/roles/drainer/tasks/main.yml similarity index 83% rename from roles/drainer_cluster/tasks/main.yml rename to roles/drainer/tasks/main.yml index 80d1726d2..603e65a1a 100644 --- a/roles/drainer_cluster/tasks/main.yml +++ b/roles/drainer/tasks/main.yml @@ -5,16 +5,16 @@ fail: msg="Please set initial_commit_ts variable for drainer server in inventory.ini." when: (initial_commit_ts is undefined) or (initial_commit_ts is defined and initial_commit_ts == "") -- name: "check if the customized config file `{{ playbook_dir }}/conf/{{ inventory_hostname }}_drainer-cluster.toml` existed" +- name: "check if the customized config file `{{ playbook_dir }}/conf/{{ inventory_hostname }}_drainer.toml` existed" delegate_to: localhost stat: - path: "{{ playbook_dir }}/conf/{{ inventory_hostname }}_drainer-cluster.toml" + path: "{{ playbook_dir }}/conf/{{ inventory_hostname }}_drainer.toml" register: drainer_customized_conf_st -- name: "Preflight check - ensure that the customized config file `{{ playbook_dir }}/conf/{{ inventory_hostname }}_drainer-cluster.toml` exists" +- name: "Preflight check - ensure that the customized config file `{{ playbook_dir }}/conf/{{ inventory_hostname }}_drainer.toml` exists" delegate_to: localhost fail: - msg: 'You need to create customized config file `{{ playbook_dir }}/conf/{{ inventory_hostname }}_drainer-cluster.toml`.' + msg: 'You need to create customized config file `{{ playbook_dir }}/conf/{{ inventory_hostname }}_drainer.toml`.' when: drainer_customized_conf_st.stat.exists == False - name: create deploy directories @@ -34,7 +34,7 @@ # when: enable_tls|default(false) - name: create configuration file - copy: src="{{ playbook_dir }}/conf/{{ inventory_hostname }}_drainer-cluster.toml" dest="{{ deploy_dir }}/conf/drainer.toml" mode=0644 backup=yes + copy: src="{{ playbook_dir }}/conf/{{ inventory_hostname }}_drainer.toml" dest="{{ deploy_dir }}/conf/drainer.toml" mode=0644 backup=yes register: drainer_conf_st - name: backup conf file diff --git a/roles/drainer_cluster/tasks/supervise_deployment.yml b/roles/drainer/tasks/supervise_deployment.yml similarity index 100% rename from roles/drainer_cluster/tasks/supervise_deployment.yml rename to roles/drainer/tasks/supervise_deployment.yml diff --git a/roles/drainer_cluster/tasks/systemd_deployment.yml b/roles/drainer/tasks/systemd_deployment.yml similarity index 100% rename from roles/drainer_cluster/tasks/systemd_deployment.yml rename to roles/drainer/tasks/systemd_deployment.yml diff --git a/roles/drainer_cluster/templates/run_drainer_binary.sh.j2 b/roles/drainer/templates/run_drainer_binary.sh.j2 similarity index 100% rename from roles/drainer_cluster/templates/run_drainer_binary.sh.j2 rename to roles/drainer/templates/run_drainer_binary.sh.j2 diff --git a/roles/drainer_cluster/vars/default.yml b/roles/drainer/vars/default.yml similarity index 100% rename from roles/drainer_cluster/vars/default.yml rename to roles/drainer/vars/default.yml diff --git a/roles/pump/tasks/main.yml b/roles/pump/tasks/main.yml index 30352d69d..35aecbabe 100644 --- a/roles/pump/tasks/main.yml +++ b/roles/pump/tasks/main.yml @@ -18,7 +18,7 @@ when: enable_tls|default(false) - name: load customized config - include_vars: file={{ playbook_dir }}/conf/pump-cluster.yml name=pump_conf_custom + include_vars: file={{ playbook_dir }}/conf/pump.yml name=pump_conf_custom - name: load default config include_vars: file=default.yml name=pump_conf_default