1.2.HowToInstallKsbToolBox-nvidia-1903.html 56.3 KB
Newer Older
HooYoungAhn's avatar
HooYoungAhn committed
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 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643
<!DOCTYPE html>
  <html>
    <head>
      <title>1.2.HowToInstallKsbToolBox-nvidia-1903</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      
      <link rel="stylesheet" href="file:////home/csle/.atom/packages/markdown-preview-enhanced/node_modules/@shd101wyy/mume/dependencies/katex/katex.min.css">
      
      
      
      
      
      
      
      
      
      

      <style> 
      /**
 * prism.js Github theme based on GitHub's theme.
 * @author Sam Clarke
 */
code[class*="language-"],
pre[class*="language-"] {
  color: #333;
  background: none;
  font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.4;

  -moz-tab-size: 8;
  -o-tab-size: 8;
  tab-size: 8;

  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

/* Code blocks */
pre[class*="language-"] {
  padding: .8em;
  overflow: auto;
  /* border: 1px solid #ddd; */
  border-radius: 3px;
  /* background: #fff; */
  background: #f5f5f5;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
  padding: .1em;
  border-radius: .3em;
  white-space: normal;
  background: #f5f5f5;
}

.token.comment,
.token.blockquote {
  color: #969896;
}

.token.cdata {
  color: #183691;
}

.token.doctype,
.token.punctuation,
.token.variable,
.token.macro.property {
  color: #333;
}

.token.operator,
.token.important,
.token.keyword,
.token.rule,
.token.builtin {
  color: #a71d5d;
}

.token.string,
.token.url,
.token.regex,
.token.attr-value {
  color: #183691;
}

.token.property,
.token.number,
.token.boolean,
.token.entity,
.token.atrule,
.token.constant,
.token.symbol,
.token.command,
.token.code {
  color: #0086b3;
}

.token.tag,
.token.selector,
.token.prolog {
  color: #63a35c;
}

.token.function,
.token.namespace,
.token.pseudo-element,
.token.class,
.token.class-name,
.token.pseudo-class,
.token.id,
.token.url-reference .token.variable,
.token.attr-name {
  color: #795da3;
}

.token.entity {
  cursor: help;
}

.token.title,
.token.title .token.punctuation {
  font-weight: bold;
  color: #1d3e81;
}

.token.list {
  color: #ed6a43;
}

.token.inserted {
  background-color: #eaffea;
  color: #55a532;
}

.token.deleted {
  background-color: #ffecec;
  color: #bd2c00;
}

.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}


/* JSON */
.language-json .token.property {
  color: #183691;
}

.language-markup .token.tag .token.punctuation {
  color: #333;
}

/* CSS */
code.language-css,
.language-css .token.function {
  color: #0086b3;
}

/* YAML */
.language-yaml .token.atrule {
  color: #63a35c;
}

code.language-yaml {
  color: #183691;
}

/* Ruby */
.language-ruby .token.function {
  color: #333;
}

/* Markdown */
.language-markdown .token.url {
  color: #795da3;
}

/* Makefile */
.language-makefile .token.symbol {
  color: #795da3;
}

.language-makefile .token.variable {
  color: #183691;
}

.language-makefile .token.builtin {
  color: #0086b3;
}

