Skip to content

Commit

Permalink
增加gclog,worker gc 设置bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
shuzhi.cy committed Jan 24, 2014
1 parent 6589ab5 commit 6195d13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,11 @@ private String getClassPath(String stormjar, String stormHome, Map totalConf) {
public String getChildOpts(Map stormConf) {
String childopts = " ";

if (ConfigExtension.getWorkerGc(stormConf) != null) {
childopts += ConfigExtension.getWorkerGc(stormConf);
} else if (stormConf.get(Config.TOPOLOGY_WORKER_CHILDOPTS) != null) {
if (stormConf.get(Config.TOPOLOGY_WORKER_CHILDOPTS) != null) {
childopts += (String) stormConf
.get(Config.TOPOLOGY_WORKER_CHILDOPTS);
} else if (ConfigExtension.getWorkerGc(stormConf) != null) {
childopts += ConfigExtension.getWorkerGc(stormConf);
}

return childopts;
Expand Down Expand Up @@ -478,6 +478,8 @@ public void launchWorker(Map conf, IContext sharedcontext,
// JStormUtils.current_classpath(), param);

// get child process parameter

String stormhome = System.getProperty("jstorm.home");

long memSlotSize = ConfigExtension.getMemSlotSize(conf);
long memSize = memSlotSize * assignment.getMemSlotNum();
Expand All @@ -486,6 +488,8 @@ public void launchWorker(Map conf, IContext sharedcontext,

// @@@ some hack logic in the old storm, reserve it here
childopts = childopts.replace("%ID%", port.toString());
childopts = childopts.replace("%TOPOLOGYID%", topologyId);
childopts = childopts.replace("%JSTORM_HOME%", stormhome);

String logFileName = topologyId + "-worker-" + port + ".log";
// String logFileName = "worker-" + port + ".log";
Expand All @@ -510,8 +514,6 @@ public void launchWorker(Map conf, IContext sharedcontext,

// commandSB.append(" -Dlog4j.ignoreTCL=true");

String stormhome = System.getProperty("jstorm.home");

if (stormhome != null) {
// commandSB.append(" -Dlogback.configurationFile=" + stormhome +
// "/conf/cluster.xml");
Expand Down
2 changes: 1 addition & 1 deletion jstorm-server/src/main/resources/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ supervisor.disk.slot: null

### worker.* configs are for task workers
# worker gc configuration
worker.gc.childopts: " -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 "
worker.gc.childopts: " -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+HeapDumpOnOutOfMemoryError -Xloggc:%JSTORM_HOME%/logs/%TOPOLOGYID%-worker-%ID%-gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=100M "
worker.heartbeat.frequency.secs: 2
worker.classpath: ""

Expand Down

0 comments on commit 6195d13

Please sign in to comment.