From dbcd7cfa95255f96ecfbe18e56636a9fb81b0119 Mon Sep 17 00:00:00 2001 From: frankfreedom <772598220@qq.com> Date: Tue, 18 Aug 2020 00:04:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86--?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=8A=E4=BC=A0=E9=94=99=E8=AF=AF=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../azkaban/project/AzkabanProjectLoader.java | 11 ++++++----- .../azkaban/project/DirectoryFlowLoader.java | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/azkaban-common/src/main/java/azkaban/project/AzkabanProjectLoader.java b/azkaban-common/src/main/java/azkaban/project/AzkabanProjectLoader.java index d09f18f..cea39b3 100755 --- a/azkaban-common/src/main/java/azkaban/project/AzkabanProjectLoader.java +++ b/azkaban-common/src/main/java/azkaban/project/AzkabanProjectLoader.java @@ -202,19 +202,20 @@ public Map uploadProject(final Project project, private File unzipProject(final File archive, final String fileType) throws ProjectManagerException { final File file; - try { + if (fileType == null) { throw new ProjectManagerException("Unknown file type for " + archive.getName()); } else if ("zip".equals(fileType)) { - file = unzipFile(archive); + try { + file = unzipFile(archive); + } catch (final Exception e) { + throw new ProjectManagerException("Error unzipping file:" + archive.getName() + ", Please check if there are Chinese characters in the file name.", e); + } } else { throw new ProjectManagerException("Unsupported archive type for file " + archive.getName()); } - } catch (final IOException e) { - throw new ProjectManagerException("Error unzipping file.", e); - } return file; } diff --git a/azkaban-common/src/main/java/azkaban/project/DirectoryFlowLoader.java b/azkaban-common/src/main/java/azkaban/project/DirectoryFlowLoader.java index fb38882..1abda53 100755 --- a/azkaban-common/src/main/java/azkaban/project/DirectoryFlowLoader.java +++ b/azkaban-common/src/main/java/azkaban/project/DirectoryFlowLoader.java @@ -160,7 +160,8 @@ private void loadProjectFromDir(final String base, final File dir, Props parent) final FlowProps flowProps = new FlowProps(parent); this.flowPropsList.add(flowProps); } catch (final IOException e) { - this.errors.add("Error loading properties " + file.getName() + ":" + this.logger.error("Error loading properties {}, cause by :", file.getName(), e); + this.errors.add("Error loading properties " + file.getName() + ", cause by :" + e.getMessage()); } @@ -175,7 +176,7 @@ private void loadProjectFromDir(final String base, final File dir, Props parent) try { if (!this.duplicateJobs.contains(jobName)) { if (this.jobPropsMap.containsKey(jobName)) { - this.errors.add("Duplicate job names found '" + jobName + "'."); + this.errors.add("Duplicate job names found '" + file.getName() + "'."); this.duplicateJobs.add(jobName); this.jobPropsMap.remove(jobName); this.nodeMap.remove(jobName); @@ -187,7 +188,7 @@ private void loadProjectFromDir(final String base, final File dir, Props parent) final Node node = new Node(jobName); final String type = prop.getString("type", null); if (type == null) { - this.errors.add("Job doesn't have type set '" + jobName + "', please check whether the file encoding is UNIX, UTF-8."); + this.errors.add("Job type property not found in file '" + file.getName() + "', please check whether the file encoding is UNIX, UTF-8."); } node.setType(type); @@ -212,7 +213,8 @@ private void loadProjectFromDir(final String base, final File dir, Props parent) } } } catch (final IOException e) { - this.errors.add("Error loading job file " + file.getName() + ":" + this.logger.error("Error loading job file {}, cause by :", file.getName(), e); + this.errors.add("Error loading job file " + file.getName() + ", cause by : " + e.getMessage()); } } @@ -286,19 +288,22 @@ private void resolveDependencies() { if (this.duplicateJobs.contains(dependencyName)) { edge.setError("Ambiguous Dependency. Duplicates found."); dependencies.put(dependencyName, edge); - this.errors.add(node.getId() + " 依赖关系不清晰 " + // 依赖关系不清晰 + this.errors.add(node.getId() + " has ambiguous dependency, please check the dependency information." + dependencyName); } else { edge.setError("Dependency not found."); dependencies.put(dependencyName, edge); - this.errors.add(node.getId() + " 找不到依赖 " + // 找不到依赖 + this.errors.add(node.getId() + " cannot find dependency, please check the dependency information. " + dependencyName); } } else if (dependencyNode == node) { // We have a self cycle edge.setError("Self cycle found."); dependencies.put(dependencyName, edge); - this.errors.add(node.getId() + " 有一个死循环"); + // 有一个死循环 + this.errors.add(node.getId() + " has a self cycle, please check the dependency information."); } else { dependencies.put(dependencyName, edge); } From a69cce275b99a5c8097ec280b55717f184150103 Mon Sep 17 00:00:00 2001 From: frankfreedom <772598220@qq.com> Date: Tue, 18 Aug 2020 00:24:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bin/internal/internal-start-executor.sh | 29 +++++++++++++------ .../src/bin/internal/internal-start-web.sh | 21 ++++++++++---- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/azkaban-exec-server/src/bin/internal/internal-start-executor.sh b/azkaban-exec-server/src/bin/internal/internal-start-executor.sh index 3dcd407..fce781e 100644 --- a/azkaban-exec-server/src/bin/internal/internal-start-executor.sh +++ b/azkaban-exec-server/src/bin/internal/internal-start-executor.sh @@ -96,7 +96,15 @@ function start(){ LOG INFO "Starting AzkabanExecutorServer on port $executorport ..." java $AZKABAN_OPTS $JAVA_LIB_PATH -cp $CLASSPATH azkaban.execapp.AzkabanExecutorServer -conf $conf $@ >> $logFile 2>&1 & echo $! > $azkaban_dir/currentpid - LOG INFO "AzkabanExecutorServer started successfully." + sleep 3s + processName=`jps|grep AzkabanExecutorServer` + if [ ! -n "$processName" ] + then + LOG INFO "AzkabanExecutorServer startup failed" + return 1 + else + return 0 + fi } function genServerId(){ @@ -126,27 +134,30 @@ function updataExecutorStatus(){ runtime=0 while [[ $start_finish != 1 ]]; do result=`curl -POST http://${LOCAL_HOSTNAME}:${EXECUTOR_PORT}/executor -d action=activate` - LOG INFO " 执行结果: ${result}" + LOG INFO " exectue result: ${result}" [[ "${result}" =~ .*success.* ]] && { break; } - sleep 5s + sleep 3s runtime=$(( $runtime + 1 )) - LOG INFO " 当前运行次数为: ${runtime} 超过30次将退出。" - if [ ${runtime} -gt 30 ] + LOG INFO "It has been run: ${runtime} and will exit after 10 times。" + if [ ${runtime} -gt 10 ] then LOG ERROR "update executor status time out." return 1 fi done - LOG INFO " 执行节点启动成功,更新数据库状态。" LOG INFO "update executor success." + LOG INFO "AzkabanExecutorServer started successfully." } function preCheck(){ LOG INFO "checking AzkabanExecutorServer status..." - if [ -f $azkaban_dir/currentpid ] + processName=`jps|grep AzkabanExecutorServer` + if [ -n "$processName" ] then - LOG INFO "AzkabanExecutorServer already started." - return 1 + LOG INFO "AzkabanExecutorServer already started." + return 1 + else + return 0 fi } diff --git a/azkaban-web-server/src/bin/internal/internal-start-web.sh b/azkaban-web-server/src/bin/internal/internal-start-web.sh index 56baa3b..41f7e6a 100644 --- a/azkaban-web-server/src/bin/internal/internal-start-web.sh +++ b/azkaban-web-server/src/bin/internal/internal-start-web.sh @@ -27,11 +27,14 @@ logFile=/appcom/logs/azkaban/webServerLog_`date +%F+%T`.out function preCheck(){ - LOG INFO "checking AzkabanWebServer process status..." - if [ -f $azkaban_dir/currentpid ] + LOG INFO "checking AzkabanWebServer status..." + processName=`jps|grep AzkabanWebServer` + if [ -n "$processName" ] then - LOG INFO "AzkabanWebServer already started." - return 1 + LOG INFO "AzkabanWebServer already started." + return 1 + else + return 0 fi } @@ -99,7 +102,15 @@ function start(){ LOG INFO "starting AzkabanWebServer..." java $AZKABAN_OPTS $JAVA_LIB_PATH -cp $CLASSPATH azkaban.webapp.AzkabanWebServer -conf $conf $cycle_stop $@ >> $logFile 2>&1 & echo $! > $azkaban_dir/currentpid - LOG INFO "AzkabanWebServer started successfully." + sleep 3s + processName=`jps|grep AzkabanWebServer` + if [ ! -n "$processName" ] + then + LOG INFO "AzkabanWebServer startup failed" + return 1 + else + return 0 + fi } function LOG(){