In a web cluster, it is important to ensure that the program code files of each machine are the same.
There are generally two solutions,
The first is to synchronize the uploaded code to each server through synchronization software, that is, each machine really has its own code.
The second is to mount one on each server Public file storage server.
Of these two options, the second one is obviously easier to manage.
The first possibility has better performance, because the local files are read directly when the website is running. But it is inconvenient in management. For example, if logs are recorded in the program, then multiple servers have their own logs, and these logs need to be managed. , it also needs to be merged, and it is not a simple merge. The log files with the same name on multiple servers on the same day have intersection times, and they need to be sorted for log analysis and management.
One method is to store the logs separately on a jointly mounted server. This is indeed what the website's file upload business does.
However, there are many website projects, programmers use different language frameworks, and the log directory configurations are inconsistent. , so you have to manually change the log saving directory for each program.
I prefer the second method, which is to mount each web server together, but will this be a problem in a large cluster with dozens or hundreds of servers?
The code files running on hundreds of web servers are all Commonly mounted to a file server?