
我有一個基本的三層 Web 應用程序,我想使用 GlassFish。假設管理技能相同,主機作業系統是 Windows 2003 Server 或 RedhHat 有什麼不同嗎?
答案1
由於 Windows 檔案鎖定問題,在 Win2K3 上部署時遲早您可能會遇到問題。但你會學會以某種方式解決這個問題。
另請參閱這問題:
在其他條件相同的情況下,我不會選擇 Windows 作為 glassfish 的伺服器作業系統,但我也不會強烈建議反對 Win2K3。
答案2
我第二個是弗雷達林。一個來自我在 SO 上發布的答案的欺騙:
0 票反對
如果您檢查 glassfish 原始程式碼,特別是 ./appserv-commons/src/java/com/sun/enterprise/util/io/FileUtils.java,您將看到 Glassfish 為了刪除/重命名而經歷的所有扭曲Windows 上的檔案和目錄。
這是一個 Windows 問題,它對刪除和重新命名開啟的檔案有限制。
其中有各種各樣的技巧,包括多次向 JVM 請求 GC 以希望關閉文件流、「偽」重命名、sleep-try 循環。
一些例子:
/**
*Attempts to delete files that could not be deleted earlier and were not overwritten.
*<p>
*On Windows, the method requests garbage collection which may unlock locked
*files. (The JarFile finalizer closes the file.)
/*
*On Windows, as long as not all leftover files have been cleaned and we have not
*run the max. number of retries, try again to trigger gc and delete
*each remaining leftover file.
*/
/**
* Windows has BIG issues renaming a directory that is open somnewhere -- e.g. if
* a DOS box is opened anywhere in that directory.
* This method will try to do a "virtual renaming" if there are problems
* I.e. it attempts to do a simple rename, if that fails it will copy everything under
* the original directory to the renamed directory. Then it will delete everything
* under the original directory that the OS will allow it to.
實際上,這有時會導致 Windows 上的部署或重新部署失敗,因為某些檔案無法刪除或移動,最終會被遺留下來。在我運行的所有 Glassfish 實例中,我在 Solaris 10 上從未遇到過問題,並且在 Windows 上總是遇到與此相關的問題。
簡而言之,僅出於這個原因,任何 *NIX 都會更好,拋開其他平台管理考慮因素。
答案3
假設規格相同,我不確定是否有巨大差異。我聽一些管理員說在 Linux 上運行應用程式客戶端容器 (ACC) 速度更快。