/* Bash */
.language-bash .token.keyword {
  color: #0086b3;
}html body{font-family:"Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff;overflow:initial;box-sizing:border-box;word-wrap:break-word}html body>:first-child{margin-top:0}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{line-height:1.2;margin-top:1em;margin-bottom:16px;color:#000}html body h1{font-size:2.25em;font-weight:300;padding-bottom:.3em}html body h2{font-size:1.75em;font-weight:400;padding-bottom:.3em}html body h3{font-size:1.5em;font-weight:500}html body h4{font-size:1.25em;font-weight:600}html body h5{font-size:1.1em;font-weight:600}html body h6{font-size:1em;font-weight:600}html body h1,html body h2,html body h3,html body h4,html body h5{font-weight:600}html body h5{font-size:1em}html body h6{color:#5c5c5c}html body strong{color:#000}html body del{color:#5c5c5c}html body a:not([href]){color:inherit;text-decoration:none}html body a{color:#08c;text-decoration:none}html body a:hover{color:#00a3f5;text-decoration:none}html body img{max-width:100%}html body>p{margin-top:0;margin-bottom:16px;word-wrap:break-word}html body>ul,html body>ol{margin-bottom:16px}html body ul,html body ol{padding-left:2em}html body ul.no-list,html body ol.no-list{padding:0;list-style-type:none}html body ul ul,html body ul ol,html body ol ol,html body ol ul{margin-top:0;margin-bottom:0}html body li{margin-bottom:0}html body li.task-list-item{list-style:none}html body li>p{margin-top:0;margin-bottom:0}html body .task-list-item-checkbox{margin:0 .2em .25em -1.8em;vertical-align:middle}html body .task-list-item-checkbox:hover{cursor:pointer}html body blockquote{margin:16px 0;font-size:inherit;padding:0 15px;color:#5c5c5c;border-left:4px solid #d6d6d6}html body blockquote>:first-child{margin-top:0}html body blockquote>:last-child{margin-bottom:0}html body hr{height:4px;margin:32px 0;background-color:#d6d6d6;border:0 none}html body table{margin:10px 0 15px 0;border-collapse:collapse;border-spacing:0;display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}html body table th{font-weight:bold;color:#000}html body table td,html body table th{border:1px solid #d6d6d6;padding:6px 13px}html body dl{padding:0}html body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:bold}html body dl dd{padding:0 16px;margin-bottom:16px}html body code{font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:.85em !important;color:#000;background-color:#f0f0f0;border-radius:3px;padding:.2em 0}html body code::before,html body code::after{letter-spacing:-0.2em;content:"\00a0"}html body pre>code{padding:0;margin:0;font-size:.85em !important;word-break:normal;white-space:pre;background:transparent;border:0}html body .highlight{margin-bottom:16px}html body .highlight pre,html body pre{padding:1em;overflow:auto;font-size:.85em !important;line-height:1.45;border:#d6d6d6;border-radius:3px}html body .highlight pre{margin-bottom:0;word-break:normal}html body pre code,html body pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}html body pre code:before,html body pre tt:before,html body pre code:after,html body pre tt:after{content:normal}html body p,html body blockquote,html body ul,html body ol,html body dl,html body pre{margin-top:0;margin-bottom:16px}html body kbd{color:#000;border:1px solid #d6d6d6;border-bottom:2px solid #c7c7c7;padding:2px 4px;background-color:#f0f0f0;border-radius:3px}@media print{html body{background-color:#fff}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{color:#000;page-break-after:avoid}html body blockquote{color:#5c5c5c}html body pre{page-break-inside:avoid}html body table{display:table}html body img{display:block;max-width:100%;max-height:100%}html body pre,html body code{word-wrap:break-word;white-space:pre}}.markdown-preview{width:100%;height:100%;box-sizing:border-box}.markdown-preview .pagebreak,.markdown-preview .newpage{page-break-before:always}.markdown-preview pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}.markdown-preview pre.line-numbers>code{position:relative}.markdown-preview pre.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:1em;font-size:100%;left:0;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown-preview pre.line-numbers .line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.markdown-preview pre.line-numbers .line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}.markdown-preview .mathjax-exps .MathJax_Display{text-align:center !important}.markdown-preview:not([for="preview"]) .code-chunk .btn-group{display:none}.markdown-preview:not([for="preview"]) .code-chunk .status{display:none}.markdown-preview:not([for="preview"]) .code-chunk .output-div{margin-bottom:16px}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba(150,150,150,0.66);background-clip:content-box}html body[for="html-export"]:not([data-presentation-mode]){position:relative;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:auto}html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{position:relative;top:0}@media screen and (min-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em calc(50% - 457px)}}@media screen and (max-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{font-size:14px !important;padding:1em}}@media print{html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{display:none}}html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{position:fixed;bottom:8px;left:8px;font-size:28px;cursor:pointer;color:inherit;z-index:99;width:32px;text-align:center;opacity:.4}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] #sidebar-toc-btn{opacity:1}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc{position:fixed;top:0;left:0;width:300px;height:100%;padding:32px 0 48px 0;font-size:14px;box-shadow:0 0 4px rgba(150,150,150,0.33);box-sizing:border-box;overflow:auto;background-color:inherit}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar{width:8px}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba(150,150,150,0.66);background-clip:content-box}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc a{text-decoration:none}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul{padding:0 1.6em;margin-top:.8em}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc li{margin-bottom:.8em}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul{list-style-type:none}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{left:300px;width:calc(100% -  300px);padding:2em calc(50% - 457px -  150px);margin:0;box-sizing:border-box}@media screen and (max-width:1274px){html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{width:100%}}html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .markdown-preview{left:50%;transform:translateX(-50%)}html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .md-sidebar-toc{display:none}
/* Please visit the URL below for more information: */
/*   https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */
 
      </style>
    </head>
    <body for="html-export">
      <div class="mume markdown-preview   ">
      <h1 class="mume-header" id="ksb-%ED%88%B4%EB%B0%95%EC%8A%A4-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0nvidia-docker%EB%B2%84%EC%A0%84">KSB 툴박스 설치하기(nvidia-docker버전)</h1>

<hr>
<p>KSB 프레임워크를 쉽게 사용하기 위한 KSB 툴박스 v19.03 nvidia-docker 버전 설치 방법을 설명합니다.</p>
<h2 class="mume-header" id="%EC%84%A4%EC%B9%98-%EC%9A%94%EA%B5%AC%EC%82%AC%ED%95%AD">설치 요구사항</h2>

<ul>
<li>Ubuntu 16.04가 설치된 메모리 16GB 이상 데스트탑이나 노트북이 요구됩니다.</li>
<li>KSB 툴박스는 Hadoop, hbase, kafka, zookeeper, spark 등 빅데이터 처리 프레임워크과 연동합니다. 따라서 다양한 워크플로우 예제를 실행하기 위해서는 16GB 이상의 메모리와 cpu 코어 8개이상의 PC 사양이 요구됩니다.<br>
(메모리 8GB 및 cpu 코어 4개 사양 PC에서는 제한적으로 워크플로우 예제 실행이 가능합니다.)</li>
</ul>
<h2 class="mume-header" id="%EC%82%AC%EC%9A%A9%EC%8B%9C-%EC%9C%A0%EC%9D%98%EC%82%AC%ED%95%AD">사용시 유의사항</h2>

<ul>
<li>제한된 GPU 카드에 대해서만 테스트 되어 있습니다.(Titanx, 1080Ti). 따라서 저사양 GPU 카드나 최신 GPU 카드를 사용하는 경우 동작하지 않을 수 있습니다.</li>
<li>현재 KSB 툴박스 nvidia-docker 버전은 CUDA 9.0, CUDNN 7.3.1 이 포함되어 있습니다.<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">cat</span> /usr/local/cuda/version.txt
CUDA Version 9.0.176
<span class="token function">cat</span> /usr/include/cudnn.h <span class="token operator">|</span> <span class="token function">grep</span> CUDNN_MAJOR -A 2
<span class="token comment">#define CUDNN_MAJOR 7</span>
<span class="token comment">#define CUDNN_MINOR 3</span>
<span class="token comment">#define CUDNN_PATCHLEVEL 1</span>
</pre></li>
</ul>
<h2 class="mume-header" id="%EC%84%A4%EC%B9%98-%EC%88%9C%EC%84%9C">설치 순서</h2>

<p>Host PC에 KSB 툴박스를 설치하기 위해서 아래와 같은 절차로 설치합니다.</p>
<ul>
<li>[Host PC] csle 사용자 계정(권한: administrator) 생성하기</li>
<li>[Host PC] hostname을 csle1으로 변경하기</li>
<li>[Host PC] NVIDIA 그래픽카드 드라이버 설치하기</li>
<li>[Host PC] openjdk-8 설치하기</li>
<li>[Host PC] KSB 툴박스 관련 프로그램 설치하기</li>
<li>[Host PC] SSH port 변경 및 root 로그인 가능하도록 SSHD config 수정하기</li>
<li>[Host PC] SSH config 수정하기</li>
<li>[Host PC] Docker 설치하기</li>
<li>[Host PC] nvidia-docker 2.0 설치하기</li>
<li>[Host PC] /etc/hosts 수정하기</li>
<li>[Host PC] bashrc 설정 추가하기</li>
<li>[Host PC] 크롬 설치하기</li>
<li>[Host PC] KSB 툴박스 설치 및 docker image 다운받기</li>
<li>[Host PC] KSB 툴박스 docker 이미지내 SSH 키를 host pc에 복사하기</li>
<li>[Host PC] SSH 재시작하기</li>
<li>[Host PC] ksb-csle 폴더 권한 변경하기</li>
<li>[Host PC] <a href="http://startDockerCsle.sh">startDockerCsle.sh</a>, <a href="http://stopDockerCsle.sh">stopDockerCsle.sh</a> 추가하기</li>
</ul>
<h2 class="mume-header" id="host-pc-csle-%EC%82%AC%EC%9A%A9%EC%9E%90-%EA%B3%84%EC%A0%95%EA%B6%8C%ED%95%9C-administrator-%EC%83%9D%EC%84%B1%ED%95%98%EA%B8%B0">[Host PC] csle 사용자 계정(권한 : administrator) 생성하기</h2>

<p>Host PC에 기존 Ubuntu 사용자와 설치환경을 분리하기 위해 아래의 명령으로 csle 계정을 추가 생성합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">sudo</span> adduser csle
    Adding user <span class="token string">'csle'</span> <span class="token punctuation">..</span>.
    Adding new group <span class="token string">'csle'</span> <span class="token punctuation">(</span>1001<span class="token punctuation">)</span> <span class="token punctuation">..</span>.
    Adding new user <span class="token string">'csle'</span> <span class="token punctuation">(</span>1001<span class="token punctuation">)</span> with group <span class="token string">'csle'</span> <span class="token punctuation">..</span>.
    Creating home directory <span class="token string">'/home/csle'</span> <span class="token punctuation">..</span>.
    Copying files from <span class="token string">'/etc/skel'</span> <span class="token punctuation">..</span>.
    새 UNIX 암호 입력:
    새 UNIX 암호 재입력:
    passwd: password updated successfully
    Changing the user information <span class="token keyword">for</span> csle
    Enter the new value, or press ENTER <span class="token keyword">for</span> the default
    Full Name <span class="token punctuation">[</span><span class="token punctuation">]</span>:
    Room Number <span class="token punctuation">[</span><span class="token punctuation">]</span>:
    Work Phone <span class="token punctuation">[</span><span class="token punctuation">]</span>:
    Home Phone <span class="token punctuation">[</span><span class="token punctuation">]</span>:
    Other <span class="token punctuation">[</span><span class="token punctuation">]</span>:
    Is the information correct? <span class="token punctuation">[</span>Y/n<span class="token punctuation">]</span> Y
</pre><p>/etc/sudoers를 열어 csle 계정에 administrator 권한을 추가합니다.<br>
&quot;경고: 읽기 전용 파일을 고치고 있습니다&quot; 경고는 무시하고 저장하고 나옵니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">sudo</span> <span class="token function">vi</span> /etc/sudoers
    <span class="token comment"># User privilege specification</span>
    root    ALL<span class="token operator">=</span><span class="token punctuation">(</span>ALL:ALL<span class="token punctuation">)</span> ALL
    <span class="token comment"># 맨 아래줄에 내용을 추가합니다.</span>
    <span class="token comment">#includedir /etc/sudoers.d</span>
    csle    ALL<span class="token operator">=</span><span class="token punctuation">(</span>ALL<span class="token punctuation">)</span> NOPASSWD: ALL
</pre><h2 class="mume-header" id="host-pc-hostname%EC%9D%84-csle1%EC%9C%BC%EB%A1%9C-%EB%B3%80%EA%B2%BD%ED%95%98%EA%B8%B0">[Host PC] hostname을 csle1으로 변경하기</h2>

<p>docker 컨테이너가 호스트 pc의 네트워크를 동일하게 사용하는 host 모드로 동작하기 위해 docker 컨테이너와 호스트 pc의 호스트네임을 동일하게 합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">sudo</span> <span class="token function">vi</span> /etc/hostname
csle1
</pre><p>PC를 재부팅하여 csle 계정으로 로그인합니다.</p>
<h2 class="mume-header" id="host-pc-nvidia-%EA%B7%B8%EB%9E%98%ED%94%BD%EC%B9%B4%EB%93%9C-%EB%93%9C%EB%9D%BC%EC%9D%B4%EB%B2%84-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] NVIDIA 그래픽카드 드라이버 설치하기</h2>

<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">sudo</span> add-apt-repository ppa:graphics-drivers
<span class="token function">sudo</span> <span class="token function">apt-get</span> update

왼쪽 우분투 <span class="token string">"시스템설정"</span> 아이콘 클릭 --<span class="token operator">></span> <span class="token string">"자세히 보기"</span> 아이콘 클릭 --<span class="token operator">></span>
하단의 <span class="token string">"업데이트 설치"</span> 버튼 클릭

왼쪽 우분투 <span class="token string">"시스템설정"</span> 아이콘 클릭 --<span class="token operator">></span> <span class="token string">"소프트웨어&amp;업데이터"</span> 아이콘 클릭 --<span class="token operator">></span>
상단 메뉴에서 <span class="token string">"추가 드라이버"</span> 메뉴 선택 --<span class="token operator">></span>
NVIDIA 드라이버 사용 선택<span class="token punctuation">(</span>예:NVIDIA binary driver-version 396.54<span class="token punctuation">(</span>독점,확인함<span class="token punctuation">))</span> --<span class="token operator">></span>
<span class="token string">"바뀐 내용 적용"</span> 후 컴퓨터 재부팅
</pre><pre data-role="codeBlock" data-info="sh" class="language-bash">csle@csle1:~$ nvidia-smi
Sat Oct 24 13:17:41 2018
+----------------------------------------------------------------------------+
<span class="token operator">|</span> NVIDIA-SMI 396.54                Driver Version: 396.54                    <span class="token operator">|</span>
<span class="token operator">|</span>------------------------------+----------------------+----------------------+
<span class="token operator">|</span> GPU  Name       Persistence-M<span class="token operator">|</span> Bus-Id        Disp.A <span class="token operator">|</span> Volatile Uncorr. ECC <span class="token operator">|</span>
<span class="token operator">|</span> Fan  Temp  Perf Pwr:Usage/Cap<span class="token operator">|</span>         Memory-Usage <span class="token operator">|</span> GPU-Util  Compute M. <span class="token operator">|</span>
<span class="token operator">|</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span>+<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span>+<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">|</span>
<span class="token operator">|</span>   0  TITAN X <span class="token punctuation">(</span>Pascal<span class="token punctuation">)</span>   Off  <span class="token operator">|</span> 00000000:01:00.0  On <span class="token operator">|</span>                  N/A <span class="token operator">|</span>
<span class="token operator">|</span> 25%   40C    P8   17W / 250W <span class="token operator">|</span>   1186MiB / 12190MiB <span class="token operator">|</span>      0%      Default <span class="token operator">|</span>
+------------------------------+----------------------+----------------------+

+----------------------------------------------------------------------------+
<span class="token operator">|</span> Processes:                                                      GPU Memory <span class="token operator">|</span>
<span class="token operator">|</span>  GPU      PID   Type   Process name                             Usage      <span class="token operator">|</span>
<span class="token operator">|</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">|</span>
<span class="token operator">|</span>    0     1021      G   /usr/lib/jvm/java-8-oracle/bin/java          632MiB <span class="token operator">|</span>
+----------------------------------------------------------------------------+
</pre><p>PC를 재부팅합니다.</p>
<h2 class="mume-header" id="host-pc-openjdk-8-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] openjdk-8 설치하기</h2>

<p>Host PC에 Ubuntu 16.04를 처음 설치한 경우 java openjdk 8을 설치합니다. 아래의 내용을 터미널에 복사하여 설정 가능합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">sudo</span> <span class="token function">apt-get</span> update <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> <span class="token function">apt-get</span> -y <span class="token function">install</span> openjdk-8-jre <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> <span class="token function">apt-get</span> -y <span class="token function">install</span> openjdk-8-jdk
</pre><p>터미널을 다시 시작한 후, 아래의 명령으로 java 설치 여부를 확인합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash">csle@csle1:~$ java -version
java version <span class="token string">"1.8.0_212"</span>
Java<span class="token punctuation">(</span>TM<span class="token punctuation">)</span> SE Runtime Environment <span class="token punctuation">(</span>build 1.8.0_212-b13<span class="token punctuation">)</span>
Java HotSpot<span class="token punctuation">(</span>TM<span class="token punctuation">)</span> 64-Bit Server VM <span class="token punctuation">(</span>build 25.181-b13, mixed mode<span class="token punctuation">)</span>
</pre><h2 class="mume-header" id="host-pc-ksb-%ED%88%B4%EB%B0%95%EC%8A%A4-%EA%B4%80%EB%A0%A8-%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%A8-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] KSB 툴박스 관련 프로그램 설치하기</h2>

<p>Host PC에 아래의 명령으로 KSB 툴박스 관련 프로그램을 설치합니다. 아래의 내용을 터미널에 복사하여 설정가능합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">sudo</span> <span class="token function">apt-get</span> update <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> <span class="token function">apt-get</span> <span class="token function">install</span> -y --no-install-recommends apt-utils <span class="token function">curl</span> <span class="token function">bc</span> jq <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> <span class="token function">apt-get</span> <span class="token function">install</span> -y <span class="token function">ssh</span> locales <span class="token function">wget</span> <span class="token function">git</span> vim <span class="token function">rsync</span> locales \
filezilla python3-pip <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> <span class="token function">apt-get</span> <span class="token function">install</span> -y net-tools <span class="token operator">&amp;&amp;</span> \
pip3 <span class="token function">install</span> kafka-python
</pre><h2 class="mume-header" id="host-pc-ssh-port-%EB%B3%80%EA%B2%BD-%EB%B0%8F-root-%EB%A1%9C%EA%B7%B8%EC%9D%B8-%EA%B0%80%EB%8A%A5%ED%95%98%EB%8F%84%EB%A1%9D-sshd-config-%EC%88%98%EC%A0%95%ED%95%98%EA%B8%B0">[Host PC] SSH port 변경 및 root 로그인 가능하도록 SSHD config 수정하기</h2>

<p>아래의 명령을 수행하여 포트 정보를 2243로 수정하고, root 로그인을 허용합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">sudo</span> <span class="token function">sed</span> -ri <span class="token string">'s/^Port 22/Port 2243/g'</span> /etc/ssh/sshd_config
<span class="token function">sudo</span> <span class="token function">sed</span> -ri \
<span class="token string">'s/^PermitRootLogin prohibit-password/PermitRootLogin yes/g'</span> \
/etc/ssh/sshd_config
</pre><h2 class="mume-header" id="host-pc-ssh-config-%EC%88%98%EC%A0%95%ED%95%98%EA%B8%B0-known_hosts%EC%97%90-%ED%98%B8%EC%8A%A4%ED%8A%B8-%EC%A0%80%EC%9E%A5-%EC%A7%88%EB%AC%B8%EC%9D%84-%ED%95%98%EC%A7%80-%EC%95%8A%EB%8F%84%EB%A1%9D-%EC%84%A4%EC%A0%95">[Host PC] SSH config 수정하기 (known_hosts에 호스트 저장 질문을 하지 않도록 설정)</h2>

<p>아래의 명령을 수행하여 ssh_config의 기존 내용을 모두 삭제하고 설정을 추가합니다. 아래의 내용을 터미널에 복사하여 설정가능합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">sudo</span> truncate -s0 /etc/ssh/ssh_config
<span class="token keyword">echo</span> <span class="token string">"Host localhost"</span> \
<span class="token operator">|</span> <span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/ssh/ssh_config <span class="token operator">></span>/dev/null
<span class="token keyword">echo</span> <span class="token string">"StrictHostKeyChecking no"</span> \
<span class="token operator">|</span> <span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/ssh/ssh_config <span class="token operator">></span>/dev/null
<span class="token keyword">echo</span> <span class="token string">"Host 0.0.0.0"</span> \
<span class="token operator">|</span> <span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/ssh/ssh_config <span class="token operator">></span>/dev/null
<span class="token keyword">echo</span> <span class="token string">"StrictHostKeyChecking no"</span> \
<span class="token operator">|</span> <span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/ssh/ssh_config <span class="token operator">></span>/dev/null
<span class="token keyword">echo</span> <span class="token string">"Host 127.0.0.1"</span> \
<span class="token operator">|</span> <span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/ssh/ssh_config <span class="token operator">></span>/dev/null
<span class="token keyword">echo</span> <span class="token string">"StrictHostKeyChecking no"</span> \
<span class="token operator">|</span> <span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/ssh/ssh_config <span class="token operator">></span>/dev/null
<span class="token keyword">echo</span> <span class="token string">"Host csle*"</span> \
<span class="token operator">|</span> <span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/ssh/ssh_config <span class="token operator">></span>/dev/null
<span class="token keyword">echo</span> <span class="token string">"StrictHostKeyChecking no"</span> \
<span class="token operator">|</span> <span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/ssh/ssh_config <span class="token operator">></span>/dev/null
<span class="token keyword">echo</span> <span class="token string">"UserKnownHostsFile=/dev/null"</span> \
<span class="token operator">|</span> <span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/ssh/ssh_config <span class="token operator">></span>/dev/null
<span class="token keyword">echo</span> <span class="token string">"Host master"</span> \
<span class="token operator">|</span> <span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/ssh/ssh_config <span class="token operator">></span>/dev/null
<span class="token keyword">echo</span> <span class="token string">"StrictHostKeyChecking no"</span> \
<span class="token operator">|</span> <span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/ssh/ssh_config <span class="token operator">></span>/dev/null
<span class="token keyword">echo</span> <span class="token string">"UserKnownHostsFile=/dev/null"</span> \
<span class="token operator">|</span> <span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/ssh/ssh_config <span class="token operator">></span>/dev/null
<span class="token function">sudo</span> <span class="token function">service</span> <span class="token function">ssh</span> restart  
</pre><h2 class="mume-header" id="host-pc-docker-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] Docker 설치하기</h2>

<p>Host PC에 docker-ce 프로그램을 설치하기 위해 아래 명령어를 순차적으로 입력합니다. 아래의 내용을 터미널에 복사하여 설정가능합니다.<br>
현재 2018년 10월 최신 버전은 18.06.1~ce~3-0~ubuntu 입니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">curl</span> -fsSL https://download.docker.com/linux/ubuntu/gpg <span class="token operator">|</span> \
<span class="token function">sudo</span> apt-key add - <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> add-apt-repository \
<span class="token string">"deb [arch=amd64]
https://download.docker.com/linux/ubuntu <span class="token variable"><span class="token variable">$(</span>lsb_release -cs<span class="token variable">)</span></span> stable"</span> <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> <span class="token function">apt-get</span> update <span class="token operator">&amp;&amp;</span> \
apt-cache policy docker-ce <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> <span class="token function">apt-get</span> <span class="token function">install</span> -y docker-ce<span class="token operator">=</span>18.06.1~ce~3-0~ubuntu <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> systemctl status docker
</pre><h4 class="mume-header" id="%EC%B0%B8%EA%B3%A0%EC%82%AC%ED%95%AD-%EA%B8%B0%EC%A1%B4-docker-engine-%EC%82%AD%EC%A0%9C-%EB%B0%A9%EB%B2%95">[참고사항] 기존 docker-engine 삭제 방법</h4>

<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">sudo</span> <span class="token function">apt-get</span> purge -y docker docker-engine docker.io
</pre><p>Docker 명령시 root 권한이 필요합니다. root가 아닌 사용자가 sudo 없이 사용하려면 해당 사용자를 docker 그룹에 추가합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">sudo</span> <span class="token function">usermod</span> -aG docker csle
<span class="token comment"># 사용자가 로그인 중이라면 다시 로그인 후 권한이 적용됩니다.</span>
<span class="token comment"># 단, 현재 터미널에서만 적용됩니다.</span>
<span class="token function">sudo</span> <span class="token function">su</span> csle
PC 재부팅
</pre><p>PC 재부팅을 통해서 sudo 명령없이 docker 명령을 사용할 수 있습니다.</p>
<h2 class="mume-header" id="host-pc-nvidia-docker-20-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] nvidia-docker 2.0 설치하기</h2>

<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">curl</span> -s -L https://nvidia.github.io/nvidia-docker/gpgkey <span class="token operator">|</span> \
<span class="token function">sudo</span> apt-key add - <span class="token operator">&amp;&amp;</span> \
<span class="token function">curl</span> -s -L \
https://nvidia.github.io/nvidia-docker/\
ubuntu16.04/amd64/nvidia-docker.list <span class="token operator">|</span> \
<span class="token function">sudo</span> <span class="token function">tee</span> /etc/apt/sources.list.d/nvidia-docker.list <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> <span class="token function">apt-get</span> update <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> <span class="token function">apt-get</span> <span class="token function">install</span> -y nvidia-docker2 <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> <span class="token function">pkill</span> -SIGHUP dockerd
</pre><p>아래의 질의에 대해서 Y를 누르면 설치가 완료됩니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash">Configuration <span class="token function">file</span> <span class="token string">'/etc/docker/daemon.json'</span>
 <span class="token operator">==</span><span class="token operator">></span> File on system created by you or by a script.
 <span class="token operator">==</span><span class="token operator">></span> File also <span class="token keyword">in</span> package provided by package maintainer.
   어떻게 하시겠습니까? 다음 중에 하나를 선택할 수 있습니다:
    Y 또는 I <span class="token keyword">:</span> 패키지 관리자의 버전을 설치합니다
    N 또는 O <span class="token keyword">:</span> 현재 설치된 버전을 유지합니다
       D     <span class="token keyword">:</span> 버전 간의 차이점을 표시합니다
       Z     <span class="token keyword">:</span> 프로세스를 백그라운드로 하고 상황을 알아봅니다
기본값으로 현재 버전을 그대로 유지합니다.
*** daemon.json <span class="token punctuation">(</span>Y/I/N/O/D/Z<span class="token punctuation">)</span> <span class="token punctuation">[</span>기본값<span class="token operator">=</span>N<span class="token punctuation">]</span> ? Y
</pre><pre data-role="codeBlock" data-info="sh" class="language-bash">csle@csle1:~$ nvidia-docker version
NVIDIA Docker: 2.0.3
Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:24:56 2018
 OS/Arch:           linux/amd64
 Experimental:      <span class="token boolean">false</span>
</pre><pre data-role="codeBlock" data-info="sh" class="language-bash">Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 <span class="token punctuation">(</span>minimum version 1.12<span class="token punctuation">)</span>
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:23:21 2018
  OS/Arch:          linux/amd64
  Experimental:     <span class="token boolean">false</span>

</pre><h3 class="mume-header" id="%EC%B0%B8%EA%B3%A0%EC%82%AC%ED%95%AD-%EA%B8%B0%EC%A1%B4-nvidia-docker-10-%EB%B2%84%EC%A0%84%EC%9D%84-%EC%82%AD%EC%A0%9C-%EB%B0%A9%EB%B2%95">[참고사항] 기존 nvidia-docker 1.0 버전을 삭제 방법</h3>

<pre data-role="codeBlock" data-info="sh" class="language-bash">docker volume <span class="token function">ls</span> -q -f driver<span class="token operator">=</span>nvidia-docker <span class="token operator">|</span> \
<span class="token function">xargs</span> -r -I<span class="token punctuation">{</span><span class="token punctuation">}</span> -n1 docker <span class="token function">ps</span> -q -a -f volume<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">}</span> <span class="token operator">|</span> <span class="token function">xargs</span> -r docker <span class="token function">rm</span> -f
<span class="token function">sudo</span> <span class="token function">apt-get</span> purge nvidia-docker
</pre><h2 class="mume-header" id="host-pc-etchosts-%EC%88%98%EC%A0%95%ED%95%98%EA%B8%B0">[Host PC] /etc/hosts 수정하기</h2>

<p>KSB 툴박스의 docker 컨테이너 주소에 쉽게 접근하기 위해 아래와 같이 /etc/hosts 내용을 수정합니다. (host pc의 IP는 192.168.0.5로 가정합니다. 자신의 PC IP에 맞게 설정합니다.)</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash">127.0.0.1       localhost
<span class="token comment"># 아래 주석처리. Hdfs 연동시 문제가 생김.</span>
<span class="token comment">#127.0.1.1      csle1</span>

<span class="token comment"># The following lines are desirable for IPv6 capable hosts</span>
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

<span class="token comment"># 아래의 내용 추가</span>
192.168.0.5     csle1 master
</pre><h2 class="mume-header" id="host-pc-bashrc-%EC%84%A4%EC%A0%95-%EC%B6%94%EA%B0%80%ED%95%98%EA%B8%B0">[Host PC] bashrc 설정 추가하기</h2>

<p>csle 계정의 bashrc 파일을 업데이트 합니다. 아래의 내용을 터미널에 복사하여 설정가능합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">cat</span> <span class="token operator">&lt;&lt;</span>EOT <span class="token operator">>></span> ~/.bashrc
<span class="token function">export</span> JAVA_HOME<span class="token operator">=</span>/usr/lib/jvm/java-8-openjdk-amd64
<span class="token function">export</span> PATH<span class="token operator">=</span>\<span class="token variable">$PATH</span>:\<span class="token variable">$JAVA_HOME</span>/bin
<span class="token function">export</span> KSB_HOME<span class="token operator">=</span>/home/csle/ksb-csle
<span class="token function">export</span> PYTHONPATH<span class="token operator">=</span>/home/csle/ksb-csle/pyML/:\<span class="token variable">$PYTHONPATH</span>
<span class="token function">export</span> PYTHONPATH<span class="token operator">=</span>./:/home/csle/ksb-csle/ksblib:\<span class="token variable">$PYTHONPATH</span>
EOT
<span class="token function">source</span> ~/.bashrc
</pre><h2 class="mume-header" id="host-pc-%ED%81%AC%EB%A1%AC-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-optional">[Host PC] 크롬 설치하기 (optional)</h2>

<p>KSB 툴박스의 웹툴킷을 안정적으로 사용하기 위해서 크롬 브라우저를 설치합니다. 아래의 내용을 터미널에 복사하여 설정가능합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">cd</span> <span class="token operator">&amp;&amp;</span> \
<span class="token function">wget</span> \
https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
<span class="token function">sudo</span> <span class="token function">apt-get</span> update <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> <span class="token function">apt-get</span> <span class="token function">install</span> -y libxss1 libappindicator1 libindicator7 <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> dpkg -i google-chrome-stable_current_amd64.deb
</pre><h2 class="mume-header" id="host-pc-ksb-%ED%94%84%EB%A0%88%EC%9E%84%EC%9B%8C%ED%81%AC-%EC%84%A4%EC%B9%98-%EB%B0%8F-docker-image-%EB%8B%A4%EC%9A%B4%EB%B0%9B%EA%B8%B0">[Host PC] KSB 프레임워크 설치 및 docker image 다운받기</h2>

<p><a href="http://csleoss.etri.re.kr:8088/kor/sub02_01.do" title="&#xB2E4;&#xC6B4;&#xB85C;&#xB4DC;"> 다운로드</a> 페이지로부터 KSB 툴박스(docker image 별도) 파일을 다운로드합니다.</p>
<ul>
<li>ksb_toolbox_v1903.tar.gz : KSB 툴박스 파일<br>
<br></li>
</ul>
<p>csle 사용자 계정의 home에 ksb_toolbox_v1903.tar.gz 압축을 해제합니다. 결과적으로 /home/csle/ksb-csle 폴더가 생성됩니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">tar</span> zxvf ksb_toolbox_v1903.tar.gz -C /home/csle/
</pre><p>/home/csle/ksb-csle 폴더는 다음의 하위 폴더들로 구성됩니다.</p>
<ul>
<li>/bin : KSB 프레임워크 shell 스크립트 파일 저장 폴더</li>
<li>/components : tensorflow train 예제 프로그램 저장 폴더</li>
<li>/conf : KSB 프레임워크 환경설정 파일 저장 폴더</li>
<li>/docker : KSB 툴박스 docker 컨테이너 실행 스크립트 저장 폴더</li>
<li>/examples : CLI(Command Line Interface)를 통해 워크플로우 생성 및 submit 할 수 있는 프로젝트 폴더</li>
<li>/jars : KSB 프레임워크 19.03 버전의 jar 파일 저장 폴더</li>
<li>/ksblib : python 전처리 라이브러리 폴더</li>
<li>/kubernetes : 쿠버네티스 환경설정 폴더</li>
<li>/logs : log 저장 폴더</li>
<li>/pyML : autoML python 프로젝트 폴더</li>
<li>/tools: 예제 테스트를 위한 프로그램(jmeter, hadoop, kafka, maven, .ssh, webToolkit_db)<br>
<br></li>
</ul>
<p>Host PC에서 다음 명령으로 KSB 툴박스 docker image를 docker hub로부터 pull 합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash">docker pull ksbframework/ksb_toolbox_nvidia:19.03.5-cuda9.0-cudnn7
</pre><p>Host PC에서 다음 명령으로 KSB 툴박스 docker image를 확인합니다.<br>
(참고사항: 2019.05.24일 docker image 버전은 19.03.5-cuda9.0-cudnn7 버전이며, 추후 TAG 정보 및 SIZE 정보는 배포 버전에 따라 다를 수 있습니다)</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash">csle@csle1:~/ksb-csle$ docker images
REPOSITORY                       TAG                    IMAGE ID     CREATED      SIZE
ksbframework/ksb_toolbox_nvidia  19.03.5-cuda9.0-cudnn7 4b0ba4b5b184 5 hours ago  9.48GB
</pre><h2 class="mume-header" id="host-pc-ksb-%ED%88%B4%EB%B0%95%EC%8A%A4-docker-%EC%9D%B4%EB%AF%B8%EC%A7%80%EB%82%B4-ssh-%ED%82%A4%EB%A5%BC-host-pc%EC%97%90-%EB%B3%B5%EC%82%AC%ED%95%98%EA%B8%B0">[Host PC] KSB 툴박스 docker 이미지내 SSH 키를 host pc에 복사하기</h2>

<p>KSB 툴박스 docker 컨테이너의 인증키를 공유하기 위해 ksb-csle/tools 폴더에 있는 .ssh 폴더를 csle 홈에 카피합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">cp</span> -r ~/ksb-csle/tools/.ssh/ /home/csle/
</pre><p>authorized_keys를 다른 계정이 읽고 쓸 수 없게 600 mode(소유자만 rw 가능)로 변경합니다.</p>
<pre data-role="codeBlock" data-info="" class="language-"><code>chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
</code></pre><h2 class="mume-header" id="host-pc-ssh-%EC%9E%AC%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0">[Host PC] SSH 재시작하기</h2>

<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">sudo</span> <span class="token function">service</span> <span class="token function">ssh</span> restart
</pre><h2 class="mume-header" id="host-pc-ksbconf-%EC%88%98%EC%A0%95%ED%95%98%EA%B8%B0">[Host PC] ksb.conf 수정하기</h2>

<p>KSB 툴박스 nvidia 이미지 버전은 tensorflow 1.6 gpu 버전과 cpu 버전이 설치되어있습니다. 따라서, 아래와 같이 ksb.conf 파일을 수정합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash">tensorflow <span class="token punctuation">{</span>
    <span class="token function">enable</span> <span class="token operator">=</span> <span class="token string">"true"</span>
<span class="token comment">#        python_path = "/anaconda3/envs/tensorflow/bin/python"</span>
    python_path <span class="token operator">=</span> <span class="token string">"/anaconda3/envs/tensorflow16_gpu/bin/python"</span>
    python_code_project_path <span class="token operator">=</span> <span class="token string">"/analysis"</span>
<span class="token punctuation">}</span>

