Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: node-exporter修改端口
[TiDB Usage Environment] Production Environment
[TiDB Version] v6.1.3
[Reproduction Path] The machine initially installed TiDB, with the node-exporter port set to the default 9100. The service name is node_exporter-9100.service. Later, the machine had node-exporter monitoring installed by operations, and during the TiDB online upgrade, restarting the node_exporter service failed due to port conflicts.
[Encountered Problem: Symptoms and Impact] Attempted to modify the node-exporter port via tiup cluster edit-config tidb-prod, but received the error:
New topology could not be saved: immutable field changed: monitored.NodeExporterPort changed from ‘9100’ to ‘9101’
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]
What is the result after selecting Y?
You can first shut down the node for operations deployment, then upgrade the cluster. After that, modify the TiDB monitoring port. Alternatively, you can have the operations deployment node change the port.
My TiDB version is 6.1.3, and I encountered the following error during the upgrade process. The control machine failed to stop the service.
I can only modify the port on one side. However, I don’t know how to change the node-exporter port in TiDB.
Selecting Y will re-edit the configuration file. The original edits will be invalid.
Check if it might be a permissions issue:
The central control machine can use the tidb user to jump to any machine via SSH, and can execute commands with root privileges using sudo.
I checked and it seems that tiup indeed does not provide an operation to modify the monitoring port. You probably need to manually modify the meta file and go to the corresponding server to modify the service file and configuration file. 
Alternatively, you can try to scale down the monitoring component in a test environment, see if you can remove the node, and then scale up the monitoring component to solve the issue.
Yes, understood. Thank you.
In the initialization of the cluster topology, there is a configuration for node_exporter. The optimal solution might still be to modify the monitoring components installed by the company.
Sure, just do whatever is convenient.
There is a port conflict, and it seems that TiDB does not support modifying the port.
Final solution:
Stop the node_exporter service set up by operations and only start the node_exporter service that comes with TiDB. Since node_exporter is an open-source service, there is no need for two ports to be provided. Just keep one, and both TiDB and the company’s built-in PMS can listen to port 9100 to display alerts simultaneously.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.