forked from linuxhui/DAWX_server
-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.html
522 lines (469 loc) · 15.9 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh_cn" xml:lang="zh_cn">
<head>
<!-- 2016-03-08 二 22:36 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title></title>
<meta name="generator" content="Org-mode" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
pre.src-sh:before { content: 'sh'; }
pre.src-bash:before { content: 'sh'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-R:before { content: 'R'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-java:before { content: 'Java'; }
pre.src-sql:before { content: 'SQL'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
/*]]>*/-->
</style>
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
</head>
<body>
<div id="content">
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgheadline1">1. 软件简介</a></li>
<li><a href="#orgheadline3">2. 系统需求:</a>
<ul>
<li><a href="#orgheadline2">2.1. wshflask需求环境</a></li>
</ul>
</li>
<li><a href="#orgheadline11">3. 命令介绍</a>
<ul>
<li><a href="#orgheadline6">3.1. CSserver/NDserver</a>
<ul>
<li><a href="#orgheadline4">3.1.1. 启动方式</a></li>
<li><a href="#orgheadline5">3.1.2. 效果展示</a></li>
</ul>
</li>
<li><a href="#orgheadline10">3.2. wshflask</a>
<ul>
<li><a href="#orgheadline7">3.2.1. 启动方式</a></li>
<li><a href="#orgheadline8">3.2.2. 效果展示</a></li>
<li><a href="#orgheadline9">3.2.3. web界面展示</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#orgheadline28">4. 架构说明</a>
<ul>
<li><a href="#orgheadline14">4.1. 整体架构</a>
<ul>
<li><a href="#orgheadline12">4.1.1. 说明:</a></li>
<li><a href="#orgheadline13">4.1.2. 框架</a></li>
</ul>
</li>
<li><a href="#orgheadline18">4.2. 服务架构</a>
<ul>
<li><a href="#orgheadline15">4.2.1. nodeserver</a></li>
<li><a href="#orgheadline16">4.2.2. CSserver</a></li>
<li><a href="#orgheadline17">4.2.3. wshflask</a></li>
</ul>
</li>
<li><a href="#orgheadline27">4.3. 日志系统</a>
<ul>
<li><a href="#orgheadline19">4.3.1. 日志系统的作用</a></li>
<li><a href="#orgheadline22">4.3.2. 技术实现</a></li>
<li><a href="#orgheadline23">4.3.3. 日志系统的框架设计</a></li>
<li><a href="#orgheadline26">4.3.4. 日志系统的效果展示</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#orgheadline29">5. api</a></li>
<li><a href="#orgheadline30">6. 关于我</a></li>
</ul>
</div>
</div>
<div id="outline-container-orgheadline1" class="outline-2">
<h2 id="orgheadline1"><span class="section-number-2">1</span> 软件简介</h2>
<div class="outline-text-2" id="text-1">
<p>
这是一个类似nagios的服务器架构,有多节点(nodeserver)和一个配置服务器(CSServer),以及一个用户UI(wshflask)组成。
</p>
</div>
</div>
<div id="outline-container-orgheadline3" class="outline-2">
<h2 id="orgheadline3"><span class="section-number-2">2</span> 系统需求:</h2>
<div class="outline-text-2" id="text-2">
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">组件</th>
<th scope="col" class="org-left">需求</th>
<th scope="col" class="org-left">简介</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">系统</td>
<td class="org-left">linux</td>
<td class="org-left"> </td>
</tr>
<tr>
<td class="org-left">python</td>
<td class="org-left">python2 且版本为python2.7</td>
<td class="org-left">目前能够保证在python2.6.6 和python2.7下正常运行</td>
</tr>
<tr>
<td class="org-left">expect</td>
<td class="org-left">linux系统软件</td>
<td class="org-left">可以通过 "yum install expect " 进行安装</td>
</tr>
</tbody>
</table>
</div>
<div id="outline-container-orgheadline2" class="outline-3">
<h3 id="orgheadline2"><span class="section-number-3">2.1</span> wshflask需求环境</h3>
<div class="outline-text-3" id="text-2-1">
<p>
依赖软件:
</p>
<pre class="example">
主要是flask软件,有点多,以后更新
</pre>
</div>
</div>
</div>
<div id="outline-container-orgheadline11" class="outline-2">
<h2 id="orgheadline11"><span class="section-number-2">3</span> 命令介绍</h2>
<div class="outline-text-2" id="text-3">
</div><div id="outline-container-orgheadline6" class="outline-3">
<h3 id="orgheadline6"><span class="section-number-3">3.1</span> CSserver/NDserver</h3>
<div class="outline-text-3" id="text-3-1">
</div><div id="outline-container-orgheadline4" class="outline-4">
<h4 id="orgheadline4"><span class="section-number-4">3.1.1</span> 启动方式</h4>
<div class="outline-text-4" id="text-3-1-1">
<pre class="example">
1. CSSSocketerver启动命令
python CSSocketServer.py debug/start/restart/stop
2. NDSocketServer启动命令
python NDSocketServer.py debug/start/restart/stop
</pre>
</div>
</div>
<div id="outline-container-orgheadline5" class="outline-4">
<h4 id="orgheadline5"><span class="section-number-4">3.1.2</span> 效果展示</h4>
<div class="outline-text-4" id="text-3-1-2">
<ol class="org-ol">
<li>start命令</li>
</ol>
<div class="figure">
<p><img src="doc/pic/csserver/CSserver_start.png" alt="CSserver_start.png" />
</p>
</div>
<ol class="org-ol">
<li>stop命令</li>
</ol>
<div class="figure">
<p><img src="doc/pic/csserver/CSserver_stop.png" alt="CSserver_stop.png" />
</p>
</div>
<ol class="org-ol">
<li>restart命令</li>
</ol>
<div class="figure">
<p><img src="doc/pic/csserver/CSserver_restart.png" alt="CSserver_restart.png" />
</p>
</div>
<ol class="org-ol">
<li>debug命令</li>
</ol>
<div class="figure">
<p><img src="doc/pic/csserver/CSserver_debug.png" alt="CSserver_debug.png" />
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-orgheadline10" class="outline-3">
<h3 id="orgheadline10"><span class="section-number-3">3.2</span> wshflask</h3>
<div class="outline-text-3" id="text-3-2">
</div><div id="outline-container-orgheadline7" class="outline-4">
<h4 id="orgheadline7"><span class="section-number-4">3.2.1</span> 启动方式</h4>
<div class="outline-text-4" id="text-3-2-1">
<pre class="example">
python manage.py runserver
</pre>
</div>
</div>
<div id="outline-container-orgheadline8" class="outline-4">
<h4 id="orgheadline8"><span class="section-number-4">3.2.2</span> 效果展示</h4>
<div class="outline-text-4" id="text-3-2-2">
<div class="figure">
<p><img src="doc/pic/flask/wshflask_start.png" alt="wshflask_start.png" />
</p>
</div>
</div>
</div>
<div id="outline-container-orgheadline9" class="outline-4">
<h4 id="orgheadline9"><span class="section-number-4">3.2.3</span> web界面展示</h4>
<div class="outline-text-4" id="text-3-2-3">
<div class="figure">
<p><img src="doc/pic/flask/web_main.png" alt="web_main.png" />
</p>
</div>
</div>
</div>
</div>
</div>
<div id="outline-container-orgheadline28" class="outline-2">
<h2 id="orgheadline28"><span class="section-number-2">4</span> 架构说明</h2>
<div class="outline-text-2" id="text-4">
</div><div id="outline-container-orgheadline14" class="outline-3">
<h3 id="orgheadline14"><span class="section-number-3">4.1</span> 整体架构</h3>
<div class="outline-text-3" id="text-4-1">
</div><div id="outline-container-orgheadline12" class="outline-4">
<h4 id="orgheadline12"><span class="section-number-4">4.1.1</span> 说明:</h4>
<div class="outline-text-4" id="text-4-1-1">
<ol class="org-ol">
<li>所有的查找都是基于 CSserver的</li>
<li>任何的两台服务器之间都是可以通信的</li>
</ol>
</div>
</div>
<div id="outline-container-orgheadline13" class="outline-4">
<h4 id="orgheadline13"><span class="section-number-4">4.1.2</span> 框架</h4>
<div class="outline-text-4" id="text-4-1-2">
<div class="figure">
<p><img src="doc/dia/zengti.jpeg" alt="zengti.jpeg" />
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-orgheadline18" class="outline-3">
<h3 id="orgheadline18"><span class="section-number-3">4.2</span> 服务架构</h3>
<div class="outline-text-3" id="text-4-2">
</div><div id="outline-container-orgheadline15" class="outline-4">
<h4 id="orgheadline15"><span class="section-number-4">4.2.1</span> nodeserver</h4>
<div class="outline-text-4" id="text-4-2-1">
<div class="figure">
<p><img src="./doc/dia/nodeserver.jpeg" alt="nodeserver.jpeg" />
</p>
</div>
</div>
</div>
<div id="outline-container-orgheadline16" class="outline-4">
<h4 id="orgheadline16"><span class="section-number-4">4.2.2</span> CSserver</h4>
<div class="outline-text-4" id="text-4-2-2">
<div class="figure">
<p><img src="./doc/dia/CSserver.jpeg" alt="CSserver.jpeg" />
</p>
</div>
</div>
</div>
<div id="outline-container-orgheadline17" class="outline-4">
<h4 id="orgheadline17"><span class="section-number-4">4.2.3</span> wshflask</h4>
<div class="outline-text-4" id="text-4-2-3">
<div class="figure">
<p><img src="doc/dia/wshflask.png" alt="wshflask.png" />
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-orgheadline27" class="outline-3">
<h3 id="orgheadline27"><span class="section-number-3">4.3</span> 日志系统</h3>
<div class="outline-text-3" id="text-4-3">
</div><div id="outline-container-orgheadline19" class="outline-4">
<h4 id="orgheadline19"><span class="section-number-4">4.3.1</span> 日志系统的作用</h4>
<div class="outline-text-4" id="text-4-3-1">
<p>
日志可以分为三个部分:
</p>
<ol class="org-ol">
<li>输出到屏幕上,用来作为debug</li>
<li>输出到日志中,作为历史记录</li>
<li>输出到远端,作为远端服务区的实时显示。</li>
</ol>
<p>
<b>NOTE:</b> 目前1 和2 放到了一起。
</p>
</div>
</div>
<div id="outline-container-orgheadline22" class="outline-4">
<h4 id="orgheadline22"><span class="section-number-4">4.3.2</span> 技术实现</h4>
<div class="outline-text-4" id="text-4-3-2">
</div><ol class="org-ol"><li><a id="orgheadline20"></a>CSserver/NDserver<br /><div class="outline-text-5" id="text-4-3-2-1">
<ol class="org-ol">
<li>python的 logging实现 本地的屏幕和日志输出</li>
<li>利用multiprocessing 的Pipe实现日志的远端发送</li>
</ol>
</div></li>
<li><a id="orgheadline21"></a>wshflask消息接受机制<br /><div class="outline-text-5" id="text-4-3-2-2">
<p>
采用 js的 socket io 实现
</p>
</div></li></ol>
</div>
<div id="outline-container-orgheadline23" class="outline-4">
<h4 id="orgheadline23"><span class="section-number-4">4.3.3</span> 日志系统的框架设计</h4>
<div class="outline-text-4" id="text-4-3-3">
<div class="figure">
<p><img src="doc/dia/logkuangjia.png" alt="logkuangjia.png" />
</p>
</div>
</div>
</div>
<div id="outline-container-orgheadline26" class="outline-4">
<h4 id="orgheadline26"><span class="section-number-4">4.3.4</span> 日志系统的效果展示</h4>
<div class="outline-text-4" id="text-4-3-4">
</div><ol class="org-ol"><li><a id="orgheadline24"></a>CSServer/NDserver端<br /></li>
<li><a id="orgheadline25"></a>wshflask的实时显示<br /></li></ol>
</div>
</div>
</div>
<div id="outline-container-orgheadline29" class="outline-2">
<h2 id="orgheadline29"><span class="section-number-2">5</span> api</h2>
<div class="outline-text-2" id="text-5">
<p>
CSsocketServer请参考:<a href="doc/configserverdoc/_build/html/index.html">doc/configserverdoc/_build/html/index.html</a>
NDSocketServer请参考:<a href="doc/nodeserverdoc/_build/html/index.html">doc/nodeserverdoc/_build/html/index.html</a>
</p>
</div>
</div>
<div id="outline-container-orgheadline30" class="outline-2">
<h2 id="orgheadline30"><span class="section-number-2">6</span> 关于我</h2>
<div class="outline-text-2" id="text-6">
<p>
linux运维开发
</p>
<p>
archlinux重度使用者
</p>
<p>
<a href="mailto:872807604@qq.com">mailto:872807604@qq.com</a>
</p>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="date">Created: 2016-03-08 二 22:36</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>
</html>