Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple servers in a Wildfly server groups put collected data files to same place #692

Closed
KAMI911 opened this issue Nov 2, 2017 · 4 comments

Comments

@KAMI911
Copy link

KAMI911 commented Nov 2, 2017

It seems there is a bug that causes data loss when the one uses Wildfly and there are same more than one Wildfly server (JVM) on same application server. All server will put their data to same tmp subfolder hence they only create one set of graphs. Is there any way to autodetect these situations and modify the javamelody.storage-directory automatically? It would be nice to put Wildfly server name or used port to the auto generated storage directory path that can avoid this bug.

@KAMI911 KAMI911 changed the title Multiple servers in a WIldfly server groups put collected data files to same place Multiple servers in a Wildfly server groups put collected data files to same place Nov 2, 2017
@evernat
Copy link
Member

evernat commented Nov 5, 2017

Detecting that 2 instances write to the same storage directory is very possible and desirable. (java.nio.channels.FileChannel.tryLock would do the job I suppose.)
So it could warn in the reports about the problem.

Wildfly server name or used port will probably not be added to the storage directory (because first, it will change the default currently used by a lot of apps and server name or port would not be a good idea in general).

@BrommD
Copy link

BrommD commented Nov 6, 2017

Why not use the parameter "-Djavamelody.application-name=my_instance" and let JavaMelody add it to the folder name, like "/tmp/javamelody_my_instance". This is a common approach with multiple Jboss Wildfly on same server.

@evernat
Copy link
Member

evernat commented Nov 6, 2017

@BrommD Yes, it would work well.

Another approach is to use a different "storage-directory" parameter in each instance. For example in system properties: "-Djavamelody.storage-directory=/tmp/javamelody_my_instance"

@evernat
Copy link
Member

evernat commented Nov 14, 2017

It's done (3863b31) and ready for the next release (1.71): there is now a warning in the reports if multiple instances use the same storage directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants