From edd1846c4aac80adecd131b529351a222b407b56 Mon Sep 17 00:00:00 2001 From: marsishandsome Date: Mon, 17 Feb 2020 09:59:57 +0800 Subject: [PATCH] tiflash add metrics port --- conf/tiflash.yml | 2 ++ group_vars/tiflash_servers.yml | 1 + roles/tiflash/defaults/main.yml | 1 + roles/tiflash/tasks/main.yml | 2 +- roles/tiflash/templates/tiflash.toml.j2 | 8 ++++++++ roles/tiflash/vars/tiflash.yml | 2 ++ 6 files changed, 15 insertions(+), 1 deletion(-) diff --git a/conf/tiflash.yml b/conf/tiflash.yml index d2ca99f14..26d917a5d 100644 --- a/conf/tiflash.yml +++ b/conf/tiflash.yml @@ -12,6 +12,8 @@ flash: master_ttl: 60 proxy: +status: + logger: count: 20 size: "1000M" diff --git a/group_vars/tiflash_servers.yml b/group_vars/tiflash_servers.yml index e30fea252..f7efd3c44 100644 --- a/group_vars/tiflash_servers.yml +++ b/group_vars/tiflash_servers.yml @@ -6,3 +6,4 @@ interserver_http_port: 9009 flash_service_port: 3930 flash_proxy_port: 20170 flash_proxy_status_port: 20292 +metrics_port: 8234 diff --git a/roles/tiflash/defaults/main.yml b/roles/tiflash/defaults/main.yml index e27684b61..eca043bb1 100644 --- a/roles/tiflash/defaults/main.yml +++ b/roles/tiflash/defaults/main.yml @@ -18,3 +18,4 @@ http_port: 8123 flash_service_port: 3930 flash_proxy_port: 20170 flash_proxy_status_port: 20292 +metrics_port: 8234 diff --git a/roles/tiflash/tasks/main.yml b/roles/tiflash/tasks/main.yml index 208180dae..052035d8a 100644 --- a/roles/tiflash/tasks/main.yml +++ b/roles/tiflash/tasks/main.yml @@ -63,4 +63,4 @@ - name: prepare firewalld white list set_fact: - firewalld_ports: "{{ [tcp_port ~ '/tcp', http_port ~ '/tcp', flash_service_port ~ '/tcp', flash_proxy_port ~ '/tcp', flash_proxy_status_port ~ '/tcp'] + firewalld_ports }}" + firewalld_ports: "{{ [tcp_port ~ '/tcp', http_port ~ '/tcp', flash_service_port ~ '/tcp', flash_proxy_port ~ '/tcp', flash_proxy_status_port ~ '/tcp', metrics_port ~ '/tcp'] + firewalld_ports }}" diff --git a/roles/tiflash/templates/tiflash.toml.j2 b/roles/tiflash/templates/tiflash.toml.j2 index e93d72d24..3a94f3809 100644 --- a/roles/tiflash/templates/tiflash.toml.j2 +++ b/roles/tiflash/templates/tiflash.toml.j2 @@ -30,6 +30,14 @@ config = "{{ flash_proxy_config }}" {% endif %} {% endfor %} +[status] +metrics_port = {{ metrics_port }} +{% for item, value in tiflash_conf.profiles | dictsort_by_value_type -%} +{% if value is not mapping -%} +{{ item }} = {{ value | to_json }} +{% endif %} +{% endfor %} + [logger] errorlog = "{{ tiflash_errlog }}" log = "{{ tiflash_server_log }}" diff --git a/roles/tiflash/vars/tiflash.yml b/roles/tiflash/vars/tiflash.yml index d2ca99f14..26d917a5d 100644 --- a/roles/tiflash/vars/tiflash.yml +++ b/roles/tiflash/vars/tiflash.yml @@ -12,6 +12,8 @@ flash: master_ttl: 60 proxy: +status: + logger: count: 20 size: "1000M"