分布式调度框架。
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.

1092 lines
42 KiB

6 years ago
<!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="deploy-foreground.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="guide-architecture.html">
<a href="guide-architecture.html">
系统架构分析
</a>
<ul class="articles">
<li class="chapter " data-level="1.2.1.1" data-path="guide-architecture.html">
<a href="guide-architecture.html#导语">
导语
</a>
</li>
<li class="chapter " data-level="1.2.1.2" data-path="guide-architecture.html">
<a href="guide-architecture.html#背景">
背景
</a>
</li>
<li class="chapter " data-level="1.2.1.3" data-path="guide-architecture.html">
<a href="guide-architecture.html#总架构设计">
总架构设计
</a>
</li>
<li class="chapter " data-level="1.2.1.4" data-path="guide-architecture.html">
<a href="guide-architecture.html#中心化思想">
中心化思想
</a>
</li>
<li class="chapter " data-level="1.2.1.5" data-path="guide-architecture.html">
<a href="guide-architecture.html#分布式锁实践">
分布式锁实践
</a>
</li>
<li class="chapter " data-level="1.2.1.6" data-path="guide-architecture.html">
<a href="guide-architecture.html#线程不足循环等待问题">
线程不足循环等待问题
</a>
</li>
<li class="chapter " data-level="1.2.1.7" data-path="guide-architecture.html">
<a href="guide-architecture.html#容错设计">
容错设计
</a>
</li>
<li class="chapter " data-level="1.2.1.8" data-path="guide-architecture.html">
<a href="guide-architecture.html#日志访问">
Logback和gRPC实现日志访问
</a>
</li>
<li class="chapter " data-level="1.2.1.9" data-path="guide-architecture.html">
<a href="guide-architecture.html#总结">
总结
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.2.2" data-path="guide-manual.html">
<a href="guide-manual.html">
使用手册
</a>
<ul class="articles">
<li class="chapter " data-level="1.2.2.1" data-path="guide-manual.html">
<a href="guide-manual.html#登录">
登录
</a>
</li>
<li class="chapter " data-level="1.2.2.2" data-path="guide-manual.html">
<a href="guide-manual.html#安全中心">
安全中心
</a>
</li>
<li class="chapter " data-level="1.2.2.3" data-path="guide-manual.html">
<a href="guide-manual.html#资源中心">
资源中心
</a>
</li>
<li class="chapter " data-level="1.2.2.4" data-path="guide-manual.html">
<a href="guide-manual.html#数据源中心">
数据源中心
</a>
</li>
<li class="chapter " data-level="1.2.2.5" data-path="guide-manual.html">
<a href="guide-manual.html#项目管理">
项目管理
</a>
</li>
<li class="chapter " data-level="1.2.2.6" data-path="guide-manual.html">
<a href="guide-manual.html#首页">
站点首页
</a>
</li>
<li class="chapter " data-level="1.2.2.7" data-path="guide-manual.html">
<a href="guide-manual.html#任务依赖">
任务依赖
</a>
</li>
<li class="chapter " data-level="1.2.2.8" data-path="guide-manual.html">
<a href="guide-manual.html#系统参数">
系统参数
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" >
<span>
项目部署文档
</span>
<ul class="articles">
<li class="chapter active" data-level="1.3.1" data-path="deploy-foreground.html">
<a href="deploy-foreground.html">
前端部署
</a>
<ul class="articles">
<li class="chapter " data-level="1.3.1.1" data-path="deploy-foreground.html">
<a href="deploy-foreground.html#前端项目环境构建及编译">
前端项目环境构建及编译
</a>
</li>
<li class="chapter " data-level="1.3.1.2" data-path="deploy-foreground.html">
<a href="deploy-foreground.html#安装及配置">
安装及配置
</a>
</li>
<li class="chapter " data-level="1.3.1.3" data-path="deploy-foreground.html">
<a href="deploy-foreground.html#项目生产环境配置">
项目生产环境Nginx配置
</a>
</li>
<li class="chapter " data-level="1.3.1.4" data-path="deploy-foreground.html">
<a href="deploy-foreground.html#前端项目发布">
前端项目发布
</a>
</li>
<li class="chapter " data-level="1.3.1.5" data-path="deploy-foreground.html">
<a href="deploy-foreground.html#问题">
问题
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3.2" data-path="deploy-background.html">
<a href="deploy-background.html">
后端部署
</a>
<ul class="articles">
<li class="chapter " data-level="1.3.2.1" data-path="deploy-background.html">
<a href="deploy-background.html#基础软件安装">
基础软件安装
</a>
</li>
<li class="chapter " data-level="1.3.2.2" data-path="deploy-background.html">
<a href="deploy-background.html#项目编译">
项目编译
</a>
</li>
<li class="chapter " data-level="1.3.2.3" data-path="deploy-background.html">
<a href="deploy-background.html#数据库初始化">
数据库初始化
</a>
</li>
<li class="chapter " data-level="1.3.2.4" data-path="deploy-background.html">
<a href="deploy-background.html#创建部署用户">
创建部署用户
</a>
</li>
<li class="chapter " data-level="1.3.2.5" data-path="deploy-background.html">
<a href="deploy-background.html#配置文件">
配置文件
</a>
<ul class="articles">
<li class="chapter " data-level="1.3.2.5.1" data-path="deploy-background.html">
<a href="deploy-background.html#escheduler-alert">
escheduler-alert
</a>
</li>
<li class="chapter " data-level="1.3.2.5.2" data-path="deploy-background.html">
<a href="deploy-background.html#escheduler-common">
escheduler-common
</a>
</li>
<li class="chapter " data-level="1.3.2.5.3" data-path="deploy-background.html">
<a href="deploy-background.html#escheduler-dao">
escheduler-dao
</a>
</li>
<li class="chapter " data-level="1.3.2.5.4" data-path="deploy-background.html">
<a href="deploy-background.html#escheduler-server">
escheduler-server
</a>
</li>
<li class="chapter " data-level="1.3.2.5.5" data-path="deploy-background.html">
<a href="deploy-background.html#escheduler-web">
escheduler-web
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3.2.6" data-path="deploy-background.html">
<a href="deploy-background.html#启动停止命令">
启动停止命令
</a>
</li>
<li class="chapter " data-level="1.3.2.7" data-path="deploy-background.html">
<a href="deploy-background.html#一键启停脚本">
一键启停脚本
</a>
</li>
<li class="chapter " data-level="1.3.2.8" data-path="deploy-background.html">
<a href="deploy-background.html#监控服务">
监控服务
</a>
</li>
<li class="chapter " data-level="1.3.2.9" data-path="deploy-background.html">
<a href="deploy-background.html#日志查看">
日志查看
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" >
<span>
前端开发文档
</span>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="foreground-2.html">
<a href="foreground-2.html">
安装
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" >
<span>
后端开发文档
</span>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="background-2.html">
<a href="background-2.html">
后端说明2
</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="&#x524D;&#x7AEF;&#x90E8;&#x7F72;&#x6587;&#x6863;">&#x524D;&#x7AEF;&#x90E8;&#x7F72;&#x6587;&#x6863;</h1>
<h2 id="&#x524D;&#x7AEF;&#x9879;&#x76EE;&#x73AF;&#x5883;&#x6784;&#x5EFA;&#x53CA;&#x7F16;&#x8BD1;">&#x524D;&#x7AEF;&#x9879;&#x76EE;&#x73AF;&#x5883;&#x6784;&#x5EFA;&#x53CA;&#x7F16;&#x8BD1;</h2>
<h4 id="escheduler&#x9879;&#x76EE;&#x524D;&#x7AEF;&#x6280;&#x672F;&#x6808;">Escheduler&#x9879;&#x76EE;&#x524D;&#x7AEF;&#x6280;&#x672F;&#x6808;</h4>
<h5 id="vue--es6--ans-ui--d3--jsplumb--lodash"><code>Vue + es6 + Ans-ui + d3 + jsplumb + lodash</code></h5>
<h4 id="&#x5F00;&#x53D1;&#x73AF;&#x5883;">&#x5F00;&#x53D1;&#x73AF;&#x5883;</h4>
<h5 id="node"><code>Node</code></h5>
<ul>
<li><h4 id="node&#x5B89;&#x88C5;">node&#x5B89;&#x88C5;</h4>
<p>Node&#x5305;&#x4E0B;&#x8F7D; (&#x6CE8;&#x610F;&#x7248;&#x672C; 8.9.4) <code>https://nodejs.org/download/release/v8.9.4/</code> </p>
</li>
<li><h4 id="&#x62C9;&#x53D6;&#x524D;&#x7AEF;&#x9879;&#x76EE;&#x5230;&#x672C;&#x5730;">&#x62C9;&#x53D6;&#x524D;&#x7AEF;&#x9879;&#x76EE;&#x5230;&#x672C;&#x5730;</h4>
<p>&#x9879;&#x76EE;git&#x4ED3;&#x5E93;&#x5730;&#x5740; <code>git@git.analysys.cn:analysys_changsha/escheduler.git</code></p>
</li>
<li><h4 id="&#x524D;&#x7AEF;&#x9879;&#x76EE;&#x6784;&#x5EFA;">&#x524D;&#x7AEF;&#x9879;&#x76EE;&#x6784;&#x5EFA;</h4>
<p>&#x7528;&#x547D;&#x4EE4;&#x884C;&#x6A21;&#x5F0F; <code>cd</code> &#x8FDB;&#x5165; <code>escheduler</code>&#x9879;&#x76EE;&#x76EE;&#x5F55;&#x5E76;&#x6267;&#x884C; <code>npm install</code> &#x62C9;&#x53D6;&#x9879;&#x76EE;&#x4F9D;&#x8D56;&#x5305;</p>
</li>
</ul>
<blockquote>
<p>&#x5982;&#x679C; <code>npm install</code> &#x901F;&#x5EA6;&#x975E;&#x5E38;&#x6162; </p>
<p>&#x53EF;&#x4EE5;&#x8F6C;&#x6DD8;&#x5B9D;&#x955C;&#x50CF;&#x547D;&#x4EE4;&#x884C;&#x8F93;&#x5165; <code>npm install -g cnpm --registry=https://registry.npm.taobao.org</code></p>
<p>&#x8FD0;&#x884C; <code>cnpm install</code> </p>
<h5 id="&#xFF01;&#xFF01;&#xFF01;&#x8FD9;&#x91CC;&#x7279;&#x522B;&#x6CE8;&#x610F;-&#x9879;&#x76EE;&#x5982;&#x679C;&#x5728;&#x62C9;&#x53D6;&#x4F9D;&#x8D56;&#x5305;&#x7684;&#x8FC7;&#x7A0B;&#x4E2D;&#x62A5;--node-sass-error--&#x9519;&#x8BEF;&#xFF0C;&#x8BF7;&#x5728;&#x6267;&#x884C;&#x5B8C;&#x540E;&#x518D;&#x6B21;&#x6267;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;">&#xFF01;&#xFF01;&#xFF01;&#x8FD9;&#x91CC;&#x7279;&#x522B;&#x6CE8;&#x610F; &#x9879;&#x76EE;&#x5982;&#x679C;&#x5728;&#x62C9;&#x53D6;&#x4F9D;&#x8D56;&#x5305;&#x7684;&#x8FC7;&#x7A0B;&#x4E2D;&#x62A5; &quot; node-sass error &quot; &#x9519;&#x8BEF;&#xFF0C;&#x8BF7;&#x5728;&#x6267;&#x884C;&#x5B8C;&#x540E;&#x518D;&#x6B21;&#x6267;&#x884C;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;</h5>
<pre><code>npm install node-sass --unsafe-perm //&#x5355;&#x72EC;&#x5B89;&#x88C5;node-sass&#x4F9D;&#x8D56;
</code></pre></blockquote>
<p>&#x9879;&#x76EE;&#x6839;&#x76EE;&#x5F55;&#x521B;&#x5EFA;<code>.env</code>&#x4E3A;&#x540E;&#x7F00;&#x540D;&#x7684;&#x6587;&#x4EF6;&#x5E76;&#x8F93;&#x5165;</p>
<pre><code># &#x524D;&#x7AEF;&#x4EE3;&#x7406;&#x7684;&#x63A5;&#x53E3;&#x5730;&#x5740;
API_BASE = http://192.168.220.204:12345
# &#x5982;&#x679C;&#x60A8;&#x9700;&#x8981;&#x7528;ip&#x8BBF;&#x95EE;&#x9879;&#x76EE;&#x53EF;&#x4EE5;&#x628A; &quot;#&quot; &#x53F7;&#x53BB;&#x6389;
#DEV_HOST = 192.168.6.132
</code></pre><p>&#x8FD0;&#x884C;</p>
<ul>
<li><p><code>npm start</code> &#x9879;&#x76EE;&#x5F00;&#x53D1;&#x73AF;&#x5883; (&#x542F;&#x52A8;&#x540E;&#x8BBF;&#x95EE;&#x5730;&#x5740; <a href="http://localhost:8888/#/" target="_blank">http://localhost:8888/#/</a>)</p>
</li>
<li><p><code>npm run build</code> &#x9879;&#x76EE;&#x6253;&#x5305; (&#x6253;&#x5305;&#x540E;&#x6839;&#x76EE;&#x5F55;&#x4F1A;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x540D;&#x4E3A;dist&#x6587;&#x4EF6;&#x5939;&#xFF0C;&#x7528;&#x4E8E;&#x53D1;&#x5E03;&#x7EBF;&#x4E0A;Nginx)</p>
</li>
</ul>
<h2 id="&#x5B89;&#x88C5;&#x53CA;&#x914D;&#x7F6E;">&#x5B89;&#x88C5;&#x53CA;&#x914D;&#x7F6E;</h2>
<h3 id="1-1-nginx&#x5B89;&#x88C5;">(1-1) Nginx&#x5B89;&#x88C5;</h3>
<p>&#x5B89;&#x88C5; <code>wget http://nginx.org/download/nginx-1.10.1.tar.gz</code> </p>
<p>Nginx&#x7684;&#x914D;&#x7F6E;&#x53CA;&#x8FD0;&#x884C;&#x9700;&#x8981;pcre&#x3001;zlib&#x7B49;&#x8F6F;&#x4EF6;&#x5305;&#x7684;&#x652F;&#x6301;&#xFF0C;&#x56E0;&#x6B64;&#x5E94;&#x9884;&#x5148;&#x5B89;&#x88C5;&#x8FD9;&#x4E9B;&#x8F6F;&#x4EF6;&#x7684;&#x5F00;&#x53D1;&#x5305;&#xFF08;devel&#xFF09;&#xFF0C;&#x4EE5;&#x4FBF;&#x63D0;&#x4F9B;&#x76F8;&#x5E94;&#x7684;&#x5E93;&#x548C;&#x5934;&#x6587;&#x4EF6;&#xFF0C;&#x786E;&#x4FDD;Nginx&#x7684;&#x5B89;&#x88C5;&#x987A;&#x5229;&#x5B8C;&#x6210;&#x3002;</p>
<pre><code>[root@nginx ~]# service iptables stop
[root@nginx ~]# setenforce 0
[root@nginx ~]# mount /dev/cdrom /mnt/
[root@nginx ~]# vim /etc/yum.repos.d/yum.repo
[base]
name=RedHat Enterprise Linux Server
baseurl=file:///mnt/Packages
gpgcheck=0
[root@nginx ~]# yum -y install pcre-devel zilb-devel openssl-devel
</code></pre><h3 id="1-2-&#x521B;&#x5EFA;&#x8FD0;&#x884C;&#x7528;&#x6237;&#x3001;&#x7EC4;">(1-2) &#x521B;&#x5EFA;&#x8FD0;&#x884C;&#x7528;&#x6237;&#x3001;&#x7EC4;</h3>
<p>Nginx&#x670D;&#x52A1;&#x7A0B;&#x5E8F;&#x9ED8;&#x8BA4;&#x4EE5;nobody&#x8EAB;&#x4EFD;&#x8FD0;&#x884C;&#xFF0C;&#x5EFA;&#x8BAE;&#x4E3A;&#x5176;&#x521B;&#x5EFA;&#x4E13;&#x95E8;&#x7684;&#x7528;&#x6237;&#x8D26;&#x53F7;&#xFF0C;&#x4EE5;&#x4FBF;&#x66F4;&#x51C6;&#x786E;&#x5730;&#x63A7;&#x5236;&#x5176;&#x8BBF;&#x95EE;&#x6743;&#x9650;&#xFF0C;&#x589E;&#x52A0;&#x7075;&#x6D3B;&#x6027;&#x3001;&#x964D;&#x4F4E;&#x5B89;&#x5168;&#x98CE;&#x9669;&#x3002;&#x5982;&#xFF1A;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x540D;&#x4E3A;nginx&#x7684;&#x7528;&#x6237;&#xFF0C;&#x4E0D;&#x5EFA;&#x7ACB;&#x5BBF;&#x4E3B;&#x76EE;&#x5F55;&#xFF0C;&#x4E5F;&#x7981;&#x6B62;&#x767B;&#x5F55;&#x5230;shell&#x73AF;&#x5883;&#x3002;</p>
<pre><code>[root@nginx ~]# useradd -M -s /sbin/nologin escheduler
</code></pre><h3 id="1-3-&#x7F16;&#x8BD1;&#x5B89;&#x88C5;nginx">(1-3) &#x7F16;&#x8BD1;&#x5B89;&#x88C5;nginx</h3>
<p>&#x91CA;&#x653E;nginx&#x6E90;&#x7801;&#x5305;</p>
<pre><code>[root@nginx ~]# tar xf nginx-1.6.2.tar.gz -C /usr/src/
</code></pre><p>&#x7F16;&#x8BD1;&#x524D;&#x914D;&#x7F6E;</p>
<pre><code>[root@nginx ~]# cd /usr/src/nginx-1.6.2/
[root@nginx nginx-1.6.2]# ./configure --prefix=/usr/local/nginx --user=escheduler --group=escheduler --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module
</code></pre><p>&#x6CE8;&#xFF1A;&#x914D;&#x7F6E;&#x524D;&#x53EF;&#x4EE5;&#x53C2;&#x8003; ./configure --help&#x7ED9;&#x51FA;&#x8BF4;&#x660E;</p>
<pre><code>--prefix &#x8BBE;&#x5B9A;Nginx&#x7684;&#x5B89;&#x88C5;&#x76EE;&#x5F55;
--user&#x548C;&#x2014;group &#x6307;&#x5B9A;Nginx&#x8FD0;&#x884C;&#x7528;&#x6237;&#x548C;&#x7EC4;
--with-http_stub_status_module &#x542F;&#x7528;http_stub_status_module&#x6A21;&#x5757;&#x4EE5;&#x652F;&#x6301;&#x72B6;&#x6001;&#x7EDF;&#x8BA1;
--with-http_ssl_module &#x542F;&#x7528;SSL&#x6A21;&#x5757;
</code></pre><blockquote>
<h4 id="&#x9519;&#x8BEF;">&#x9519;&#x8BEF;</h4>
<pre><code>[root@centos nginx-1.6.2]# ./configure --prefix=/usr/local/nginx --user=escheduler --group=escheduler --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module
checking for OS
+ Linux 2.6.32-431.el6.i686 i686
checking for C compiler ... not found
./configure: error: C compiler cc is not found
</code></pre><h4 id="&#x89E3;&#x51B3;&#x65B9;&#x6CD5;">&#x89E3;&#x51B3;&#x65B9;&#x6CD5;</h4>
<pre><code>yum -y install gcc gcc-c++
</code></pre></blockquote>
<p>&#x7F16;&#x8BD1; &#x5B89;&#x88C5;</p>
<pre><code>[root@nginx nginx-1.6.2]# make &amp;&amp; make install
</code></pre><p>&#x4E3A;&#x4E86;&#x4F7F;Nginx&#x670D;&#x52A1;&#x5668;&#x7684;&#x8FD0;&#x884C;&#x66F4;&#x52A0;&#x65B9;&#x4FBF;&#xFF0C;&#x53EF;&#x4EE5;&#x4E3A;&#x4E3B;&#x7A0B;&#x5E8F;nginx&#x521B;&#x5EFA;&#x94FE;&#x63A5;&#x6587;&#x4EF6;&#xFF0C;&#x4EE5;&#x4FBF;&#x7BA1;&#x7406;&#x5458;&#x76F4;&#x63A5;&#x6267;&#x884C;nginx&#x547D;&#x4EE4;&#x5C31;&#x53EF;&#x4EE5;&#x8C03;&#x7528;Nginx&#x7684;&#x4E3B;&#x7A0B;&#x5E8F;&#x3002;</p>
<pre><code>[root@nginx nginx-1.6.2]# ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/
[root@nginx nginx-1.6.2]# ll /usr/local/bin/nginx
lrwxrwxrwx 1 root root 27 12-29 07:24 /usr/local/bin/nginx -&gt; /usr/local/nginx/sbin/nginx
</code></pre><p>Nginx&#x7684;&#x8FD0;&#x884C;&#x63A7;&#x5236;
&#x4E0E;Apache&#x7684;&#x4E3B;&#x7A0B;&#x5E8F;httpd&#x7C7B;&#x4F3C;&#xFF0C;Nginx&#x7684;&#x4E3B;&#x7A0B;&#x5E8F;&#x4E5F;&#x63D0;&#x4F9B;&#x4E86;&quot;-t&quot;&#x9009;&#x9879;&#x7528;&#x6765;&#x5BF9;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x8FDB;&#x884C;&#x68C0;&#x67E5;&#xFF0C;&#x4EE5;&#x4FBF;&#x627E;&#x51FA;&#x4E0D;&#x5F53;&#x6216;&#x9519;&#x8BEF;&#x7684;&#x914D;&#x7F6E;&#x3002;&#x914D;&#x7F6E;&#x6587;&#x4EF6;nginx.conf&#x9ED8;&#x8BA4;&#x4F4D;&#x4E8E;&#x5B89;&#x88C5;&#x76EE;&#x5F55;/usr/local/nginx/conf/&#x76EE;&#x5F55;&#x4E2D;&#x3002;&#x82E5;&#x8981;&#x68C0;&#x67E5;&#x4F4D;&#x4E8E;&#x5176;&#x4ED6;&#x4F4D;&#x7F6E;&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;&#x53EF;&#x4F7F;&#x7528;&quot;-c&quot;&#x9009;&#x9879;&#x6765;&#x6307;&#x5B9A;&#x8DEF;&#x5F84;&#x3002;</p>
<pre><code>root@nginx conf]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
</code></pre><p>&#x542F;&#x52A8;&#x3001;&#x505C;&#x6B62;Nginx
&#x76F4;&#x63A5;&#x8FD0;&#x884C;nginx&#x5373;&#x53EF;&#x542F;&#x52A8;Nginx&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x5C06;&#x4F7F;&#x7528;&#x9ED8;&#x8BA4;&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;&#x82E5;&#x8981;&#x6539;&#x7528;&#x5176;&#x4ED6;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;&#x9700;&#x6DFB;&#x52A0;&quot;-c &#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x8DEF;&#x5F84;&quot;&#x9009;&#x9879;&#x6765;&#x6307;&#x5B9A;&#x8DEF;&#x5F84;&#x3002;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x662F;&#xFF0C;&#x82E5;&#x670D;&#x52A1;&#x5668;&#x4E2D;&#x5DF2;&#x5B89;&#x88C5;&#x6709;httpd&#x7B49;&#x5176;&#x4ED6;WEB&#x670D;&#x52A1;&#x8F6F;&#x4EF6;&#xFF0C;&#x5E94;&#x91C7;&#x53D6;&#x63AA;&#x65BD;&#xFF08;&#x4FEE;&#x6539;&#x7AEF;&#x53E3;&#xFF0C;&#x505C;&#x7528;&#x6216;&#x5378;&#x8F7D;&#xFF09;&#x907F;&#x514D;&#x90E8;&#x7A81;&#x3002;</p>
<pre><code>[root@nginx conf]# chown -R escheduler:escheduler /usr/local/nginx
/usr/local/nginx/conf/nginx.conf
[root@nginx conf]# netstat -anpt |grep :80
[root@nginx conf]# nginx
[root@nginx conf]# netstat -anpt |grep :80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 6810/nginx: master
</code></pre><p>&#x901A;&#x8FC7;&#x68C0;&#x67E5; Nginx&#x7A0B;&#x5E8F;&#x7684;&#x76D1;&#x542C;&#x72B6;&#x6001;&#xFF0C;&#x6216;&#x8005;&#x5728;&#x6D4F;&#x89C8;&#x5668;&#x4E2D;&#x8BBF;&#x95EE;&#x6B64;WEB&#x670D;&#x52A1;&#xFF08;&#x9ED8;&#x8BA4;&#x9875;&#x9762;&#x5C06;&#x663E;&#x793A;&quot;Welcome to nginx!&quot;&#xFF09;&#xFF0C;&#x53EF;&#x4EE5;&#x786E;&#x8BA4;Nginx&#x670D;&#x52A1;&#x662F;&#x5426;&#x6B63;&#x5E38;&#x8FD0;&#x884C;&#x3002;</p>
<pre><code>[root@nginx ~]# yum -y install elinks
[root@nginx ~]# elinks --dump http://localhost
Welcome to nginx!
</code></pre><p>&#x4E3B;&#x7A0B;&#x5E8F;Nginx&#x652F;&#x6301;&#x6807;&#x51C6;&#x7684;&#x8FDB;&#x7A0B;&#x4FE1;&#x53F7;&#xFF0C;&#x901A;&#x8FC7;kill&#x6216;&#x8005;killall&#x547D;&#x4EE4;&#x4F20;&#x9001;</p>
<pre><code>HUP &#x91CD;&#x8F7D;&#x914D;&#x7F6E; &#x7B49;&#x540C;&#x4E8E;-1
QUIT &#x9000;&#x51FA;&#x8FDB;&#x7A0B; &#x7B49;&#x540C;&#x4E8E;-3
KILL &#x6740;&#x6B7B;&#x8FDB;&#x7A0B;
[root@nginx ~]# killall -s HUP nginx
[root@nginx ~]# killall -s QUIT nginx
[root@nginx ~]# netstat -anpt |grep :80
</code></pre><p>&#x5F53;Nginx&#x8FDB;&#x7A0B;&#x8FD0;&#x884C;&#x65F6;&#xFF0C;PID&#x53F7;&#x9ED8;&#x8BA4;&#x5B58;&#x653E;&#x5728;logs/&#x76EE;&#x5F55;&#x4E0B;&#x7684;nginx.pid&#x6587;&#x4EF6;&#x4E2D;&#xFF0C;&#x56E0;&#x6B64;&#x82E5;&#x6539;&#x7528;kill&#x547D;&#x4EE4;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x6839;&#x636E;nginx.pid&#x6587;&#x4EF6;&#x4E2D;&#x7684;PID&#x53F7;&#x6765;&#x8FDB;&#x884C;&#x63A7;&#x5236;&#x3002;
&#x4E3A;&#x4E86;&#x4F7F;Nginx&#x670D;&#x52A1;&#x7684;&#x542F;&#x52A8;&#x3001;&#x505C;&#x6B62;&#x3001;&#x91CD;&#x8F7D;&#x7B49;&#x64CD;&#x4F5C;&#x66F4;&#x52A0;&#x65B9;&#x4FBF;&#xFF0C;&#x53EF;&#x4EE5;&#x7F16;&#x5199;Nginx&#x670D;&#x52A1;&#x811A;&#x672C;&#xFF0C;&#x5E76;&#x4F7F;&#x7528;chkconfig&#x548C;service&#x5DE5;&#x5177;&#x6765;&#x8FDB;&#x884C;&#x7BA1;&#x7406;&#xFF0C;&#x4E5F;&#x66F4;&#x52A0;&#x7B26;&#x5408;RHEL&#x7CFB;&#x7EDF;&#x7684;&#x7BA1;&#x7406;&#x4E60;&#x60EF;&#x3002;</p>
<pre><code>[root@nginx ~]# vim /etc/init.d/nginx
</code></pre><p>&#x811A;&#x672C;&#x4E00;</p>
<pre><code>#!/bin/bash
# chkconfig: 2345 99 20
# description: Nginx Server Control Script
PROG=&quot;/usr/local/nginx/sbin/nginx&quot;
PIDF=&quot;/usr/local/nginx/logs/nginx.pid&quot;
case &quot;$1&quot; in
start)
$PROG
;;
stop)
kill -s QUIT $(cat $PIDF)
;;
restart)
$0 stop
$0 start
;;
reload)
kill -s HUP $(cat $PIDF)
;;
*)
echo &quot;Usage: $0 (start|stop|restart|reload)&quot;
exit 1
esac
exit 0
[root@nginx ~]# chmod +x /etc/init.d/nginx
[root@nginx ~]# chkconfig --add nginx
[root@nginx ~]# chkconfig nginx on
[root@nginx ~]# chkconfig --list nginx
nginx 0:&#x5173;&#x95ED; 1:&#x5173;&#x95ED; 2:&#x542F;&#x7528; 3:&#x542F;&#x7528; 4:&#x542F;&#x7528; 5:&#x542F;&#x7528; 6:&#x5173;&#x95ED;
</code></pre><p>&#x62A5;&#x9519;&#x7684;&#x8BDD;&#xFF1A; <code>/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf</code></p>
<p>&#x8FD9;&#x6837;&#x5C31;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;nginx&#x811A;&#x672C;&#x6765;&#x542F;&#x52A8;&#x3001;&#x505C;&#x6B62;&#x3001;&#x91CD;&#x542F;&#x3001;&#x91CD;&#x8F7D;Nginx&#x670D;&#x52A1;&#x5668;&#x4E86;&#x3002;</p>
<h3 id="2-1-root&#x5B89;&#x88C5;">(2-1) root&#x5B89;&#x88C5;</h3>
<p>&#x5B89;&#x88C5;epel&#x6E90; <code>yum install epel-release -y</code></p>
<p>&#x5B89;&#x88C5;Nginx <code>yum install nginx -y</code></p>
<h4 id="&#x547D;&#x4EE4;">&#x547D;&#x4EE4;</h4>
<ul>
<li><p>&#x542F;&#x7528; <code>systemctl enable nginx</code></p>
</li>
<li><p>&#x91CD;&#x542F; <code>systemctl restart nginx</code></p>
</li>
<li><p>&#x72B6;&#x6001; <code>systemctl status nginx</code></p>
</li>
</ul>
<h1 id="&#x9879;&#x76EE;&#x751F;&#x4EA7;&#x73AF;&#x5883;&#x914D;&#x7F6E;">&#x9879;&#x76EE;&#x751F;&#x4EA7;&#x73AF;&#x5883;&#x914D;&#x7F6E;</h1>
<blockquote>
<h4 id="&#x521B;&#x5EFA;&#x9759;&#x6001;&#x9875;&#x9762;&#x5B58;&#x653E;&#x76EE;&#x5F55;">&#x521B;&#x5EFA;&#x9759;&#x6001;&#x9875;&#x9762;&#x5B58;&#x653E;&#x76EE;&#x5F55;</h4>
<pre><code>mkdir /data2_4T/escheduler_front/escheduler/server
</code></pre><h4 id="&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5730;&#x5740;">&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5730;&#x5740;</h4>
<pre><code>/etc/nginx/conf.d/default.conf
</code></pre><h4 id="&#x914D;&#x7F6E;&#x4FE1;&#x606F;">&#x914D;&#x7F6E;&#x4FE1;&#x606F;</h4>
<pre><code>server {
listen 8888;# &#x8BBF;&#x95EE;&#x7AEF;&#x53E3;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /data2_4T/escheduler_front/escheduler/server; # &#x9759;&#x6001;&#x6587;&#x4EF6;&#x76EE;&#x5F55;
index index.html index.html;
}
location /escheduler {
proxy_pass http://192.168.220.181:12345; # &#x63A5;&#x53E3;&#x5730;&#x5740;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x_real_ipP $remote_addr;
proxy_set_header remote_addr $remote_addr;
proxy_set_header X-Forwarded-For $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 $http_upgrade;
proxy_set_header Connection &quot;upgrade&quot;;
}
#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;
}
}
</code></pre><h4 id="&#x91CD;&#x542F;nginx&#x670D;&#x52A1;">&#x91CD;&#x542F;Nginx&#x670D;&#x52A1;</h4>
<pre><code>systemctl restart nginx
</code></pre></blockquote>
<h2 id="&#x524D;&#x7AEF;&#x9879;&#x76EE;&#x53D1;&#x5E03;">&#x524D;&#x7AEF;&#x9879;&#x76EE;&#x53D1;&#x5E03;</h2>
<p>&#x524D;&#x7AEF;&#x5728;&#x5F00;&#x53D1;&#x73AF;&#x5883;&#xFF08;dev&#xFF09;&#x4E2D;&#x8FD0;&#x884C; <code>npm run build</code> &#x547D;&#x4EE4;&#xFF0C;&#x751F;&#x6210;&#x6253;&#x5305;&#x6587;&#x4EF6;&#xFF08;dist&#xFF09;&#x5305;</p>
<p>&#x518D;&#x62F7;&#x8D1D;&#x5230;&#x670D;&#x52A1;&#x5668; <code>/data2_4T/escheduler_front/escheduler/server</code>&#xFF08;&#x670D;&#x52A1;&#x5668;&#x9759;&#x6001;&#x9875;&#x9762;&#x5B58;&#x653E;&#x76EE;&#x5F55;&#xFF09;</p>
<p>&#x8BBF;&#x95EE;&#x5730;&#x5740; <code>http://localhost:8888/#/</code> </p>
<h2 id="&#x95EE;&#x9898;">&#x95EE;&#x9898;</h2>
<h4 id="1-&#x4E0A;&#x4F20;&#x6587;&#x4EF6;&#x5927;&#x5C0F;&#x9650;&#x5236;">1. &#x4E0A;&#x4F20;&#x6587;&#x4EF6;&#x5927;&#x5C0F;&#x9650;&#x5236;</h4>
<p>&#x7F16;&#x8F91;&#x914D;&#x7F6E;&#x6587;&#x4EF6; <code>vi /etc/nginx/nginx.conf</code></p>
<pre><code># &#x66F4;&#x6539;&#x4E0A;&#x4F20;&#x5927;&#x5C0F;
client_max_body_size 1024m
</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="deploy-foreground.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.3.1.1","depth":3,"anchor":"#前端项目环境构建及编译","path":"pages/deploy-foreground.md","ref":"pages/deploy-foreground.md#前端项目环境构建及编译","articles":[]},"previous":{"title":"项目部署文档","level":"1.3","depth":1,"ref":"","articles":[{"title":"前端部署","level":"1.3.1","depth":2,"path":"pages/deploy-foreground.md","ref":"pages/deploy-foreground.md","articles":[{"title":"前端项目环境构建及编译","level":"1.3.1.1","depth":3,"anchor":"#前端项目环境构建及编译","path":"pages/deploy-foreground.md","ref":"pages/deploy-foreground.md#前端项目环境构建及编译","articles":[]},{"title":"安装及配置","level":"1.3.1.2","depth":3,"anchor":"#安装及配置","path":"pages/deploy-foreground.md","ref":"pages/deploy-foreground.md#安装及配置","articles":[]},{"title":"项目生产环境Nginx配置","level":"1.3.1.3","depth":3,"anchor":"#项目生产环境配置","path":"pages/deploy-foreground.md","ref":"pages/deploy-foreground.md#项目生产环境配置","articles":[]},{"title":"前端项目发布","level":"1.3.1.4","depth":3,"anchor":"#前端项目发布","path":"pages/deploy-foreground.md","ref":"pages/deploy-foreground.md#前端项目发布","articles":[]},{"title":"问题","level":"1.3.1.5","depth":3,"anchor":"#问题","path":"pages/deploy-foreground.md","ref":"pages/deploy-foreground.md#问题","articles":[]}]},{"title":"后端部署","level":"1.3.2","depth":2,"path":"pages/deploy-background.md","ref":"pages/deploy-background.md","articles":[{"title":"基础软件安装","level":"1.3.2.1","depth":3,"anchor":"#基础软件安装","path":"pages/deploy-background.md","ref":"pages/deploy-background.md#基础软件安装","articles":[]},{"title":"项目编译","level":"1.3.2.2","depth":3,"anchor":"#项目编译","path":"pages/deploy-background.md","ref":"pages/deploy-background.md#项目编译","articles":[]},{"title":"数据库初始化","level":"1.3.2.3","depth":3,"anchor":"#数据库初始化","path":"pages/deploy-background.md","ref":"pages/deploy-background.md#数据库初始化","articles":[]},{"title":"创建部署用户","level":"1.3.2.4","depth":3,"anchor":"#创建部署用户","path":"pages/deploy-background.md","ref":"pages/deploy-background.md#创建部署用户","articles":[]},{"title":"配置文件","level":"1.3.2.5","depth":3,"anchor":"#配置文件","path":"pages/deploy-background.md","ref":"pages/deploy-background.md#配置文件","articles":[{"title":"escheduler-alert","level":"1.3.2.5.1","depth":4,"anchor":"#escheduler-alert","path":"pages/deploy-background.md","ref":"pages/deploy-background.md#escheduler-alert","articles":[]},{"title":"escheduler-common","level":"1.3.2.5.2","depth":4,"anchor":"#escheduler-common","path":"pages/deploy-background.md","ref":"pages/deploy-background.md#escheduler-common","articles":[]},{"title":"escheduler-dao","level":"1.3.2.5.3","depth":4,"anchor":"#escheduler-dao","path":"pages/deploy-background.md","ref":"pages/deploy-background.md#escheduler-dao","articles":[]},{"title":"escheduler-server","level":"1.3.2.5.4","depth":4,"anchor":"#escheduler-server","path":"pages/deploy-background.md","ref":"pages/deploy-background.md#escheduler-server","articles":[]},{"title":"escheduler-web","level":"1.3.2.5.5","depth":4,"anchor":"#escheduler-web","path":"pages/deploy-background.md","ref":"pages/deploy-background.md#escheduler-web","articles":[]}]},{"title":"启动停止命令","level":"1.3.2.6","depth":3,"anchor":"#启动停止命令","path":"pages/deploy-background.md","ref":"pages/deploy-background.md#启动停止命令","articles":[]},{"title":"一键启停脚本","level":"1.3.2.7","depth":3,"anchor":"#一键启停脚本","path":"pages/deploy-background.md","ref":"pages/deploy-background.md#一键启停脚本","articles":[]},{"title":"监控服务","level":"1.3.2.8","depth":3,"anchor":"#监控服务","path":"pages/deploy-background.md","ref":"pages/deploy-background
});
</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>