</pre><h2 class="mume-header" id="host-pc-ksb-csle-%ED%8F%B4%EB%8D%94-%EA%B6%8C%ED%95%9C-%EB%B3%80%EA%B2%BD%ED%95%98%EA%B8%B0">[Host PC] ksb-csle 폴더 권한 변경하기</h2>

<p>KSB 툴박스 docker 컨테이너에서 Host PC의 ksb-csle 폴더를 엑세스 할 수 있도록 폴더 권한을 변경합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">sudo</span> <span class="token function">chmod</span> 777 -R /home/csle/ksb-csle/
</pre><h2 class="mume-header" id="host-pc-startdockercslesh-stopdockercslesh-%EC%B6%94%EA%B0%80%ED%95%98%EA%B8%B0">[Host PC] <a href="http://startDockerCsle.sh">startDockerCsle.sh</a> <a href="http://stopDockerCsle.sh">stopDockerCsle.sh</a> 추가하기</h2>

<p>아래의 스크립트를 복사하여 터미널에서 실행하면 <a href="http://startDockerCsle.sh">startDockerCsle.sh</a> 파일이 생성됩니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">mkdir</span> -p /home/csle/ksb-csle/docker/19.03-nvidia
<span class="token function">cat</span> <span class="token operator">&lt;&lt;</span>EOT <span class="token operator">>></span> /home/csle/ksb-csle/docker/19.03-nvidia/startDockerCsle.sh
<span class="token comment">#!/bin/bash</span>
<span class="token function">sudo</span> <span class="token function">service</span> postgresql stop

