Java JBoss AS 7:如何清理 tmp?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9851652/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JBoss AS 7: How to clean up tmp?
提问by Konrad Garus
I noticed that in my JBoss Application Server 7 installation under standalone/tmp
I have 400 MB of files related to past deployments, some of them a few months old.
我注意到,在我的 JBoss Application Server 7 安装中,standalone/tmp
我有 400 MB 与过去部署相关的文件,其中一些文件已有几个月的历史。
How is it cleaned up? Should it happen automatically? Is there a tool for it? Can I just remove all those files myself?
它是如何清理的?它应该自动发生吗?有工具吗?我可以自己删除所有这些文件吗?
采纳答案by uaarkoti
As you know JBoss is a purely filesystem based installation. To install you simply unzip a file and thats it. Once you install a certain folder structure is created by default and as you run the JBoss instance for the first time, it creates additional folders for runtime operation. For comparison here is the structure of JBoss AS 7 before and after you start for the first time
如您所知,JBoss 是纯粹基于文件系统的安装。要安装,您只需解压缩一个文件即可。安装后,默认情况下会创建特定的文件夹结构,并且当您第一次运行 JBoss 实例时,它会为运行时操作创建其他文件夹。为了比较,这里是你第一次启动之前和之后的JBoss AS 7的结构
Before
前
jboss-as-7
|
|---> standalone
| |----> lib
| |----> configuration
| |----> deployments
|
|---> domain
|....
After
后
jboss-as-7
|
|---> standalone
| |----> lib
| |----> configuration
| |----> deployments
| |----> tmp
| |----> data
| |----> log
|
|---> domain
|....
As you can see 3 new folders are created (log, data & tmp). These folders can all be deleted without effecting the application deployed in deployments folder unless your application generated Data that's stored in those folders. In development, its ok to delete all these 3 new folders assuming you don't have any need for the logs and data stored in "data" directory.
如您所见,创建了 3 个新文件夹(日志、数据和 tmp)。这些文件夹都可以删除,而不会影响部署在部署文件夹中的应用程序,除非您的应用程序生成了存储在这些文件夹中的数据。在开发中,假设您不需要存储在“data”目录中的日志和数据,可以删除所有这 3 个新文件夹。
For production, ITS NOT RECOMMENDED to delete these folders as there maybe application generated data that stores certain state of the application. For ex, in the data folder, the appserver can save critical Tx rollback logs. So contact your JBoss Administrator if you need to delete those folders for any reason in production.
对于生产,不建议删除这些文件夹,因为可能有应用程序生成的数据存储了应用程序的某些状态。例如,在数据文件夹中,应用程序服务器可以保存关键的 Tx 回滚日志。因此,如果您在生产中出于任何原因需要删除这些文件夹,请联系您的 JBoss 管理员。
Good luck!
祝你好运!
回答by nansen
I do not have experience with version 7 of JBoss but with 5 I often had issues when redeploying apps which went away when I cleaned the work and tmp folder. I wrote a script for that which was executed everytime the server shut down. Maybe executing it before startup is better considering abnormal shutdowns (which weren't uncommon with Jboss 5 :))
我没有使用 JBoss 版本 7 的经验,但使用 5 版本时,我在重新部署应用程序时经常遇到问题,这些问题在我清理工作和 tmp 文件夹时消失了。我为每次服务器关闭时执行的脚本编写了一个脚本。考虑到异常关闭,也许在启动之前执行它会更好(这在 Jboss 5 中并不少见 :))
回答by skay
Files related for deployment (and others temporary items) are created in standalone/tmp/vfs (Virtual File System). You may add a policy at startup for evicting temporary files :
与部署相关的文件(和其他临时项目)在 standalone/tmp/vfs(虚拟文件系统)中创建。您可以在启动时添加用于驱逐临时文件的策略:
-Djboss.vfs.cache=org.jboss.virtual.plugins.cache.IterableTimedVFSCache
-Djboss.vfs.cache.TimedPolicyCaching.lifetime=1440