Tidb-server cannot start

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

Original topic: tidb-server无法启动

| username: terry0219

【TiDB Environment】Testing
【TiDB Version】7.5.0

tidb-server cannot start, the log reports “failed to create the server” [error=“listen tcp 0.0.0.0:4000: bind: address already in use”], but I checked and port 4000 is not being listened to.

| username: zhanggame1 | Original post link

Run netstat -na | grep 4000 to check.
Is the cluster failing to start after being used for a while, or is it a new installation that won’t start?

| username: terry0219 | Original post link

Using netstat, there really is a connection established on port 4000. It just stops working after some use.

| username: terry0219 | Original post link

However, this is not listening on port 4000 either. How should this be handled?

| username: zhanggame1 | Original post link

Use netstat -nap | grep 4000 to see which process is occupying port 4000. If that doesn’t work, try restarting the machine.

| username: terry0219 | Original post link

OK, thank you.

| username: caiyfc | Original post link

If the service fails to start, check the logs in two places: one is the log in the deployment path set during the TiDB deployment, and the other is the operating system log. There will definitely be anomalies.

| username: wangccsy | Original post link

Change to a different port since port 4000 is occupied by another process.

| username: dba远航 | Original post link

Why do I feel like the service has already started?