diff --git a/docs/zh_CN/后端部署文档.md b/docs/zh_CN/后端部署文档.md index fff6be713c..4559e4b817 100644 --- a/docs/zh_CN/后端部署文档.md +++ b/docs/zh_CN/后端部署文档.md @@ -545,7 +545,7 @@ sh ./bin/escheduler-daemon.sh stop alert-server - 使用部署用户 sh install.sh 一键部署 - 注意:scp_hosts.sh 里 `tar -zxvf $workDir/../escheduler-1.0.0.tar.gz -C $installPath` 中的版本号(1.0.0)需要执行前手动替换成对应的版本号 - + ## 服务监控 monitor_server.py 脚本是监听,master和worker服务挂掉重启的脚本 diff --git a/escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessDefinitionController.java b/escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessDefinitionController.java index 9cf27a32ed..ec1f38b0ce 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessDefinitionController.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/controller/ProcessDefinitionController.java @@ -127,7 +127,7 @@ public class ProcessDefinitionController extends BaseController{ logger.info("login user {}, update process define, project name: {}, process define name: {}, " + "process_definition_json: {}, desc: {}, locations:{}, connects:{}", loginUser.getUserName(), projectName, name, processDefinitionJson,desc, locations, connects); - Map result = processDefinitionService.updateProccessDefinition(loginUser, projectName, id, name, + Map result = processDefinitionService.updateProcessDefinition(loginUser, projectName, id, name, processDefinitionJson, desc, locations, connects); return returnDataList(result); }catch (Exception e){ diff --git a/escheduler-api/src/main/java/cn/escheduler/api/service/ProcessDefinitionService.java b/escheduler-api/src/main/java/cn/escheduler/api/service/ProcessDefinitionService.java index 1b0d806967..119c840e56 100644 --- a/escheduler-api/src/main/java/cn/escheduler/api/service/ProcessDefinitionService.java +++ b/escheduler-api/src/main/java/cn/escheduler/api/service/ProcessDefinitionService.java @@ -247,9 +247,9 @@ public class ProcessDefinitionService extends BaseDAGService { * @param connects * @return */ - public Map updateProccessDefinition(User loginUser, String projectName, int id, String name, - String processDefinitionJson, String desc, - String locations, String connects) throws JsonProcessingException { + public Map updateProcessDefinition(User loginUser, String projectName, int id, String name, + String processDefinitionJson, String desc, + String locations, String connects) { Map result = new HashMap<>(5); Project project = projectMapper.queryByName(projectName); @@ -284,7 +284,6 @@ public class ProcessDefinitionService extends BaseDAGService { processDefine.setName(name); processDefine.setReleaseState(ReleaseState.OFFLINE); processDefine.setProjectId(project.getId()); - processDefine.setUserId(loginUser.getId()); processDefine.setProcessDefinitionJson(processDefinitionJson); processDefine.setDesc(desc); processDefine.setLocations(locations); diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java b/escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java index e01150e207..c6164c4523 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java @@ -1272,7 +1272,7 @@ public class ProcessDao extends AbstractBaseDao { return scheduleMapper.queryById(id); } - public List queryNeddFailoverProcessInstances(String host){ + public List queryNeedFailoverProcessInstances(String host){ return processInstanceMapper.queryByHostAndStatus(host, stateArray); } diff --git a/escheduler-server/src/main/java/cn/escheduler/server/zk/ZKMasterClient.java b/escheduler-server/src/main/java/cn/escheduler/server/zk/ZKMasterClient.java index 113ef5de9f..624d0193be 100644 --- a/escheduler-server/src/main/java/cn/escheduler/server/zk/ZKMasterClient.java +++ b/escheduler-server/src/main/java/cn/escheduler/server/zk/ZKMasterClient.java @@ -256,7 +256,7 @@ public class ZKMasterClient extends AbstractZKClient { logger.info("start master failover ..."); - List needFailoverProcessInstanceList = processDao.queryNeddFailoverProcessInstances(masterHost); + List needFailoverProcessInstanceList = processDao.queryNeedFailoverProcessInstances(masterHost); //updateProcessInstance host is null and insert into command for(ProcessInstance processInstance : needFailoverProcessInstanceList){ diff --git a/escheduler-ui/.env b/escheduler-ui/.env index 5cd5ba736d..d4dcd9f473 100644 --- a/escheduler-ui/.env +++ b/escheduler-ui/.env @@ -1,6 +1,6 @@ # 后端接口地址 -API_BASE = http://192.168.xx.xx:12345 +API_BASE = http://192.168.220.154:12345 # 本地开发如需ip访问项目把"#"号去掉 #DEV_HOST = 192.168.xx.xx diff --git a/escheduler-ui/install(线上环境).sh b/escheduler-ui/install(线上环境).sh new file mode 100755 index 0000000000..314b408edb --- /dev/null +++ b/escheduler-ui/install(线上环境).sh @@ -0,0 +1,161 @@ + +#!/bin/bash +echo "escheduler-ui-install.sh" + +# 配置前端访问端口 +esc_proxy="8888" + +# 配置代理后端接口 +esc_proxy_port="http://192.168.220.154:12345" + +# 当前路径 +esc_basepath=$(cd `dirname $0`; pwd) + +# 本机ip +esc_ipaddr='172.0.0.1' +esc_ipaddr=$(ip addr | awk '/^[0-9]+: / {}; /inet.*global/ {print gensub(/(.*)\/(.*)/, "\\1", "g", $2)}') + +# 区分版本 +version=`cat /etc/redhat-release|sed -r 's/.* ([0-9]+)\..*/\1/'` + + +echo "========================================================================配置信息=======================================================================" + +echo "前端访问端口:${esc_proxy}" +echo "后端代理接口地址:${esc_proxy_port}" +echo "静态文件地址:${esc_basepath}/dist" +echo "当前路径:${esc_basepath}" +echo "本机ip:${esc_ipaddr}" + +echo "========================================================================配置信息=======================================================================" +echo "" + + +# 创建文件并配置nginx +eschedulerConf(){ + +E_host='$host' +E_remote_addr='$remote_addr' +E_proxy_add_x_forwarded_for='$proxy_add_x_forwarded_for' +E_http_upgrade='$http_upgrade' +echo " + server { + listen $esc_proxy;# 访问端口 + server_name localhost; + #charset koi8-r; + #access_log /var/log/nginx/host.access.log main; + location / { + root ${esc_basepath}/dist; # 静态文件目录 + index index.html index.html; + } + location /escheduler { + proxy_pass ${esc_proxy_port}; # 接口地址 + proxy_set_header Host $E_host; + proxy_set_header X-Real-IP $E_remote_addr; + proxy_set_header x_real_ipP $E_remote_addr; + proxy_set_header remote_addr $E_remote_addr; + proxy_set_header X-Forwarded-For $E_proxy_add_x_forwarded_for; + proxy_http_version 1.1; + proxy_connect_timeout 4s; + proxy_read_timeout 30s; + proxy_send_timeout 12s; + proxy_set_header Upgrade $E_http_upgrade; + proxy_set_header Connection "upgrade"; + } + #error_page 404 /404.html; + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } +" >> /etc/nginx/conf.d/escheduler.conf + +} + + +centos7(){ +# nginx是否安装 +sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm +sudo yum install -y nginx +echo "nginx 安装成功" + +# 配置nginx +eschedulerConf + +# 解决 0.0.0.0:8888 问题 +yum -y install policycoreutils-python +semanage port -a -t http_port_t -p tcp $esc_proxy + +# 开放前端访问端口 +firewall-cmd --zone=public --add-port=$esc_proxy/tcp --permanent + +# 重启防火墙 +firewall-cmd --reload + +# 启动nginx +systemctl start nginx + +# 调整SELinux的参数 +sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config +# 临时生效 +setenforce 0 + +} + + +centos6(){ +# yum +E_basearch='$basearch' +E_releasever='$releasever' +echo " +[nginx] +name=nginx repo +baseurl=http://nginx.org/packages/centos/$E_releasever/$E_basearch/ +gpgcheck=0 +enabled=1 +" >> /etc/yum.repos.d/nginx.repo + +# install nginx +yum install nginx -y + +# 配置nginx +eschedulerConf + +# 防火墙 +E_iptables=`lsof -i:$esc_proxy | wc -l` +if [ "$E_iptables" -gt "0" ];then +# 已开启端口防火墙重启 +service iptables restart +else +# 未开启防火墙添加端口再重启 +iptables -I INPUT 5 -i eth0 -p tcp --dport $esc_proxy -m state --state NEW,ESTABLISHED -j ACCEPT +service iptables save +service iptables restart +fi + +# start +/etc/init.d/nginx start + +# 调整SELinux的参数 +sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config + +# 临时生效 +setenforce 0 + +} + +# centos 6 +if [[ $version -eq 6 ]]; then + centos6 +fi + +# centos 7 +if [[ $version -eq 7 ]]; then + centos7 +fi + + +echo "请浏览器访问:http://${esc_ipaddr}:${esc_proxy}" + diff --git a/escheduler-ui/src/font/demo_index.html b/escheduler-ui/src/font/demo_index.html index 1671172845..af55eca421 100644 --- a/escheduler-ui/src/font/demo_index.html +++ b/escheduler-ui/src/font/demo_index.html @@ -252,6 +252,12 @@
&#xe60c;
+
  • + +
    icon_禁止
    +
    &#xe63e;
    +
  • +
  • 1116加载中
    @@ -881,6 +887,15 @@
  • +
  • + +
    + icon_禁止 +
    +
    .icon-icon_jinzhi +
    +
  • +
  • @@ -1575,6 +1590,14 @@
    #icon-tuichufffpx
  • +
  • + +
    icon_禁止
    +
    #icon-icon_jinzhi
    +
  • +
  • ` +} + /** - * 返回节点html + * return node html */ -const rtTasksTpl = ({ id, name, x, y, targetarr, isAttachment, taskType }) => { +const rtTasksTpl = ({ id, name, x, y, targetarr, isAttachment, taskType,runFlag }) => { let tpl = `` tpl += `
    ` tpl += `
    ` - tpl += `
    ` - tpl += `
    ` - tpl += `${name}` + tpl += `
    ` + tpl += `
    ` + tpl += `${name}` tpl += `
    ` tpl += `
    ` + tpl += `
    ` + if (runFlag === 'FORBIDDEN') { + tpl += rtBantpl() + } + tpl += `
    ` tpl += `
    ` + return tpl } /** - * 获取所有tasks节点 + * Get all tasks nodes */ const tasksAll = () => { let a = [] @@ -71,8 +82,8 @@ const tasksAll = () => { } /** - * 判断 name 是否在当前的dag图中 - * rely dom / backfill dom元素 回填 + * Determine if name is in the current dag map + * rely dom / backfill */ const isNameExDag = (name, rely) => { if (rely === 'dom') { @@ -83,17 +94,17 @@ const isNameExDag = (name, rely) => { } /** - * 更改svg线条颜色 + * Change svg line color */ const setSvgColor = (e, color) => { - // 遍历 清除所有颜色 + // Traverse clear all colors $('.jtk-connector').each((i, o) => { _.map($(o)[0].childNodes, v => { $(v).attr('fill', '#555').attr('stroke', '#555').attr('stroke-width', 2) }) }) - // 给选择的添加颜色 + // Add color to the selection _.map($(e.canvas)[0].childNodes, (v, i) => { $(v).attr('fill', color).attr('stroke', color) if ($(v).attr('class')) { @@ -103,7 +114,7 @@ const setSvgColor = (e, color) => { } /** - * 获取所有节点id + * Get all node ids */ const allNodesId = () => { let idArr = [] @@ -127,5 +138,6 @@ export { tasksAll, isNameExDag, setSvgColor, - allNodesId + allNodesId, + rtBantpl }