Windows与RedHat上的GlassFish

bmw*_*128 10 operating-system glassfish

想知道选择Redhat或Windows 2003 Server是否重要(可靠性)?假设两者都有相同的技能.谢谢

sam*_*ter 16

如果您检查glassfish源,特别是./appserv-commons/src/java/com/sun/enterprise/util/io/FileUtils.java,您将看到Glassfish为了删除/重命名而经历的所有扭曲Windows上的文件和目录.

这是一个Windows问题,其限制是删除和重命名打开的文件.

那里有各种各样的技巧,包括多次从JVM请求GC以期关闭文件流,"伪"重命名,睡眠尝试循环.

一些例子:

/**
 *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.
Run Code Online (Sandbox Code Playgroud)

实际上,这有时会转换为Windows上的borked部署或重新部署,因为某些文件无法删除或移动,最终会被遗忘.在我运行的50个左右的Glassfish实例中,我在Solaris 10上从未出现过问题,并且在Windows上始终存在与此相关的问题.

简而言之,任何*NIX都会因为这个原因而更好,除了其他平台管理员考虑因素.


Cog*_*gsy 3

我想你会发现大多数人会因为可靠性而争论 Redhat 而不是 Windows。Glassfish 本身应该在两者上运行相同的。

您可能应该在服务器故障上询问这个问题