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

ZOOKEEPER-2837: Add a special START_SERVER_JVMFLAGS option only for `start` command to distinguish JVMFLAGS and SERVER_JVMFLAGS #302

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
1 participant
@asdf2014
Member

asdf2014 commented Jul 4, 2017

Add a special START_SERVER_JVMFLAGS option only for start command to distinguish JVMFLAGS and SERVER_JVMFLAGS.

If we use the normal way to add JVM options with JVMFLAGS in conf/java.env, then it will effect almost all shell scripts under bin directory. Even if using SERVER_JVMFLAGS will effect some commands like zkServer.sh status, include four-letters commands.

For example, if the JVMFLAGS is

export JVMFLAGS="-Xms3G -Xmx3G -Xmn1G -XX:+AlwaysPreTouch -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails -XX:-PrintGCTimeStamps -Xloggc:/home/zookeeper/logs/zookeeper_`date '+%Y%m%d%H%M%S'`.gc -XX:-UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=64M"

then we will get too many GC log files due to using the mntr four-letters command regularly in some monitor situations.

$ ls ~/logs
zookeeper_20170704175942.gc
zookeeper_20170704180101.gc
zookeeper_20170704180201.gc
zookeeper_20170704180301.gc
zookeeper_20170704180401.gc
...
Add a special START_SERVER_JVMFLAGS option only for `start` command t…
…o distinguish JVMFLAGS and SERVER_JVMFLAGS

@asdf2014 asdf2014 force-pushed the asdf2014:start_server_jvmflags branch from 3feae66 to 8cf17cd Jul 4, 2017

@asdf2014

This comment has been minimized.

Member

asdf2014 commented Jul 10, 2017

Even if had been fixed the issues by adding the START_SERVER_JVMFLAGS option, but i still don't understand why the execution of mntr 4lw command would use the JVMFLAGS option. I list the process call links about executing command, but still cannot figure out.

org.apache.zookeeper.server.WorkerService.ScheduledWorkRequest#run
org.apache.zookeeper.server.NIOServerCnxnFactory.IOWorkRequest#doWork
org.apache.zookeeper.server.NIOServerCnxn#doIO
org.apache.zookeeper.server.NIOServerCnxn#checkFourLetterWord
org.apache.zookeeper.server.command.CommandExecutor#getCommand
org.apache.zookeeper.server.command.AbstractFourLetterCommand#start
org.apache.zookeeper.server.command.MonitorCommand#commandRun

@hanm @shralex @afine PTAL.

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