This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I need to be able to create a file from user entered input through a web-app and store it in a central file system. Storing it in the database as a CLOB/BLOB/VARBINARY is not an option. The web-app could possibly farm out the request to any one of the cluster JVMs, and I need to able to store the created file in this central system from any JVM. All the JVMS are in a UNIX enviroment. How can I store files in a central place from different JVMS?
I don't quite see what the problem is. Surely it's a simple matter to hard-code the full path to the shared place in each application: File f = new File("/usr/me/someplace"); Then they can all just write files in that directory. I guess you have dismissed this approach, so what am I missing?
That is the approach I would like to use. Isn't the path /usr/bin... local to the machine where it is called? How do I fully qualify the path name possibly with a machine name so that /usr/bin/whatever maps to that shared directory? I guess this is more of a UNIX question.
If you are not on a network where you can directly path to the directory, then you will need to ftp the file.
"JavaRanch, where the deer and the Certified play" - David O'Meara
Joined: Jan 07, 1999
Most Unix systems allow you to mount directories from other machines using nfs or various other protocols. I'd recommend that you do this if you can, as it will also allow you to make sure you deploy the same version of software to each of your clustered VMs. As a small side note, your initial message didn't mention that these multiple VMs were to be on separate machines. A lot of people like to cluster several VMs even on a single machine, so that of anything causes a VM to crash or lock up, then the app can still carry on.