docker network <span class="token function">rm</span> csle_cluster csle_standalone

docker <span class="token function">rm</span> -f csle1
<span class="token keyword">echo</span> <span class="token string">"start csle1 slave container..."</span>
docker run --rm -itd \\
         --runtime<span class="token operator">=</span>nvidia \\
         --net<span class="token operator">=</span>host \\
         -v /home/csle/ksb-csle:/home/csle/ksb-csle \\
         -v /etc/localtime:/etc/localtime:ro \\
         -v /etc/timezone:/etc/timezone \\
         --user<span class="token operator">=</span>csle \\
         --name<span class="token operator">=</span>csle1 \\
         --hostname<span class="token operator">=</span>csle1\\
         ksbframework/ksb_toolbox_nvidia:19.03.5-cuda9.0-cudnn7 <span class="token function">bash</span>

docker <span class="token function">exec</span> -it csle1 <span class="token function">bash</span>
EOT
<span class="token function">chmod</span> +x /home/csle/ksb-csle/docker/19.03-nvidia/startDockerCsle.sh
<span class="token function">cat</span> <span class="token operator">&lt;&lt;</span>EOT <span class="token operator">>></span> /home/csle/ksb-csle/docker/19.03-nvidia/stopDockerCsle.sh
<span class="token comment">#!/bin/bash</span>
docker <span class="token function">rm</span> -f csle1
EOT
<span class="token function">chmod</span> +x /home/csle/ksb-csle/docker/19.03-nvidia/stopDockerCsle.sh
</pre><p>KSB 인공지능 프레임워크 실행하기 위해 <a href="https://csleoss.etri.re.kr/images/contents/manual_1903/1.5.HowToRunFirst-1903.html" title="KSB &#xC778;&#xACF5;&#xC9C0;&#xB2A5; &#xD504;&#xB808;&#xC784;&#xC6CC;&#xD06C; &#xC2E4;&#xD589;&#xD558;&#xAE30;">KSB 인공지능 프레임워크 실행하기</a> 페이지로 이동하여 KSB 프레임워크를 구동합니다.<br>
단, nvidia-docker 버전 KSB 프레임워크 구동시 기존 cpu버전 툴박스와의 차이점은 위에서 생성한 /home/csle/ksb-csle/docker/19.03-nvidia/startDockerCsle.sh을 실행하여 KSB 툴박스 docker 컨테이너를 실행하고 접속하는 것일 뿐 모두 동일합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash">csle@csle1:~/ksb-csle/docker/19.03-nvidia$ ./startDockerCsle.sh
Error response from daemon: network csle_cluster not found
Error response from daemon: network csle_standalone not found
csle1
start csle1 slave container<span class="token punctuation">..</span>.
4918997cd2dac93fe0b52f3df3a45a46db6df1f3f052854061696695451d2f22
csle@csle1:/$
</pre><p>이상으로 nvidia-docker 버전 KSB 툴박스를 구동하기 위해 준비가 완료되었습니다.<br>
<a href="https://csleoss.etri.re.kr/images/contents/manual_1.0/1.5.HowToRunFirst.html" title="KSB &#xC778;&#xACF5;&#xC9C0;&#xB2A5; &#xD504;&#xB808;&#xC784;&#xC6CC;&#xD06C; &#xC2E4;&#xD589;&#xD558;&#xAE30;">KSB 인공지능 프레임워크 실행하기</a> 페이지로 이동하여 KSB 프레임워크를 구동하도록 하겠습니다.</p>

      </div>
      <div class="md-sidebar-toc"><ul>
