Skip to content

Commit

Permalink
Merge pull request alibaba#318 from alibaba/master
Browse files Browse the repository at this point in the history
Merge branch 'master' into develop
  • Loading branch information
hxy1991 authored Nov 20, 2018
2 parents 84b9dd6 + 9fafcda commit 5f5a520
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ private void updateIfChanged(List<String> newList) {
* @return serverlist
*/
private List<String> getApacheServerList() {
if (STANDALONE_MODE) {
List<String> serverIps = new ArrayList<String>();
serverIps.add(getFormatServerAddr(LOCAL_IP));
return serverIps;
}

// 优先从文件读取服务列表
try {
List<String> serverIps = new ArrayList<String>();
Expand All @@ -241,7 +247,7 @@ private List<String> getApacheServerList() {
defaultLog.error("nacos-XXXX", "[serverlist] failed to get serverlist from disk!", e);
}

if (isUseAddressServer() && !STANDALONE_MODE) {
if (isUseAddressServer()) {
try {
HttpResult result = NotifyService.invokeURL(addressServerUrl, null, null);

Expand Down
14 changes: 2 additions & 12 deletions distribution/bin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,13 @@ else

fi

# GC options
# The first segment of the version number, which is '1' for releases before Java 9
# it then becomes '9', '10', ...
# Some examples of the first line of `java --version`:
# 8 -> java version "1.8.0_152"
# 9.0.4 -> java version "9.0.4"
# 10 -> java version "10" 2018-03-20
# 10.0.1 -> java version "10.0.1" 2018-04-17
# We need to match to the end of the line to prevent sed from printing the characters that do not match
JAVA_MAJOR_VERSION=$($JAVA -version 2>&1 | sed -E -n 's/.* version "([0-9]*).*$/\1/p')
if [[ "$JAVA_MAJOR_VERSION" -ge "9" ]] ; then
KAFKA_GC_LOG_OPTS="-Xlog:gc*:file=${BASE_DIR}/logs/nacos_gc.log:time,tags:filecount=10,filesize=102400"
JAVA_OPT="${JAVA_OPT} -Xlog:gc*:file=${BASE_DIR}/logs/nacos_gc.log:time,tags:filecount=10,filesize=102400"
else
KAFKA_GC_LOG_OPTS="-Xloggc:${BASE_DIR}/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
JAVA_OPT="${JAVA_OPT} -Xloggc:${BASE_DIR}/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
fi


JAVA_OPT="${JAVA_OPT} -Dnacos.home=${BASE_DIR}"
JAVA_OPT="${JAVA_OPT} -jar ${BASE_DIR}/target/nacos-server.jar"
JAVA_OPT="${JAVA_OPT} ${JAVA_OPT_EXT}"
Expand Down

0 comments on commit 5f5a520

Please sign in to comment.