|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Uploading files to two servers at same timeHi All,
Our .Net Website is using 2 servers and the load balancer pointed to servers according to their load. Think now i m in first server and i upload a file to the server, next time i refresh it goes to the next server but the file that i uploaded is not there in this server. How can i upload the file to the both server at the same time. Thanks in Advance Dilish What kind of files ? If this is done by a developer you could update always
the same server and a script that uses the "robocopy" tool just updates the other server. If this is done by the application, I would consider using a shared storage location for user files. -- Show quotePatrice <dilis***@gmail.com> a écrit dans le message de news: 1146125097.211729.124***@j33g2000cwa.googlegroups.com... > Hi All, > > Our .Net Website is using 2 servers and the load balancer pointed to > servers according to their load. > Think now i m in first server and i upload a file to the server, next > time i refresh it goes to the next server but the file that i uploaded > is not there in this server. > > How can i upload the file to the both server at the same time. > > Thanks in Advance > > Dilish > I'll consider saving the files to a network path instead (even if the file
happens to be at localhost, it doesn't harm to open it by specifying //your_private_ip/shared_storage/filename.ext) So all your uploaded files are stored in the same location, and your problem is solved. Of course, you may also File.Copy() the file to another server when upload is finished, but it means the stroage space required is duplicated. <dilis***@gmail.com> ???????:1146125097.211729.124***@j33g2000cwa.googlegroups.com... Show quote > Hi All, > > Our .Net Website is using 2 servers and the load balancer pointed to > servers according to their load. > Think now i m in first server and i upload a file to the server, next > time i refresh it goes to the next server but the file that i uploaded > is not there in this server. > > How can i upload the file to the both server at the same time. > > Thanks in Advance > > Dilish > Like the session, if you have multiple servers, you should maintain a
session server (asp.net or sql one). The problem is the same for you. You have to put downloaded files into a shared storage which could be a file share (easy) or a SQL repository (tables with BLOBs) which is the more robust. A general rule for building fail over applications (using farms) is to seperate Web servers from data, each Web servers must be absolutely stateless and must rely on a out of box storage... HTH <dilis***@gmail.com> a écrit dans le message de news: 1146125097.211729.124***@j33g2000cwa.googlegroups.com... Show quote > Hi All, > > Our .Net Website is using 2 servers and the load balancer pointed to > servers according to their load. > Think now i m in first server and i upload a file to the server, next > time i refresh it goes to the next server but the file that i uploaded > is not there in this server. > > How can i upload the file to the both server at the same time. > > Thanks in Advance > > Dilish > |
|||||||||||||||||||||||