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

merge from master #1108

Merged
merged 1 commit into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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