Skip to content
This repository was archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
merge from master (#1108) (#1109)
Browse files Browse the repository at this point in the history
  • Loading branch information
liubo0127 authored Jan 10, 2020
1 parent 08bb0ce commit 6a83b0c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
6 changes: 4 additions & 2 deletions conf/tidb-lightning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ checkpoint:
# keep-after-success: false

tikv_importer:
# the listening address of tikv-importer. Change it to the actual address in tikv-importer.toml.
# addr: "0.0.0.0:8287"
# delivery back end ("tidb" or "importer")
backend: "importer"
# action on duplicated entry ("error", "ignore" or "replace")
# on-duplicate: "replace"

mydumper:
# block size of file reading
Expand Down
3 changes: 0 additions & 3 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ docker_bin_dir: "/usr/bin"
# Random shifts for retrying failed ops like downloading
retry_stagger: 5

# the listening address of tikv-importer. tidb-lightning needs to connect to this address to write data. Set it to the actual IP address.
tikv_importer_port: 8287

# deployment methods, [binary, docker] docker deployment method is not recommended and deprecated.
deployment_method: binary

Expand Down
3 changes: 3 additions & 0 deletions group_vars/importer_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ dummy:

# this directory is used to store the data written by `tidb-lightning`
import_dir: "{{ deploy_dir }}/data.import"

# the listening address of tikv-importer. tidb-lightning needs to connect to this address to write data. Set it to the actual IP address.
tikv_importer_port: 8287
2 changes: 0 additions & 2 deletions roles/tidb_lightning/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
lightning:
pprof-port: "{{ tidb_lightning_pprof_port }}"
file: "{{ lightning_log_dir }}/{{ lightning_log_file }}"
tikv_importer:
addr: "{{ hostvars[groups.importer_server[0]].ansible_host | default(hostvars[groups.importer_server[0]].inventory_hostname) }}:{{ tikv_importer_port }}"
mydumper:
data-source-dir: "{{ data_source_dir }}"
tidb:
Expand Down
4 changes: 4 additions & 0 deletions roles/tidb_lightning/templates/tidb-lightning.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
{% endfor %}

[tikv-importer]
{% set tikv_importer_node = groups.importer_server[0] -%}
{% set tikv_importer_ip = hostvars[tikv_importer_node].ansible_host | default(hostvars[tikv_importer_node].inventory_hostname) -%}
{% set tikv_importer_port = hostvars[tikv_importer_node].tikv_importer_port %}
addr = "{{ tikv_importer_ip }}:{{ tikv_importer_port }}"
{% for item, value in tidb_lightning_conf.tikv_importer | dictsort -%}
{{ item }} = {{ value | to_json }}
{% endfor %}
Expand Down
6 changes: 4 additions & 2 deletions roles/tidb_lightning/vars/tidb-lightning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ checkpoint:
# keep-after-success: false

tikv_importer:
# the listening address of tikv-importer. Change it to the actual address in tikv-importer.toml.
# addr: "0.0.0.0:8287"
# delivery back end ("tidb" or "importer")
backend: "importer"
# action on duplicated entry ("error", "ignore" or "replace")
# on-duplicate: "replace"

mydumper:
# block size of file reading
Expand Down

0 comments on commit 6a83b0c

Please sign in to comment.