You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
663 lines
23 KiB
663 lines
23 KiB
|
|
<!DOCTYPE HTML> |
|
<html lang="zh-hans" > |
|
<head> |
|
<meta charset="UTF-8"> |
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> |
|
<title>后端部署文档 · 调度系统-EasyScheduler</title> |
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
|
<meta name="description" content=""> |
|
<meta name="generator" content="GitBook 3.2.3"> |
|
<meta name="author" content="YIGUAN"> |
|
|
|
|
|
|
|
<link rel="stylesheet" href="gitbook/style.css"> |
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css"> |
|
|
|
|
|
|
|
<link rel="stylesheet" href="gitbook/gitbook-plugin-insert-logo-link/plugin.css"> |
|
|
|
|
|
|
|
<link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css"> |
|
|
|
|
|
|
|
<link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css"> |
|
|
|
|
|
|
|
<link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="styles/website.css"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
<meta name="HandheldFriendly" content="true"/> |
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> |
|
<meta name="apple-mobile-web-app-capable" content="yes"> |
|
<meta name="apple-mobile-web-app-status-bar-style" content="black"> |
|
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png"> |
|
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon"> |
|
|
|
|
|
<link rel="next" href="系统使用手册.html" /> |
|
|
|
|
|
|
|
</head> |
|
<body> |
|
|
|
<div class="book"> |
|
<div class="book-summary"> |
|
|
|
|
|
<div id="book-search-input" role="search"> |
|
<input type="text" placeholder="输入并搜索" /> |
|
</div> |
|
|
|
|
|
<nav role="navigation"> |
|
|
|
|
|
|
|
<ul class="summary"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.1" data-path="./"> |
|
|
|
<a href="./"> |
|
|
|
|
|
Easyscheduler简介 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.2" > |
|
|
|
<span> |
|
|
|
|
|
前端部署文档 |
|
|
|
</span> |
|
|
|
|
|
|
|
<ul class="articles"> |
|
|
|
|
|
<li class="chapter " data-level="1.2.1" data-path="前端部署文档.html"> |
|
|
|
<a href="前端部署文档.html#前端项目环境构建及编译"> |
|
|
|
|
|
环境搭建 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.2.2" data-path="前端部署文档.html"> |
|
|
|
<a href="前端部署文档.html#安装及配置"> |
|
|
|
|
|
安装及配置 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.2.3" data-path="前端部署文档.html"> |
|
|
|
<a href="前端部署文档.html#项目生产环境配置"> |
|
|
|
|
|
项目生产环境Nginx配置 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.2.4" data-path="前端部署文档.html"> |
|
|
|
<a href="前端部署文档.html#前端项目发布"> |
|
|
|
|
|
前端项目发布 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.2.5" data-path="前端部署文档.html"> |
|
|
|
<a href="前端部署文档.html#问题"> |
|
|
|
|
|
问题 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
|
|
</ul> |
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.3" > |
|
|
|
<span> |
|
|
|
|
|
后端部署文档 |
|
|
|
</span> |
|
|
|
|
|
|
|
<ul class="articles"> |
|
|
|
|
|
<li class="chapter " data-level="1.3.1" data-path="后端部署文档.html"> |
|
|
|
<a href="后端部署文档.html#部署文档"> |
|
|
|
|
|
后端部署文档 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
|
|
</ul> |
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.4" data-path="系统使用手册.html"> |
|
|
|
<a href="系统使用手册.html#使用手册"> |
|
|
|
|
|
系统使用手册 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.5" data-path="系统架构设计.html"> |
|
|
|
<a href="系统架构设计.html#系统架构设计"> |
|
|
|
|
|
系统架构设计 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.6" > |
|
|
|
<span> |
|
|
|
|
|
前端开发文档 |
|
|
|
</span> |
|
|
|
|
|
|
|
<ul class="articles"> |
|
|
|
|
|
<li class="chapter " data-level="1.6.1" data-path="前端部署文档.html"> |
|
|
|
<a href="前端部署文档.html"> |
|
|
|
|
|
开发环境搭建 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.6.2" data-path="前端开发文档.html"> |
|
|
|
<a href="前端开发文档.html#项目目录结构"> |
|
|
|
|
|
项目目录结构 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.6.3" data-path="前端开发文档.html"> |
|
|
|
<a href="前端开发文档.html#系统功能模块"> |
|
|
|
|
|
系统功能模块 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.6.4" data-path="前端开发文档.html"> |
|
|
|
<a href="前端开发文档.html#路由和状态管理"> |
|
|
|
|
|
路由和状态管理 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.6.5" data-path="前端开发文档.html"> |
|
|
|
<a href="前端开发文档.html#规范"> |
|
|
|
|
|
规范 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.6.6" data-path="前端开发文档.html"> |
|
|
|
<a href="前端开发文档.html#接口"> |
|
|
|
|
|
接口 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.6.7" data-path="前端开发文档.html"> |
|
|
|
<a href="前端开发文档.html#扩展开发"> |
|
|
|
|
|
扩展开发 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
|
|
</ul> |
|
|
|
</li> |
|
|
|
<li class="chapter " data-level="1.7" > |
|
|
|
<span> |
|
|
|
|
|
后端开发文档 |
|
|
|
</span> |
|
|
|
|
|
|
|
<ul class="articles"> |
|
|
|
|
|
<li class="chapter " data-level="1.7.1" data-path="任务插件开发.html"> |
|
|
|
<a href="任务插件开发.html#任务插件开发"> |
|
|
|
|
|
自定义任务插件文档 |
|
|
|
</a> |
|
|
|
|
|
|
|
</li> |
|
|
|
|
|
</ul> |
|
|
|
</li> |
|
|
|
|
|
|
|
|
|
<li class="divider"></li> |
|
|
|
<li> |
|
<a href="https://www.gitbook.com" target="blank" class="gitbook-link"> |
|
本书使用 GitBook 发布 |
|
</a> |
|
</li> |
|
</ul> |
|
|
|
|
|
</nav> |
|
|
|
|
|
</div> |
|
|
|
<div class="book-body"> |
|
|
|
<div class="body-inner"> |
|
|
|
|
|
|
|
<div class="book-header" role="navigation"> |
|
|
|
|
|
<!-- Title --> |
|
<h1> |
|
<i class="fa fa-circle-o-notch fa-spin"></i> |
|
<a href="." >后端部署文档</a> |
|
</h1> |
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="page-wrapper" tabindex="-1" role="main"> |
|
<div class="page-inner"> |
|
|
|
<div id="book-search-results"> |
|
<div class="search-noresults"> |
|
|
|
<section class="normal markdown-section"> |
|
|
|
<h1 id="后端部署文档">后端部署文档</h1> |
|
<h2 id="基础软件安装">基础软件安装</h2> |
|
<ul> |
|
<li><a href="https://blog.csdn.net/u011886447/article/details/79796802" target="_blank">Mysql</a> (5.5+) : 必装</li> |
|
<li><a href="https://www.oracle.com/technetwork/java/javase/downloads/index.html" target="_blank">JDK</a> (1.8+) : 必装</li> |
|
<li><a href="https://www.jianshu.com/p/de90172ea680" target="_blank">ZooKeeper</a>(3.4.6) :必装 </li> |
|
<li><a href="https://blog.csdn.net/Evankaka/article/details/51612437" target="_blank">Hadoop</a>(2.6+) :选装, 如果需要使用到资源上传功能,MapReduce任务提交则需要配置Hadoop(上传的资源文件目前保存在Hdfs上)</li> |
|
<li><a href="https://staroon.pro/2017/12/09/HiveInstall/" target="_blank">Hive</a>(1.2.1) : 选装,hive任务提交需要安装</li> |
|
<li>Spark(1.x,2.x) : 选装,Spark任务提交需要安装</li> |
|
<li>PostgreSQL(8.2.15+) : 选装,PostgreSQL PostgreSQL存储过程需要安装</li> |
|
</ul> |
|
<pre><code> 注意:EasyScheduler本身不依赖Hadoop、Hive、Spark、PostgreSQL,仅是会调用他们的Client,用于对应任务的运行。 |
|
</code></pre><h2 id="项目编译">项目编译</h2> |
|
<ul> |
|
<li>执行编译命令:</li> |
|
</ul> |
|
<pre><code> mvn -U clean package assembly:assembly -Dmaven.test.skip=true |
|
</code></pre><ul> |
|
<li>查看目录</li> |
|
</ul> |
|
<p>正常编译完后,会在当前目录生成 target/escheduler-{version}/</p> |
|
<ul> |
|
<li>说明</li> |
|
</ul> |
|
<pre><code>bin : 基础服务启动脚本 |
|
conf : 项目配置文件 |
|
lib : 项目依赖jar包,包括各个模块jar和第三方jar |
|
script : 集群启动、停止和服务监控启停脚本 |
|
sql : 项目依赖sql文件 |
|
install.sh : 一键部署脚本 |
|
</code></pre><h2 id="数据库初始化">数据库初始化</h2> |
|
<ul> |
|
<li>创建database和账号</li> |
|
</ul> |
|
<pre><code>mysql -h {host} -u {user} -p{password} |
|
mysql> CREATE DATABASE escheduler DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; |
|
mysql> GRANT ALL PRIVILEGES ON escheduler.* TO '{user}'@'%' IDENTIFIED BY '{password}'; |
|
mysql> GRANT ALL PRIVILEGES ON escheduler.* TO '{user}'@'localhost' IDENTIFIED BY '{password}'; |
|
mysql> flush privileges; |
|
</code></pre><ul> |
|
<li>创建表和导入基础数据</li> |
|
</ul> |
|
<pre><code>说明:在 target/escheduler-{version}/sql/escheduler.sql和quartz.sql |
|
|
|
mysql -h {host} -u {user} -p{password} -D {db} < escheduler.sql |
|
|
|
mysql -h {host} -u {user} -p{password} -D {db} < quartz.sql |
|
</code></pre><h2 id="创建部署用户">创建部署用户</h2> |
|
<ul> |
|
<li>在所有需要部署调度的机器上创建部署用户,因为worker服务是以 sudo -u {linux-user} 方式来执行作业,所以部署用户需要有 sudo 权限,而且是免密的。</li> |
|
</ul> |
|
<pre><code class="lang-部署账号">vi /etc/sudoers |
|
|
|
# 部署用户是 escheduler 账号 |
|
escheduler ALL=(ALL) NOPASSWD: NOPASSWD: ALL |
|
|
|
# 并且需要注释掉 Default requiretty 一行 |
|
#Default requiretty |
|
</code></pre> |
|
<h2 id="ssh免密配置">ssh免密配置</h2> |
|
<p> 在部署机器和其他安装机器上配置ssh免密登录,如果要在部署机上安装调度,需要配置本机免密登录自己</p> |
|
<ul> |
|
<li><a href="http://geek.analysys.cn/topic/113" target="_blank">将 <strong>主机器</strong> 和各个其它机器SSH打通</a></li> |
|
</ul> |
|
<h2 id="部署">部署</h2> |
|
<h3 id="1-修改安装目录权限">1. 修改安装目录权限</h3> |
|
<ul> |
|
<li>安装目录如下:</li> |
|
</ul> |
|
<pre><code> bin |
|
conf |
|
install.sh |
|
lib |
|
script |
|
sql |
|
</code></pre><ul> |
|
<li><p>修改权限(deployUser修改为对应部署用户)</p> |
|
<p> <code>sudo chown -R deployUser:deployUser *</code></p> |
|
</li> |
|
</ul> |
|
<h3 id="2-修改环境变量文件">2. 修改环境变量文件</h3> |
|
<ul> |
|
<li>根据业务需求,修改conf/env/目录下的<strong>escheduler_env.py</strong>,<strong>.escheduler_env.sh</strong>两个文件中的环境变量</li> |
|
</ul> |
|
<h3 id="3-修改部署参数">3. 修改部署参数</h3> |
|
<ul> |
|
<li><p>修改 <strong>install.sh</strong>中的参数,替换成自身业务所需的值</p> |
|
</li> |
|
<li><p>如果使用hdfs相关功能,需要拷贝<strong>hdfs-site.xml</strong>和<strong>core-site.xml</strong>到conf目录下</p> |
|
</li> |
|
</ul> |
|
<h3 id="4-一键部署">4. 一键部署</h3> |
|
<ul> |
|
<li><p>安装zookeeper工具 </p> |
|
<p> <code>pip install kazoo</code></p> |
|
</li> |
|
<li><p>切换到部署用户,一键部署</p> |
|
<p> <code>sh install.sh</code> </p> |
|
</li> |
|
<li><p>jps查看服务是否启动</p> |
|
</li> |
|
</ul> |
|
<pre><code class="lang-aidl"> MasterServer ----- master服务 |
|
WorkerServer ----- worker服务 |
|
LoggerServer ----- logger服务 |
|
ApiApplicationServer ----- api服务 |
|
AlertServer ----- alert服务 |
|
</code></pre> |
|
<h2 id="日志查看">日志查看</h2> |
|
<p>日志统一存放于指定文件夹内</p> |
|
<pre><code class="lang-日志路径"> logs/ |
|
├── escheduler-alert-server.log |
|
├── escheduler-master-server.log |
|
|—— escheduler-worker-server.log |
|
|—— escheduler-api-server.log |
|
|—— escheduler-logger-server.log |
|
</code></pre> |
|
<h2 id="启停服务">启停服务</h2> |
|
<ul> |
|
<li>启停Master</li> |
|
</ul> |
|
<pre><code class="lang-启动master">sh ./bin/escheduler-daemon.sh start master-server |
|
sh ./bin/escheduler-daemon.sh stop master-server |
|
</code></pre> |
|
<ul> |
|
<li>启停Worker</li> |
|
</ul> |
|
<pre><code>sh ./bin/escheduler-daemon.sh start worker-server |
|
sh ./bin/escheduler-daemon.sh stop worker-server |
|
</code></pre><ul> |
|
<li>启停Api</li> |
|
</ul> |
|
<pre><code>sh ./bin/escheduler-daemon.sh start api-server |
|
sh ./bin/escheduler-daemon.sh stop api-server |
|
</code></pre><ul> |
|
<li>启停Logger</li> |
|
</ul> |
|
<pre><code>sh ./bin/escheduler-daemon.sh start logger-server |
|
sh ./bin/escheduler-daemon.sh stop logger-server |
|
</code></pre><ul> |
|
<li>启停Alert</li> |
|
</ul> |
|
<pre><code>sh ./bin/escheduler-daemon.sh start alert-server |
|
sh ./bin/escheduler-daemon.sh stop alert-server |
|
</code></pre> |
|
|
|
</section> |
|
|
|
</div> |
|
<div class="search-results"> |
|
<div class="has-results"> |
|
|
|
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1> |
|
<ul class="search-results-list"></ul> |
|
|
|
</div> |
|
<div class="no-results"> |
|
|
|
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1> |
|
|
|
</div> |
|
</div> |
|
</div> |
|
|
|
</div> |
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<a href="系统使用手册.html#使用手册" class="navigation navigation-next navigation-unique" aria-label="Next page: 系统使用手册"> |
|
<i class="fa fa-angle-right"></i> |
|
</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<script> |
|
var gitbook = gitbook || []; |
|
gitbook.push(function() { |
|
gitbook.page.hasChanged({"page":{"title":"后端部署文档","level":"1.3.1","depth":2,"next":{"title":"系统使用手册","level":"1.4","depth":1,"anchor":"#使用手册","path":"系统使用手册.md","ref":"系统使用手册.md#使用手册","articles":[]},"previous":{"title":"后端部署文档","level":"1.3","depth":1,"ref":"","articles":[{"title":"后端部署文档","level":"1.3.1","depth":2,"anchor":"#部署文档","path":"后端部署文档.md","ref":"后端部署文档.md#部署文档","articles":[]}]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","insert-logo-link","livereload"],"styles":{"website":"./styles/website.css"},"pluginsConfig":{"livereload":{},"insert-logo-link":{"src":"http://geek.analysys.cn/static/upload/236/2019-03-29/379450b4-7919-4707-877c-4d33300377d4.png","url":"https://github.com/analysys/EasyScheduler"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{}},"theme":"default","author":"YIGUAN","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"调度系统-EasyScheduler","language":"zh-hans","gitbook":"3.2.3","description":"调度系统"},"file":{"path":"后端部署文档.md","mtime":"2019-04-12T03:01:32.518Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-10T07:14:01.407Z"},"basePath":".","book":{"language":""}}); |
|
}); |
|
</script> |
|
</div> |
|
|
|
|
|
<script src="gitbook/gitbook.js"></script> |
|
<script src="gitbook/theme.js"></script> |
|
|
|
|
|
<script src="gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script> |
|
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-insert-logo-link/plugin.js"></script> |
|
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-livereload/plugin.js"></script> |
|
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-search/search-engine.js"></script> |
|
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-search/search.js"></script> |
|
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script> |
|
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script> |
|
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-sharing/buttons.js"></script> |
|
|
|
|
|
|
|
<script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script> |
|
|
|
|
|
|
|
</body> |
|
</html> |
|
|
|
|