123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886 |
- <!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="task-plugin-development.html" />
-
-
- <link rel="prev" href="architecture-design.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="frontend-deploy.html">
-
- <a href="frontend-deploy.html#前端项目环境构建及编译">
-
-
- 环境搭建
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.2.2" data-path="frontend-deploy.html">
-
- <a href="frontend-deploy.html#安装及配置">
-
-
- 安装及配置
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.2.3" data-path="frontend-deploy.html">
-
- <a href="frontend-deploy.html#项目生产环境配置">
-
-
- 项目生产环境Nginx配置
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.2.4" data-path="frontend-deploy.html">
-
- <a href="frontend-deploy.html#前端项目发布">
-
-
- 前端项目发布
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.2.5" data-path="frontend-deploy.html">
-
- <a href="frontend-deploy.html#问题">
-
-
- 问题
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.2.6" data-path="frontend-development.html">
-
- <a href="frontend-development.html#项目目录结构">
-
-
- 项目目录结构
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.2.7" data-path="frontend-development.html">
-
- <a href="frontend-development.html#系统功能模块">
-
-
- 系统功能模块
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.2.8" data-path="frontend-development.html">
-
- <a href="frontend-development.html#路由和状态管理">
-
-
- 路由和状态管理
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.2.9" data-path="frontend-development.html">
-
- <a href="frontend-development.html#规范">
-
-
- 规范
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.2.10" data-path="frontend-development.html">
-
- <a href="frontend-development.html#接口">
-
-
- 接口
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.2.11" data-path="frontend-development.html">
-
- <a href="frontend-development.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="architecture-design.html">
-
- <a href="architecture-design.html#调度系统架构设计">
-
-
- 系统架构设计
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.3.2" data-path="backend-deploy.html">
-
- <a href="backend-deploy.html#部署文档">
-
-
- 部署文档
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.3.3" data-path="task-plugin-development.html">
-
- <a href="task-plugin-development.html#任务插件开发">
-
-
- 自定义任务插件文档
-
- </a>
-
-
- </li>
-
- </ul>
-
- </li>
-
- <li class="chapter " data-level="1.4" data-path="user-manual.md">
-
- <span>
-
-
- 使用说明文档
-
- </a>
-
-
- </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.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.7.3) :选装,资源上传,MR任务提交需要安装</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 sql任务和postgresql 存储过程需要安装</li>
- </ul>
- <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>
- <pre><code> bin
- conf
- lib
- script
- sql
- install.sh
- </code></pre><ul>
- <li>说明</li>
- </ul>
- <pre><code>bin : 基础服务启动脚本
- conf : 项目配置文件
- lib : 项目依赖jar包,包括各个模块jar和第三方jar
- script : 集群启动、停止和服务监控启停脚本
- sql : 项目依赖sql文件
- install.sh : 一键部署脚本
- </code></pre><h2 id="数据库初始化">数据库初始化</h2>
- <ul>
- <li>创建db和账号</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>
- <p>因为escheduler worker 都是以 sudo -u {linux-user} 方式来执行作业,所以部署用户需要有 sudo 权限,而且是免密的。</p>
- <pre><code class="lang-部署账号">vi /etc/sudoers
- # 部署用户是 escheduler 账号
- escheduler ALL=(ALL) NOPASSWD: NOPASSWD: ALL
- # 并且需要注释掉 Default requiretty 一行
- #Default requiretty
- </code></pre>
- <h2 id="配置文件说明">配置文件说明</h2>
- <pre><code>说明:配置文件位于 target/escheduler-{version}/conf 下面
- </code></pre><h3 id="escheduler-alert">escheduler-alert</h3>
- <p>配置邮件告警信息</p>
- <ul>
- <li>alert.properties </li>
- </ul>
- <pre><code>#alert type is EMAIL/SMS
- alert.type=EMAIL
- # mail server configuration
- mail.protocol=SMTP
- mail.server.host=smtp.exmail.qq.com
- mail.server.port=25
- mail.sender=xxxxxxx
- mail.passwd=xxxxxxx
- # xls file path,need create if not exist
- xls.file.path=/opt/xls
- </code></pre><h3 id="escheduler-common">escheduler-common</h3>
- <p>通用配置文件配置,队列选择及地址配置,通用文件目录配置</p>
- <ul>
- <li>common/common.properties</li>
- </ul>
- <pre><code>#task queue implementation, default "zookeeper"
- escheduler.queue.impl=zookeeper
- # user data directory path, self configuration, please make sure the directory exists and have read write permissions
- data.basedir.path=/tmp/escheduler
- # directory path for user data download. self configuration, please make sure the directory exists and have read write permissions
- data.download.basedir.path=/tmp/escheduler/download
- # process execute directory. self configuration, please make sure the directory exists and have read write permissions
- process.exec.basepath=/tmp/escheduler/exec
- # data base dir, resource file will store to this hadoop hdfs path, self configuration, please make sure the directory exists on hdfs and have read write permissions。"/escheduler" is recommended
- data.store2hdfs.basepath=/escheduler
- # whether hdfs starts
- hdfs.startup.state=true
- # system env path. self configuration, please make sure the directory and file exists and have read write execute permissions
- escheduler.env.path=/opt/.escheduler_env.sh
- escheduler.env.py=/opt/escheduler_env.py
- #resource.view.suffixs
- resource.view.suffixs=txt,log,sh,conf,cfg,py,java,sql,hql,xml
- # is development state? default "false"
- development.state=false
- </code></pre><p>SHELL任务 环境变量配置</p>
- <pre><code>说明:配置文件位于 target/escheduler-{version}/conf/env 下面
- </code></pre><p>.escheduler_env.sh </p>
- <pre><code>export HADOOP_HOME=/opt/soft/hadoop
- export HADOOP_CONF_DIR=/opt/soft/hadoop/etc/hadoop
- export SPARK_HOME1=/opt/soft/spark1
- export SPARK_HOME2=/opt/soft/spark2
- export PYTHON_HOME=/opt/soft/python
- export JAVA_HOME=/opt/soft/java
- export HIVE_HOME=/opt/soft/hive
- export PATH=$HADOOP_HOME/bin:$SPARK_HOME1/bin:$SPARK_HOME2/bin:$PYTHON_HOME/bin:$JAVA_HOME/bin:$HIVE_HOME/bin:$PATH
- </code></pre><p>​ </p>
- <p>Python任务 环境变量配置</p>
- <pre><code>说明:配置文件位于 target/escheduler-{version}/conf/env 下面
- </code></pre><p>escheduler_env.py</p>
- <pre><code>import os
- HADOOP_HOME="/opt/soft/hadoop"
- SPARK_HOME1="/opt/soft/spark1"
- SPARK_HOME2="/opt/soft/spark2"
- PYTHON_HOME="/opt/soft/python"
- JAVA_HOME="/opt/soft/java"
- HIVE_HOME="/opt/soft/hive"
- PATH=os.environ['PATH']
- PATH="%s/bin:%s/bin:%s/bin:%s/bin:%s/bin:%s/bin:%s"%(HIVE_HOME,HADOOP_HOME,SPARK_HOME1,SPARK_HOME2,JAVA_HOME,PYTHON_HOME,PATH)
- os.putenv('PATH','%s'%PATH)
- </code></pre><p>hadoop 配置文件</p>
- <ul>
- <li>common/hadoop/hadoop.properties</li>
- </ul>
- <pre><code># ha or single namenode,If namenode ha needs to copy core-site.xml and hdfs-site.xml to the conf directory
- fs.defaultFS=hdfs://mycluster:8020
- #resourcemanager ha note this need ips , this empty if single
- yarn.resourcemanager.ha.rm.ids=192.168.xx.xx,192.168.xx.xx
- # If it is a single resourcemanager, you only need to configure one host name. If it is resourcemanager HA, the default configuration is fine
- yarn.application.status.address=http://ark1:8088/ws/v1/cluster/apps/%s
- </code></pre><p>定时器配置文件</p>
- <ul>
- <li>quartz.properties</li>
- </ul>
- <pre><code>#============================================================================
- # Configure Main Scheduler Properties
- #============================================================================
- org.quartz.scheduler.instanceName = EasyScheduler
- org.quartz.scheduler.instanceId = AUTO
- org.quartz.scheduler.makeSchedulerThreadDaemon = true
- org.quartz.jobStore.useProperties = false
- #============================================================================
- # Configure ThreadPool
- #============================================================================
- org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
- org.quartz.threadPool.makeThreadsDaemons = true
- org.quartz.threadPool.threadCount = 25
- org.quartz.threadPool.threadPriority = 5
- #============================================================================
- # Configure JobStore
- #============================================================================
- org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
- org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
- org.quartz.jobStore.tablePrefix = QRTZ_
- org.quartz.jobStore.isClustered = true
- org.quartz.jobStore.misfireThreshold = 60000
- org.quartz.jobStore.clusterCheckinInterval = 5000
- org.quartz.jobStore.dataSource = myDs
- #============================================================================
- # Configure Datasources
- #============================================================================
- org.quartz.dataSource.myDs.driver = com.mysql.jdbc.Driver
- org.quartz.dataSource.myDs.URL = jdbc:mysql://192.168.xx.xx:3306/escheduler?characterEncoding=utf8&useSSL=false
- org.quartz.dataSource.myDs.user = xx
- org.quartz.dataSource.myDs.password = xx
- org.quartz.dataSource.myDs.maxConnections = 10
- org.quartz.dataSource.myDs.validationQuery = select 1
- </code></pre><p>zookeeper 配置文件</p>
- <ul>
- <li>zookeeper.properties</li>
- </ul>
- <pre><code>#zookeeper cluster
- zookeeper.quorum=192.168.xx.xx:2181,192.168.xx.xx:2181,192.168.xx.xx:2181
- #escheduler root directory
- zookeeper.escheduler.root=/escheduler
- #zookeeper server dirctory
- zookeeper.escheduler.dead.servers=/escheduler/dead-servers
- zookeeper.escheduler.masters=/escheduler/masters
- zookeeper.escheduler.workers=/escheduler/workers
- #zookeeper lock dirctory
- zookeeper.escheduler.lock.masters=/escheduler/lock/masters
- zookeeper.escheduler.lock.workers=/escheduler/lock/workers
- #escheduler failover directory
- zookeeper.escheduler.lock.masters.failover=/escheduler/lock/failover/masters
- zookeeper.escheduler.lock.workers.failover=/escheduler/lock/failover/workers
- #escheduler failover directory
- zookeeper.session.timeout=300
- zookeeper.connection.timeout=300
- zookeeper.retry.sleep=1000
- zookeeper.retry.maxtime=5
- </code></pre><h3 id="escheduler-dao">escheduler-dao</h3>
- <p>dao数据源配置</p>
- <ul>
- <li>dao/data_source.properties</li>
- </ul>
- <pre><code># base spring data source configuration
- spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
- spring.datasource.driver-class-name=com.mysql.jdbc.Driver
- spring.datasource.url=jdbc:mysql://192.168.xx.xx:3306/escheduler?characterEncoding=UTF-8
- spring.datasource.username=xx
- spring.datasource.password=xx
- # connection configuration
- spring.datasource.initialSize=5
- # min connection number
- spring.datasource.minIdle=5
- # max connection number
- spring.datasource.maxActive=50
- # max wait time for get a connection in milliseconds. if configuring maxWait, fair locks are enabled by default and concurrency efficiency decreases.
- # If necessary, unfair locks can be used by configuring the useUnfairLock attribute to true.
- spring.datasource.maxWait=60000
- # milliseconds for check to close free connections
- spring.datasource.timeBetweenEvictionRunsMillis=60000
- # the Destroy thread detects the connection interval and closes the physical connection in milliseconds if the connection idle time is greater than or equal to minEvictableIdleTimeMillis.
- spring.datasource.timeBetweenConnectErrorMillis=60000
- # the longest time a connection remains idle without being evicted, in milliseconds
- spring.datasource.minEvictableIdleTimeMillis=300000
- #the SQL used to check whether the connection is valid requires a query statement. If validation Query is null, testOnBorrow, testOnReturn, and testWhileIdle will not work.
- spring.datasource.validationQuery=SELECT 1
- #check whether the connection is valid for timeout, in seconds
- spring.datasource.validationQueryTimeout=3
- # when applying for a connection, if it is detected that the connection is idle longer than time Between Eviction Runs Millis,
- # validation Query is performed to check whether the connection is valid
- spring.datasource.testWhileIdle=true
- #execute validation to check if the connection is valid when applying for a connection
- spring.datasource.testOnBorrow=true
- #execute validation to check if the connection is valid when the connection is returned
- spring.datasource.testOnReturn=false
- spring.datasource.defaultAutoCommit=true
- spring.datasource.keepAlive=true
- # open PSCache, specify count PSCache for every connection
- spring.datasource.poolPreparedStatements=true
- spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
- </code></pre><h3 id="escheduler-server">escheduler-server</h3>
- <p>master配置文件</p>
- <ul>
- <li>master.properties</li>
- </ul>
- <pre><code># master execute thread num
- master.exec.threads=100
- # master execute task number in parallel
- master.exec.task.number=20
- # master heartbeat interval
- master.heartbeat.interval=10
- # master commit task retry times
- master.task.commit.retryTimes=5
- # master commit task interval
- master.task.commit.interval=100
- # only less than cpu avg load, master server can work. default value : the number of cpu cores * 2
- master.max.cpuload.avg=10
- # only larger than reserved memory, master server can work. default value : physical memory * 1/10, unit is G.
- master.reserved.memory=1
- </code></pre><p>worker配置文件</p>
- <ul>
- <li>worker.properties</li>
- </ul>
- <pre><code># worker execute thread num
- worker.exec.threads=100
- # worker heartbeat interval
- worker.heartbeat.interval=10
- # submit the number of tasks at a time
- worker.fetch.task.num = 10
- # only less than cpu avg load, worker server can work. default value : the number of cpu cores * 2
- worker.max.cpuload.avg=10
- # only larger than reserved memory, worker server can work. default value : physical memory * 1/6, unit is G.
- worker.reserved.memory=1
- </code></pre><h3 id="escheduler-api">escheduler-api</h3>
- <p>web配置文件</p>
- <ul>
- <li>application.properties</li>
- </ul>
- <pre><code># server port
- server.port=12345
- # session config
- server.session.timeout=7200
- server.context-path=/escheduler/
- # file size limit for upload
- spring.http.multipart.max-file-size=1024MB
- spring.http.multipart.max-request-size=1024MB
- # post content
- server.max-http-post-size=5000000
- </code></pre><h2 id="伪分布式部署">伪分布式部署</h2>
- <h3 id="1,创建部署用户">1,创建部署用户</h3>
- <p>​ 如上 <strong>创建部署用户</strong></p>
- <h3 id="2,根据实际需求来创建hdfs根路径">2,根据实际需求来创建HDFS根路径</h3>
- <p>​ 根据 <strong>common/common.properties</strong> 中 <strong>hdfs.startup.state</strong> 的配置来判断是否启动HDFS,如果启动,则需要创建HDFS根路径,并将 <strong>owner</strong> 修改为<strong>部署用户</strong>,否则忽略此步骤</p>
- <h3 id="3,项目编译">3,项目编译</h3>
- <p>​ 如上进行 <strong>项目编译</strong></p>
- <h3 id="4,修改配置文件">4,修改配置文件</h3>
- <p>​ 根据 <strong>配置文件说明</strong> 修改配置文件和 <strong>环境变量</strong> 文件</p>
- <h3 id="5,创建目录并将环境变量文件复制到指定目录">5,创建目录并将环境变量文件复制到指定目录</h3>
- <ul>
- <li><p>创建 <strong>common/common.properties</strong> 下的data.basedir.path、data.download.basedir.path和process.exec.basepath路径</p>
- </li>
- <li><p>将<strong>.escheduler_env.sh</strong> 和 <strong>escheduler_env.py</strong> 两个环境变量文件复制到 <strong>common/common.properties</strong>配置的<strong>escheduler.env.path</strong> 和 <strong>escheduler.env.py</strong> 的目录下,并将 <strong>owner</strong> 修改为<strong>部署用户</strong></p>
- </li>
- </ul>
- <h3 id="6,启停服务">6,启停服务</h3>
- <ul>
- <li>启停Master</li>
- </ul>
- <pre><code class="lang-启动master">sh ./bin/arklifter-daemon.sh start master-server
- sh ./bin/arklifter-daemon.sh stop master-server
- </code></pre>
- <ul>
- <li>启停Worker</li>
- </ul>
- <pre><code>sh ./bin/arklifter-daemon.sh start worker-server
- sh ./bin/arklifter-daemon.sh stop worker-server
- </code></pre><ul>
- <li>启停Api</li>
- </ul>
- <pre><code>sh ./bin/arklifter-daemon.sh start api-server
- sh ./bin/arklifter-daemon.sh stop api-server
- </code></pre><ul>
- <li>启停Logger</li>
- </ul>
- <pre><code>sh ./bin/arklifter-daemon.sh start logger-server
- sh ./bin/arklifter-daemon.sh stop logger-server
- </code></pre><ul>
- <li>启停Alert</li>
- </ul>
- <pre><code>sh ./bin/arklifter-daemon.sh start alert-server
- sh ./bin/arklifter-daemon.sh stop alert-server
- </code></pre><h2 id="分布式部署">分布式部署</h2>
- <h3 id="1,创建部署用户">1,创建部署用户</h3>
- <ul>
- <li>在需要部署调度的机器上如上 <strong>创建部署用户</strong></li>
- <li><a href="https://blog.csdn.net/thinkmore1314/article/details/22489203" target="_blank">将 <strong>主机器</strong> 和各个其它机器SSH打通</a></li>
- </ul>
- <h3 id="2,根据实际需求来创建hdfs根路径">2,根据实际需求来创建HDFS根路径</h3>
- <p>​ 根据 <strong>common/common.properties</strong> 中 <strong>hdfs.startup.state</strong> 的配置来判断是否启动HDFS,如果启动,则需要创建HDFS根路径,并将 <strong>owner</strong> 修改为<strong>部署用户</strong>,否则忽略此步骤</p>
- <h3 id="3,项目编译">3,项目编译</h3>
- <p>​ 如上进行 <strong>项目编译</strong></p>
- <h3 id="4,将环境变量文件复制到指定目录">4,将环境变量文件复制到指定目录</h3>
- <p>​ 将<strong>.escheduler_env.sh</strong> 和 <strong>escheduler_env.py</strong> 两个环境变量文件复制到 <strong>common/common.properties</strong>配置的<strong>escheduler.env.path</strong> 和 <strong>escheduler.env.py</strong> 的目录下,并将 <strong>owner</strong> 修改为<strong>部署用户</strong></p>
- <h3 id="5,修改-installsh">5,修改 install.sh</h3>
- <p>​ 修改 install.sh 中变量的值,替换成自身业务所需的值</p>
- <h3 id="6,一键部署">6,一键部署</h3>
- <ul>
- <li><p>安装 pip install kazoo</p>
- </li>
- <li><p>使用部署用户 sh install.sh 一键部署</p>
- </li>
- </ul>
- <h2 id="服务监控">服务监控</h2>
- <p>monitor_server.py 脚本是监听,master和worker服务挂掉重启的脚本</p>
- <p>注意:在全部服务都启动之后启动</p>
- <p>nohup python -u monitor_server.py > nohup.out 2>&1 &</p>
- <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>
-
- </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="architecture-design.html#调度系统架构设计" class="navigation navigation-prev " aria-label="Previous page: 系统架构设计">
- <i class="fa fa-angle-left"></i>
- </a>
-
-
- <a href="task-plugin-development.html#任务插件开发" class="navigation navigation-next " 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.2","depth":2,"next":{"title":"自定义任务插件文档","level":"1.3.3","depth":2,"anchor":"#任务插件开发","path":"task-plugin-development.md","ref":"task-plugin-development.md#任务插件开发","articles":[]},"previous":{"title":"系统架构设计","level":"1.3.1","depth":2,"anchor":"#调度系统架构设计","path":"architecture-design.md","ref":"architecture-design.md#调度系统架构设计","articles":[]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","insert-logo-link"],"styles":{"website":"./styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"../images/logo.png","url":"/"},"expandable-chapters":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"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}},"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":"backend-deploy.md","mtime":"2019-03-28T11:14:39.609Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-03-28T11:15:13.750Z"},"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-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>
|