diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java index a0c2bf4e58..8fa8d72236 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java @@ -649,27 +649,25 @@ public class HadoopUtils implements Closeable { String yarnUrl = "http://%s:" + activeResourceManagerPort + "/ws/v1/cluster/info"; - String state = null; try { + /** - * send http get request to rm1 + * send http get request to rm */ - state = getRMState(String.format(yarnUrl, rmIdArr[0])); - if (Constants.HADOOP_RM_STATE_ACTIVE.equals(state)) { - return rmIdArr[0]; - } else if (Constants.HADOOP_RM_STATE_STANDBY.equals(state)) { - state = getRMState(String.format(yarnUrl, rmIdArr[1])); + for (String rmId : rmIdArr) { + String state = getRMState(String.format(yarnUrl, rmId)); if (Constants.HADOOP_RM_STATE_ACTIVE.equals(state)) { - return rmIdArr[1]; + return rmId; } - } else { - return null; } + } catch (Exception e) { - state = getRMState(String.format(yarnUrl, rmIdArr[1])); - if (Constants.HADOOP_RM_STATE_ACTIVE.equals(state)) { - return rmIdArr[0]; + for (int i = 1; i < rmIdArr.length; i++) { + String state = getRMState(String.format(yarnUrl, rmIdArr[i])); + if (Constants.HADOOP_RM_STATE_ACTIVE.equals(state)) { + return rmIdArr[i]; + } } } return null; diff --git a/dolphinscheduler-ui/.babelrc b/dolphinscheduler-ui/.babelrc index aeb5ba2059..5fe8580fed 100644 --- a/dolphinscheduler-ui/.babelrc +++ b/dolphinscheduler-ui/.babelrc @@ -5,7 +5,15 @@ "debug": false, "useBuiltIns": true, "targets": { - "browsers": [ "ie > 8", "last 2 version", "safari >= 9" ] + "browsers": [ + "> 1%", + "last 2 versions", + "ie >= 9", + "edge >= 12", + "firefox >= 28", + "chrome >= 29", + "opera >= 17" + ] }, "production": { "plugins": ["transform-remove-console"] diff --git a/dolphinscheduler-ui/build/config.js b/dolphinscheduler-ui/build/config.js index 77de5b690e..1186066e7f 100644 --- a/dolphinscheduler-ui/build/config.js +++ b/dolphinscheduler-ui/build/config.js @@ -47,7 +47,7 @@ const jsEntry = (() => { parts.shift() let modules = parts.join('/') let entry = moduleName(modules) - obj[entry] = val + obj[entry] = ['babel-polyfill', val] }) return obj })() diff --git a/dolphinscheduler-ui/package.json b/dolphinscheduler-ui/package.json index eb1c7e15d7..609dd1043a 100644 --- a/dolphinscheduler-ui/package.json +++ b/dolphinscheduler-ui/package.json @@ -48,6 +48,7 @@ "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", "babel-preset-env": "^1.6.1", "copy-webpack-plugin": "^4.5.2", "cross-env": "^5.2.0", @@ -86,5 +87,14 @@ "webpack-cli": "^3.3.10", "webpack-dev-server": "^3.9.0", "webpack-merge": "^4.2.2" - } + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "ie >= 9", + "edge >= 12", + "firefox >= 28", + "chrome >= 29", + "opera >= 17" + ] } diff --git a/dolphinscheduler-ui/src/js/conf/home/index.js b/dolphinscheduler-ui/src/js/conf/home/index.js index 3809f18a1c..8db055a36a 100644 --- a/dolphinscheduler-ui/src/js/conf/home/index.js +++ b/dolphinscheduler-ui/src/js/conf/home/index.js @@ -17,6 +17,7 @@ // The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. +import 'babel-polyfill' import Vue from 'vue' import ElementUI from 'element-ui' import locale from 'element-ui/lib/locale/lang/en' diff --git a/dolphinscheduler-ui/src/js/conf/login/index.js b/dolphinscheduler-ui/src/js/conf/login/index.js index 2f3aa04bbc..652c80f278 100644 --- a/dolphinscheduler-ui/src/js/conf/login/index.js +++ b/dolphinscheduler-ui/src/js/conf/login/index.js @@ -18,6 +18,7 @@ // The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. // import $ from 'jquery' +import 'babel-polyfill' import Vue from 'vue' import ElementUI from 'element-ui' import locale from 'element-ui/lib/locale/lang/en' diff --git a/script/dolphinscheduler-daemon.sh b/script/dolphinscheduler-daemon.sh index af2ac91570..5e7652199e 100644 --- a/script/dolphinscheduler-daemon.sh +++ b/script/dolphinscheduler-daemon.sh @@ -94,7 +94,7 @@ else exit 1 fi -export DOLPHINSCHEDULER_OPTS="-server -Xms$HEAP_INITIAL_SIZE -Xmx$HEAP_MAX_SIZE -Xmn$HEAP_NEW_GENERATION__SIZE -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=128m -Xss512k -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof" +export DOLPHINSCHEDULER_OPTS="-server -Xms$HEAP_INITIAL_SIZE -Xmx$HEAP_MAX_SIZE -Xmn$HEAP_NEW_GENERATION__SIZE -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=128m -Xss512k -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof $DOLPHINSCHEDULER_OPTS" case $startStop in (start)