Configuration for Anonymous Login in TiUP Grafana

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiUP Grafana 匿名登录配置

| username: Leonadle

[Architecture Information]

TiDB Version: v7.1.1

[Encountered Problem]

  1. Checked the location of the grafana.ini configuration file using ps -ef and added the anonymous login configuration:
enabled = true
  1. After tiup reload, the configuration file was reverted.


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?

| username: DBRE | Original post link

tiup restart will not overwrite

| username: Leonadle | Original post link

However, if there are reload operations later, such as upgrades or edit-config, it will be overwritten. It’s not a long-term solution.

| username: 小龙虾爱大龙虾 | Original post link

It seems that Grafana cannot set the config field, you can try it.

| username: Jellybean | Original post link

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.

| username: ShawnYan | Original post link

Recently, it seems that there is also an issue where the Grafana configuration is reverted after a reload?

| username: Leonadle | Original post link

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?

2023-12-19T15:29:22.241+0800    INFO    CheckPoint      {"host": "", "port": 22, "user": "tidb", "src": "/home/tidb/.tiup/storage/cluster/clusters/test-cluster/config-cache/grafana_192.168.1.108_3000.ini", "dst": "/home/tidb/deploy/grafana/conf/grafana.ini", "download": false, "__hash__": "3653dc521afbd0da505cdbe4bcbc92c39fe66b74", "__func__": "*CheckPointExecutor).Transfer", "hit": false}
| username: Jellybean | Original post link

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.
  # # The ip address of the Grafana Server.
  - host:
      log.file.level: warning
      smtp.enabled: true {IP}:{port}
      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.

| username: Jellybean | Original post link

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.

| username: Leonadle | Original post link

You can add the following configuration in Grafana using tiup edit-config:

anonymous_enable: true
| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.