<li><a href="#ksb-%ED%88%B4%EB%B0%95%EC%8A%A4-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0nvidia-docker%EB%B2%84%EC%A0%84">KSB 툴박스 설치하기(nvidia-docker버전)</a>
<ul>
<li><a href="#%EC%84%A4%EC%B9%98-%EC%9A%94%EA%B5%AC%EC%82%AC%ED%95%AD">설치 요구사항</a></li>
<li><a href="#%EC%82%AC%EC%9A%A9%EC%8B%9C-%EC%9C%A0%EC%9D%98%EC%82%AC%ED%95%AD">사용시 유의사항</a></li>
<li><a href="#%EC%84%A4%EC%B9%98-%EC%88%9C%EC%84%9C">설치 순서</a></li>
<li><a href="#host-pc-csle-%EC%82%AC%EC%9A%A9%EC%9E%90-%EA%B3%84%EC%A0%95%EA%B6%8C%ED%95%9C-administrator-%EC%83%9D%EC%84%B1%ED%95%98%EA%B8%B0">[Host PC] csle 사용자 계정(권한 : administrator) 생성하기</a></li>
<li><a href="#host-pc-hostname%EC%9D%84-csle1%EC%9C%BC%EB%A1%9C-%EB%B3%80%EA%B2%BD%ED%95%98%EA%B8%B0">[Host PC] hostname을 csle1으로 변경하기</a></li>
<li><a href="#host-pc-nvidia-%EA%B7%B8%EB%9E%98%ED%94%BD%EC%B9%B4%EB%93%9C-%EB%93%9C%EB%9D%BC%EC%9D%B4%EB%B2%84-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] NVIDIA 그래픽카드 드라이버 설치하기</a></li>
<li><a href="#host-pc-openjdk-8-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] openjdk-8 설치하기</a></li>
<li><a href="#host-pc-ksb-%ED%88%B4%EB%B0%95%EC%8A%A4-%EA%B4%80%EB%A0%A8-%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%A8-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] KSB 툴박스 관련 프로그램 설치하기</a></li>
<li><a href="#host-pc-ssh-port-%EB%B3%80%EA%B2%BD-%EB%B0%8F-root-%EB%A1%9C%EA%B7%B8%EC%9D%B8-%EA%B0%80%EB%8A%A5%ED%95%98%EB%8F%84%EB%A1%9D-sshd-config-%EC%88%98%EC%A0%95%ED%95%98%EA%B8%B0">[Host PC] SSH port 변경 및 root 로그인 가능하도록 SSHD config 수정하기</a></li>
<li><a href="#host-pc-ssh-config-%EC%88%98%EC%A0%95%ED%95%98%EA%B8%B0-known_hosts%EC%97%90-%ED%98%B8%EC%8A%A4%ED%8A%B8-%EC%A0%80%EC%9E%A5-%EC%A7%88%EB%AC%B8%EC%9D%84-%ED%95%98%EC%A7%80-%EC%95%8A%EB%8F%84%EB%A1%9D-%EC%84%A4%EC%A0%95">[Host PC] SSH config 수정하기 (known_hosts에 호스트 저장 질문을 하지 않도록 설정)</a></li>
<li><a href="#host-pc-docker-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] Docker 설치하기</a><br>
* <a href="#%EC%B0%B8%EA%B3%A0%EC%82%AC%ED%95%AD-%EA%B8%B0%EC%A1%B4-docker-engine-%EC%82%AD%EC%A0%9C-%EB%B0%A9%EB%B2%95">[참고사항] 기존 docker-engine 삭제 방법</a></li>
<li><a href="#host-pc-nvidia-docker-20-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] nvidia-docker 2.0 설치하기</a>
<ul>
<li><a href="#%EC%B0%B8%EA%B3%A0%EC%82%AC%ED%95%AD-%EA%B8%B0%EC%A1%B4-nvidia-docker-10-%EB%B2%84%EC%A0%84%EC%9D%84-%EC%82%AD%EC%A0%9C-%EB%B0%A9%EB%B2%95">[참고사항] 기존 nvidia-docker 1.0 버전을 삭제 방법</a></li>
</ul>
</li>
<li><a href="#host-pc-etchosts-%EC%88%98%EC%A0%95%ED%95%98%EA%B8%B0">[Host PC] /etc/hosts 수정하기</a></li>
<li><a href="#host-pc-bashrc-%EC%84%A4%EC%A0%95-%EC%B6%94%EA%B0%80%ED%95%98%EA%B8%B0">[Host PC] bashrc 설정 추가하기</a></li>
<li><a href="#host-pc-%ED%81%AC%EB%A1%AC-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-optional">[Host PC] 크롬 설치하기 (optional)</a></li>
<li><a href="#host-pc-ksb-%ED%94%84%EB%A0%88%EC%9E%84%EC%9B%8C%ED%81%AC-%EC%84%A4%EC%B9%98-%EB%B0%8F-docker-image-%EB%8B%A4%EC%9A%B4%EB%B0%9B%EA%B8%B0">[Host PC] KSB 프레임워크 설치 및 docker image 다운받기</a></li>
<li><a href="#host-pc-ksb-%ED%88%B4%EB%B0%95%EC%8A%A4-docker-%EC%9D%B4%EB%AF%B8%EC%A7%80%EB%82%B4-ssh-%ED%82%A4%EB%A5%BC-host-pc%EC%97%90-%EB%B3%B5%EC%82%AC%ED%95%98%EA%B8%B0">[Host PC] KSB 툴박스 docker 이미지내 SSH 키를 host pc에 복사하기</a></li>
<li><a href="#host-pc-ssh-%EC%9E%AC%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0">[Host PC] SSH 재시작하기</a></li>
<li><a href="#host-pc-ksbconf-%EC%88%98%EC%A0%95%ED%95%98%EA%B8%B0">[Host PC] ksb.conf 수정하기</a></li>
<li><a href="#host-pc-ksb-csle-%ED%8F%B4%EB%8D%94-%EA%B6%8C%ED%95%9C-%EB%B3%80%EA%B2%BD%ED%95%98%EA%B8%B0">[Host PC] ksb-csle 폴더 권한 변경하기</a></li>
<li><a href="#host-pc-startdockercslesh-stopdockercslesh-%EC%B6%94%EA%B0%80%ED%95%98%EA%B8%B0">[Host PC] startDockerCsle.sh stopDockerCsle.sh 추가하기</a></li>
</ul>
</li>
</ul>
</div>
      <a id="sidebar-toc-btn"></a>
    </body>
    
    
    
    
    
    
    
<script>
document.body.setAttribute('html-show-sidebar-toc', true)
var sidebarTOCBtn = document.getElementById('sidebar-toc-btn')
sidebarTOCBtn.addEventListener('click', function(event) {
  event.stopPropagation()
  if (document.body.hasAttribute('html-show-sidebar-toc')) {
    document.body.removeAttribute('html-show-sidebar-toc')
  } else {
    document.body.setAttribute('html-show-sidebar-toc', true)
  }
})
</script>
      
  </html>