Checked the location of the grafana.ini configuration file using ps -ef and added the anonymous login configuration:
[auth.anonymous]
enabled = true
After tiup reload, the configuration file was reverted.
[Question]
After reloading Grafana, the configuration file was reverted, but the edit-config did not implement the anonymous login configuration. How should I modify it so that the changes remain effective after reloading Grafana?
The reload operation will overwrite the configuration on the instance node. If you encounter an issue where edit-config cannot modify it, you can modify it on the node, but be sure to make a backup in advance. After that, use restart to reboot.
The downside is that every time there is a reload operation in the future, you need to remember to apply the backup configuration to restart again.
I found the source file (src) and the destination file (dst) by checking the tiup logs. I modified both files, but after reloading, the changes still don’t take effect. Could you please tell me how the tiup grafana configuration file is generated and if there is any way to make the changes permanent?
If you want to customize other configurations of Grafana, you can add other configurations in the configuration section of grafana_servers.
The following is an example of adding the [log.file] level field and smtp configuration:
# # 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, when the cluster performs deploy/scale-out/scale-in/reload operations, TiUP will add the content of the config field to the grafana configuration file grafana.ini.
This is the configuration prompt for v7.5.0, you can try it out.
When using TiUP to deploy a TiDB cluster, TiUP will automatically deploy monitoring components such as Prometheus, Grafana, and Alertmanager, and automatically add monitoring configurations for new nodes during cluster expansion.
It is important to note that TiUP will use its own configuration parameters to overwrite the configurations of the monitoring components. If you directly modify the configuration files of the monitoring components, the modified configuration files may be overwritten by TiUP during operations such as deploy/scale-out/scale-in/reload, causing the configurations to be ineffective.
Therefore, when customizing the configurations of monitoring components, do not directly modify the configuration files of the monitoring components, as TiUP will use its own configuration parameters to overwrite them.