Jetty running Solr, recommendations for storage directory

閲覧: 278 回
最初の未読メッセージにスキップ

Shawn Heisey

未読、
2014/10/13 12:01:232014/10/13
To: javam...@googlegroups.com
I've got a custom install of Solr, based on the example jetty that comes in the Solr download.  I integrated javamelody into it, and found that it is placing its data files in /tmp/javamelody.  This is a problem because of the cronjob that cleans out old files in /tmp.  I could edit the cronjob to exclude that directory, but that increases the number of operating system changes that must be made before my applications will work properly.  Ideally I would need to make zero changes to the OS, everything should be handled by the applications.

What's the best way to relocate the storage directory?  Is there a java system property that I can set, or an environment variable?  If I don't make it an absolute path, will it be relative to the current working directory?  I would rather keep the web.xml changes as generic as possible and control that location externally.

We also have javamelody integrated into a liferay application and that uses a location under the tomcat directory., which is safe.

Thanks,
Shawn

Shawn Heisey

未読、
2014/10/13 17:14:122014/10/13
To: javam...@googlegroups.com
I think I figured it out.  In my init script, I added the following lines immediately after my "cd" command to the jetty home:

  mkdir -p tmp
  STARTARGS="-Djava.io.tmpdir=tmp ${STARTARGS}"

This moves the javamelody storage directory from /tmp to the tmp directory under my jetty home.

Vernat Emeric

未読、
2014/10/13 17:28:302014/10/13
To: javam...@googlegroups.com
Hi,

The java.io.tmpdir system property moves the tmp dir of the server, for all temporary files.

If you just want to move the storage directory of javamelody and not all temporary files:
-Djavamelody.storage-directory=/path/to/dir

You can also set this parameter in web.xml or in the context of the webapp:
https://code.google.com/p/javamelody/wiki/UserGuide#6._Optional_parameters

bye,
Emeric
--

---
You received this message because you are subscribed to the Google Groups "javamelody" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javamelody+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shawn Heisey

未読、
2014/10/13 19:03:212014/10/13
To: javam...@googlegroups.com
Neither Solr nor Jetty (at least with the config I'm using) creates anything in the java temp directory, so moving the whole thing is not problematic in any way.  Even if other things were created there, I'd rather have it in my application's directory than in /tmp.  Thanks for the more detailed info, I can make a more targeted config if I need to.
全員に返信
投稿者に返信
転送
新着メール 0 件