CDV ❯ standardize system properties and data/logs/stats folders
Bug
Status:Resolved
2 Major
Resolution:Won't Fix
interfaces
Reporter:ekulesho
March 25, 2008
1
Watchers:1
February 12, 2014
February 12, 2014
Description
Examples for maven plugin (like one in tc-maven-plugin\examples\tc-maven-plugin-sample) are using the following configuration in tc-config.xml
target/terracotta/%(tc.nodeName)
Then name of tc.nodeName system property is set automatically by Maven plugin or can be specified using:
<process nodeName="master" ...
However projects generated with Maven archetypes don't use such convention and puts logs to the user.home dir:
pojo archetype:
----
%(user.home)/terracotta/client-logs/org.foo.fff.fff/%D
----
webapp archetype:
----
....
%(user.home)/terracotta/data
%(user.home)/terracotta/logs
...
%(user.home)/terracotta/%(tc.nodeName)
----
Then new CVT stuff is using its own defaults for the data directories, and by default creates bunch of folders like statistics\* in the current dir. More over, CVT is using its own system property to specify node name (tc.node-name vs. tc.nodeName).
Here is the error message printed on console then CVT detects folder conflict:
[INFO] [dso start] 2008-03-25 19:07:51,031 ERROR -
[INFO] [dso start] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
[INFO] [dso start] The statistics store couldn't be opened at
[INFO] [dso start] 'C:\dev\terr\20spring\statistics'.
[INFO] [dso start] The CVT gathering system will not be active for this node.
[INFO] [dso start]
[INFO] [dso start] A common reason for this is that you're launching several Terracotta L1
[INFO] [dso start] clients on the same machine. The default directory for the statistics store
[INFO] [dso start] uses the IP address of the machine that it runs on as the identifier.
[INFO] [dso start] When several clients are being executed on the same machine, a typical solution
[INFO] [dso start] to properly separate these directories is by using a JVM property at startup
[INFO] [dso start] that is unique for each client.
[INFO] [dso start]
[INFO] [dso start] For example:
[INFO] [dso start] dso-java.sh -Dtc.node-name=node1 your.main.Class
[INFO] [dso start]
[INFO] [dso start] You can then adapt the tc-config.xml file so that this JVM property is picked
[INFO] [dso start] up when the statistics directory is configured by using %(tc.node-name) in the
[INFO] [dso start] statistics path.
It would be really nice to have standard conventions for those folders and system properties that would be used by default and consistent across all components/projects.
I'd suggest to use "terracotta" dir from the project folder and have corresponding subfolders in it. For example, something like this:
terracotta/
server-data/
server-logs/
server-statistics/
node1-logs/
node1-statistics/
node2-logs/
node2-statistics/
</div>
## Comments
{:.comment-heading}
### **Geert Bevin** 2008-03-26
Imho, unless there’s a general mechanism provided through Terracotta
to uniquely and repeatedly identify individual nodes at startup, this
can’t really be solved. Adding the property by default to
tc-config.xml when it is only resolved when Maven is used feels a bit
hackish to me. Btw, the reason why I chose tc.node-name as the
property name is because we use tc.install-root in the server. So to
me it looked consistent.
Imho, unless there’s a general mechanism provided through Terracotta to uniquely and repeatedly identify individual nodes at startup, this can’t really be solved. Adding the property by default to tc-config.xml when it is only resolved when Maven is used feels a bit hackish to me. Btw, the reason why I chose tc.node-name as the property name is because we use tc.install-root in the server. So to me it looked consistent.