Skip to content

Commit

Permalink
refactor tiflash config (pingcap#1136)
Browse files Browse the repository at this point in the history
  • Loading branch information
marsishandsome committed Feb 12, 2020
1 parent 064a187 commit 1966564
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 29 deletions.
9 changes: 0 additions & 9 deletions conf/tiflash-learner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,20 @@ metric:
#job: "tikv"

raftstore:
raftdb-path: ""
sync-log: true
max-leader-missing-duration: "22s"
abnormal-leader-missing-duration: "21s"
peer-stale-state-check-interval: "20s"

coprocessor:

rocksdb:
wal-dir: ""

defaultcf:
block-cache-size: "10GB"

lockcf:
block-cache-size: "4GB"

writecf:
block-cache-size: "4GB"

raftdb:
defaultcf:
block-cache-size: "1GB"

security:
ca-path: ""
Expand Down
5 changes: 3 additions & 2 deletions conf/tiflash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ flash:
proxy:

logger:
count: 10
count: 20
size: "1000M"
level: "trace"
level: "debug"
application:
runAsDaemon: true

raft:
storage_engine: "tmt"

quotas:
default:
Expand Down
1 change: 0 additions & 1 deletion roles/tiflash/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ tiflash_log_dir: "{{ deploy_dir }}/log"
tiflash_scripts_dir: "{{ deploy_dir }}/scripts"
tcp_port: 9000
http_port: 8123
interserver_http_port: 9009
flash_service_port: 3930
flash_proxy_port: 20170
2 changes: 1 addition & 1 deletion roles/tiflash/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@

- name: prepare firewalld white list
set_fact:
firewalld_ports: "{{ [tcp_port ~ '/tcp', http_port ~ '/tcp', interserver_http_port ~ '/tcp', flash_service_port ~ '/tcp', flash_proxy_port ~ '/tcp'] + firewalld_ports }}"
firewalld_ports: "{{ [tcp_port ~ '/tcp', http_port ~ '/tcp', flash_service_port ~ '/tcp', flash_proxy_port ~ '/tcp'] + firewalld_ports }}"
5 changes: 0 additions & 5 deletions roles/tiflash/templates/tiflash.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ tmp_path = "{{ tmp_path }}"
path = "{{ path }}"
tcp_port = {{ tcp_port }}
http_port = {{ http_port }}
interserver_http_port = {{ interserver_http_port }}

[flash]
{% set all_tidb = [] -%}
Expand All @@ -23,11 +22,7 @@ service_addr = "{{ ansible_host | default(inventory_hostname) }}:{{ flash_servic

[flash.{{ item }}]
{% if item == 'proxy' %}
addr = "{{ ansible_host | default(inventory_hostname) }}:{{ flash_proxy_port }}"
advertise-addr = "{{ ansible_host | default(inventory_hostname) }}:{{ flash_proxy_port }}"
data-dir = "{{ data_dir }}"
config = "{{ flash_proxy_config }}"
log-file = "{{ tiflash_tikv_log }}"
{% endif %}
{% for sub_item, sub_value in value | dictsort -%}
{{ sub_item }} = {{ sub_value | to_json }}
Expand Down
5 changes: 5 additions & 0 deletions roles/tiflash/templates/tiflash_learner.toml.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
log-file = "{{ tiflash_tikv_log }}"

[readpool]
{% for item, value in tiflash_learner_conf.readpool | dictsort_by_value_type -%}
{% if value is not mapping -%}
Expand All @@ -14,6 +16,8 @@
[server]
labels = { "tiflash_http_port" = "{{ http_port }}" }
engine-addr = "{{ ansible_host | default(inventory_hostname) }}:{{ flash_service_port }}"
addr = "{{ ansible_host | default(inventory_hostname) }}:{{ flash_proxy_port }}"
advertise-addr = "{{ ansible_host | default(inventory_hostname) }}:{{ flash_proxy_port }}"
{% for item, value in tiflash_learner_conf.server | dictsort -%}
{% if item == "labels" %}
{{ item }} = {{ value | tikv_server_labels_format }}
Expand All @@ -23,6 +27,7 @@ engine-addr = "{{ ansible_host | default(inventory_hostname) }}:{{ flash_service
{% endfor %}

[storage]
data-dir = "{{ data_dir }}"
{% for item, value in tiflash_learner_conf.storage | dictsort -%}
{{ item }} = {{ value | to_json }}
{% endfor %}
Expand Down
9 changes: 0 additions & 9 deletions roles/tiflash/vars/tiflash-learner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,20 @@ metric:
#job: "tikv"

raftstore:
raftdb-path: ""
sync-log: true
max-leader-missing-duration: "22s"
abnormal-leader-missing-duration: "21s"
peer-stale-state-check-interval: "20s"

coprocessor:

rocksdb:
wal-dir: ""

defaultcf:
block-cache-size: "10GB"

lockcf:
block-cache-size: "4GB"

writecf:
block-cache-size: "4GB"

raftdb:
defaultcf:
block-cache-size: "1GB"

security:
ca-path: ""
Expand Down
5 changes: 3 additions & 2 deletions roles/tiflash/vars/tiflash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ flash:
proxy:

logger:
count: 10
count: 20
size: "1000M"
level: "trace"
level: "debug"
application:
runAsDaemon: true

raft:
storage_engine: "tmt"

quotas:
default:
Expand Down

0 comments on commit 1966564

Please sign in to comment.