11

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

4

2 回答 2

17

如果您检查 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.

在实践中,这有时会转化为 Windows 上的部署或重新部署,因为某些文件无法删除或移动,最终会被遗忘。在我运行的大约 50 个 Glassfish 实例中,我在 Solaris 10 上从未遇到过问题,并且在 Windows 上总是遇到与此相关的问题。

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

于 2009-07-16T13:16:54.753 回答
3

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

你可能应该在服务器故障上问这个

于 2009-06-04T16:53:08.543 回答