Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: granfana配置用户密码参数
[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path]
[Encountered Issue: By using the tiup cluster edit-config
parameter, you can see the configuration of the username and password in grafana_servers
, which are both set to admin
by default. However, after modifying the username and password and updating the cluster configuration, the changes do not take effect. If this parameter cannot modify the relevant configuration, why is it retained?
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachment: Screenshot/Logs/Monitoring]

Can it be understood as the initial default configuration? Waiting for the official response.
I’m considering whether this configuration will conflict with changing the password after logging into Grafana. If the password is changed from the Grafana side, and then other configuration parameters are modified from the configuration file, it might cause the Grafana password to reset to admin…
It might be the initial configuration. After logging in and making changes, it is no longer read from here.
I don’t think it will be like that.
Try reloading the Grafana node.
This should only be the initial configuration parameters. You can change the Grafana password directly on the Grafana page.
Blind guessing is only used for initialization.
Only useful during initialization.
It should be the initial default value.
Initialization parameters
It should be the initial default value.
You can set it before deployment, but after initialization, you can only use the Grafana CLI to modify it.
When deploying a TiDB cluster using TiUP, TiUP will automatically deploy monitoring components such as Prometheus, Grafana, and Alertmanager, and automatically add monitoring configurations for new nodes during cluster expansion.
Note:
- When customizing the configuration of monitoring components, do not directly modify the configuration files of the monitoring components. This is because during operations such as deploy/scale-out/scale-in/reload, TiUP will use its own configuration parameters to overwrite the monitoring components’ configurations.
- If the monitoring components are not deployed and managed by TiUP, you can directly modify the configuration files of the monitoring components without referring to this document.
- The functionality described in this document is supported in TiUP v1.9.0 and later versions. Please check the TiUP version number before using this feature.
自定义监控组件的配置 | PingCAP 文档中心
Custom Grafana Configuration
Currently, TiUP supports custom Grafana Dashboard and other configurations.
Custom Grafana Dashboard
- Place the custom Dashboard configuration file in a directory on the machine where TiUP is located.
- In the topology configuration file topology.yaml of the TiDB cluster, set the dashboard_dir to the directory where the custom Dashboard configuration file is actually placed.
Below is an example of the grafana_servers configuration in the topology.yaml file:
# # Server configs are used to specify the configuration of Grafana Servers.
grafana_servers:
# # The ip address of the Grafana Server.
- host: 127.0.0.1
dashboard_dir: /home/tidb/dashboards # grafana dashboard dir on TiUP machine
After the above configuration, during deploy/scale-out/scale-in/reload operations of the cluster, TiUP will read the custom Dashboard from the local path /home/tidb/dashboards and then send this configuration to the Grafana Server, replacing the default configuration rules.
Custom Grafana Other Configurations
- Open the cluster configuration file topology.yaml.
- Add other configurations in the grafana_servers section.
Below is an example of the [log.file] level field and smtp configuration in the topology.yaml file:
# # Server configs are used to specify the configuration of Grafana Servers.
grafana_servers:
# # The ip address of the Grafana Server.
- host: 127.0.0.1
config:
log.file.level: warning
smtp.enabled: true
smtp.host: {IP}:{port}
smtp.user: example@pingcap.com
smtp.password: {password}
smtp.skip_verify: true
After the above configuration, during deploy/scale-out/scale-in/reload operations of the cluster, TiUP will add the contents of the config field to the grafana configuration file grafana.ini.