1.3.HowToInstallKsbFrameWork.html 95.7 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 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981
<!DOCTYPE html>
  <html>
    <head>
      <title>1.3.HowToInstallKsbFrameWork</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-%EC%9D%B8%EA%B3%B5%EC%A7%80%EB%8A%A5-%ED%94%84%EB%A0%88%EC%9E%84%EC%9B%8C%ED%81%AC-%EC%84%A4%EC%B9%98">KSB 인공지능 프레임워크 설치</h1>

<hr>
<p>제공된 KSB 툴박스 docker image를 사용하지 않고, 직접 Host PC에 KSB 인공지능 프레임워크를 설치하기 위해서 아래의 오픈소스 프레임워크들을 설치합니다. 사용자 csle 계정을 생성한 후 아래 프로그램들을 설치합니다.</p>
<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-etchosts-%EC%88%98%EC%A0%95%ED%95%98%EA%B8%B0">[Host PC] /etc/hosts 수정하기</h2>

<p>KSB 웹툴킷에 쉽게 접근하기 위해 아래와 같이 /etc/hosts 내용을 수정합니다. (host pc의 IP는 10.0.2.15로 가정합니다. 자신의 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>
10.0.2.15     csle1 master
</pre><h2 class="mume-header" id="host-pc-java-8-oracle-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] java-8-oracle 설치하기</h2>

<p>Host PC에 Ubuntu 16.04를 처음 설치한 경우 java 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> <span class="token function">install</span> -y python-software-properties <span class="token operator">&amp;&amp;</span> \
<span class="token function">sudo</span> add-apt-repository -y ppa:webupd8team/java <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 keyword">echo</span> <span class="token string">"oracle-java8-installer \
shared/accepted-oracle-license-v1-1 select true"</span> \
<span class="token operator">|</span> <span class="token function">sudo</span> debconf-set-selections <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 oracle-java8-installer
</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_181"</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_181-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><p>가끔 오라클에서 jdk 버전을 업데이트 하면 아래와 같은 에러가 발생하며 jdk가 설치되지 않는 경우가 있습니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash">접속 download.oracle.com <span class="token punctuation">(</span>download.oracle.com<span class="token punctuation">)</span><span class="token operator">|</span>23.35.220.157<span class="token operator">|</span>:80<span class="token punctuation">..</span>. 접속됨.
HTTP request sent, awaiting response<span class="token punctuation">..</span>. 404 Not Found
2018-10-17 11:08:56 ERROR 404: Not Found.

download failed
Oracle JDK 8 is NOT installed.
dpkg: error processing package oracle-java8-installer <span class="token punctuation">(</span>--configure<span class="token punctuation">)</span>:
 설치한 post-installation 스크립트 하위 프로세스가 오류 1번을 리턴했습니다
처리하는데 오류가 발생했습니다:
 oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code <span class="token punctuation">(</span>1<span class="token punctuation">)</span>
</pre><p>해결방법은 오라클 사이트에 방문하여 최신 버전(2018.10.21. 기준 : 8u191)을 jdk-8u191-linux-x64.tar.gz 파일을 다운받습니다.<br>
<a href="https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html</a></p>
<p>그리고, 아래의 스크립트에서 다운받은 파일의 위치와 버전 부분만을 수정한 후, 터미널에 복사하면 직접 설치가능합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">sudo</span> <span class="token function">mkdir</span> /usr/lib/jvm
<span class="token function">cd</span> /usr/lib/jvm
<span class="token function">sudo</span> <span class="token function">tar</span> -xvzf /home/csle/jdk-8u191-linux-x64.tar.gz  <span class="token comment"># 수정 필요</span>
<span class="token function">sudo</span> <span class="token function">mv</span> jdk1.8.0_191/ java-8-oracle/  <span class="token comment"># 수정 필요</span>

<span class="token function">sudo</span> truncate -s0 /etc/environment
<span class="token keyword">echo</span> <span class="token string">"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:\
/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:\
/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin"</span> <span class="token operator">|</span>\
<span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/environment <span class="token operator">></span>/dev/null <span class="token operator">&amp;&amp;</span> \
<span class="token keyword">echo</span> <span class="token string">"J2SDKDIR=/usr/lib/jvm/java-8-oracle"</span> <span class="token operator">|</span> \
<span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/environment <span class="token operator">></span>/dev/null <span class="token operator">&amp;&amp;</span> \
<span class="token keyword">echo</span> <span class="token string">"J2REDIR=/usr/lib/jvm/java-8-oracle/jre*"</span> <span class="token operator">|</span> \
<span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/environment <span class="token operator">></span>/dev/null <span class="token operator">&amp;&amp;</span> \
<span class="token keyword">echo</span> <span class="token string">"JAVA_HOME=/usr/lib/jvm/java-8-oracle"</span> <span class="token operator">|</span> \
<span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/environment <span class="token operator">></span>/dev/null <span class="token operator">&amp;&amp;</span> \
<span class="token keyword">echo</span> <span class="token string">"DERBY_HOME=/usr/lib/jvm/java-8-oracle/db"</span> <span class="token operator">|</span> \
<span class="token function">sudo</span> <span class="token function">tee</span> -a /etc/environment <span class="token operator">></span>/dev/null

<span class="token function">sudo</span> update-alternatives --install \
<span class="token string">"/usr/bin/java"</span> <span class="token string">"java"</span> <span class="token string">"/usr/lib/jvm/java-8-oracle/bin/java"</span> 0
<span class="token function">sudo</span> update-alternatives --install \
<span class="token string">"/usr/bin/javac"</span> <span class="token string">"javac"</span> <span class="token string">"/usr/lib/jvm/java-8-oracle/bin/javac"</span> 0
<span class="token function">sudo</span> update-alternatives --set java /usr/lib/jvm/java-8-oracle/bin/java
<span class="token function">sudo</span> update-alternatives --set javac /usr/lib/jvm/java-8-oracle/bin/javac
update-alternatives --list java
update-alternatives --list javac
</pre><h2 class="mume-header" id="host-pc-ksb-%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-hadoop-273-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] Hadoop 2.7.3 설치하기</h2>

<p>아래 링크를 참고하여 사용자의 PC 혹은 클러스터 환경에 맞게 설치합니다.</p>
<p>참고링크 : <a href="https://hadoop.apache.org/docs/r2.7.3/">https://hadoop.apache.org/docs/r2.7.3/</a><br>
다운로드 링크 : <a href="https://archive.apache.org/dist/hadoop/common/hadoop-2.7.3/">https://archive.apache.org/dist/hadoop/common/hadoop-2.7.3/</a></p>
<p><strong>[KSB 툴박스를 이용한 설치 방법]</strong><br>
KSB 툴박스를 동작시킨 상태에서 docker 컨테이너로부터 hadoop 설정 파일을 복사하여 설치할 수도 있습니다.<br>
먼저 도커에 접속하는 방법을 참고하여 접속합니다. (<a href="http://csleoss.etri.re.kr:8088/images/contents/manual_1.0/Filezilla.html"> Filezilla를 이용하여 KSB 툴박스 docker 컨테이너에 접속하기 </a>)<br>
도커에 있는 hadoop-2.7.3 폴더를 Host PC의 /home/csle 폴더에 복사합니다.<br>
또한, /home/csle/data 폴더의 hdfs 관련 정보저장 폴더를 /home/csle 폴더에 복사합니다.<br>
그리고, ssh 포트 정보를 '<a href="http://hadoop-env.sh">hadoop-env.sh</a>'파일에 추가합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">vi</span> /home/csle/hadoop-2.7.3/etc/hadoop/hadoop-env.sh
<span class="token function">export</span> HADOOP_SSH_OPTS<span class="token operator">=</span><span class="token string">"-p 2243"</span>
</pre><p>마지막으로 심볼릭링크을 설정합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">ln</span> -s /home/csle/hadoop-2.7.3 /home/csle/hadoop
</pre><h2 class="mume-header" id="host-pc-spark-230-bin-hadoop27-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] spark-2.3.0-bin-hadoop2.7 설치하기</h2>

<p>아래 링크를 참고하여 사용자의 PC 혹은 클러스터 환경에 맞게 설치합니다.</p>
<p>참고링크 : <a href="https://spark.apache.org/downloads.html">https://spark.apache.org/downloads.html</a><br>
다운로드 링크 : <a href="https://spark.apache.org/downloads.html">https://spark.apache.org/downloads.html</a></p>
<p><strong>[KSB 툴박스를 이용한 설치 방법]</strong><br>
KSB 툴박스를 동작시킨 상태에서 docker 컨테이너로부터 spark 설정 파일을 복사하여 설치할 수도 있습니다.<br>
먼저 도커에 접속하는 방법을 참고하여 접속합니다. (<a href="http://csleoss.etri.re.kr:8088/images/contents/manual_1.0/Filezilla.html"> Filezilla를 이용하여 KSB 툴박스 docker 컨테이너에 접속하기 </a>)<br>
도커에 있는 spark-2.3.0-bin-hadoop2.7 폴더를 /home/csle 폴더에 복사합니다.</p>
<p>그리고 심볼릭링크을 설정합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">ln</span> -s /home/csle/spark-2.3.0-bin-hadoop2.7 /home/csle/spark
</pre><h2 class="mume-header" id="host-pc-hbase-124optional-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] hbase 1.2.4(optional) 설치하기</h2>

<p>아래 링크를 참고하여 사용자의 PC 혹은 클러스터 환경에 맞게 설치합니다.</p>
<p>참고링크 : <a href="https://hbase.apache.org/book.html">https://hbase.apache.org/book.html</a><br>
다운로드 링크 : <a href="https://archive.apache.org/dist/hbase/1.2.4/">https://archive.apache.org/dist/hbase/1.2.4/</a></p>
<p><strong>[KSB 툴박스를 이용한 설치 방법]</strong><br>
KSB 툴박스를 동작시킨 상태에서 docker 컨테이너로부터 hbase 설정 파일을 복사하여 설치할 수도 있습니다.<br>
먼저 도커에 접속하는 방법을 참고하여 접속합니다. (<a href="http://csleoss.etri.re.kr:8088/images/contents/manual_1.0/Filezilla.html"> Filezilla를 이용하여 KSB 툴박스 docker 컨테이너에 접속하기 </a>)<br>
도커에 있는 hbase-1.2.4 폴더를 /home/csle 폴더에 폴더에 복사합니다.<br>
그리고, ssh 포트 정보를 '<a href="http://hbase-env.sh">hbase-env.sh</a>'파일에 추가합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">vi</span> /home/csle/hbase-1.2.4/conf/hbase-env.sh
<span class="token function">export</span> HBASE_SSH_OPTS<span class="token operator">=</span><span class="token string">"-p 2243"</span>
</pre><p>그리고 심볼릭링크을 설정합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">ln</span> -s /home/csle/hbase-1.2.4 /home/csle/hbase
</pre><h2 class="mume-header" id="host-pc-kafka-211-01001optional-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] kafka 2.11-0.10.0.1(optional) 설치하기</h2>

<p>아래 링크를 참고하여 사용자의 PC 혹은 클러스터 환경에 맞게 설치합니다.</p>
<p>참고링크 : <a href="https://kafka.apache.org/">https://kafka.apache.org/</a><br>
다운로드 링크 : <a href="https://kafka.apache.org/downloads">https://kafka.apache.org/downloads</a></p>
<p><strong>[KSB 툴박스를 이용한 설치 방법]</strong><br>
KSB 툴박스를 동작시킨 상태에서 docker 컨테이너로부터 kafka 설정 파일을 복사하여 설치할 수도 있습니다.<br>
먼저 도커에 접속하는 방법을 참고하여 접속합니다. (<a href="http://csleoss.etri.re.kr:8088/images/contents/manual_1.0/Filezilla.html"> Filezilla를 이용하여 KSB 툴박스 docker 컨테이너에 접속하기 </a>)<br>
도커에 있는 kafka_2.11-0.10.0.1 폴더를 /home/csle 폴더에 복사합니다.<br>
그리고 심볼릭링크을 설정합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">ln</span> -s /home/csle/kafka_2.11-0.10.0.1 /home/csle/kafka
</pre><h2 class="mume-header" id="host-pc-zookeeper-349optional-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] zookeeper 3.4.9(optional) 설치하기</h2>

<p>아래 링크를 참고하여 사용자의 PC 혹은 클러스터 환경에 맞게 설치합니다.</p>
<p>참고링크 : <a href="https://zookeeper.apache.org/">https://zookeeper.apache.org/</a><br>
다운로드 링크 : <a href="https://archive.apache.org/dist/zookeeper/zookeeper-3.4.9/">https://archive.apache.org/dist/zookeeper/zookeeper-3.4.9/</a></p>
<p><strong>[KSB 툴박스를 이용한 설치 방법]</strong><br>
KSB 툴박스를 동작시킨 상태에서 docker 컨테이너로부터 zookeeper 설정 파일을 복사하여 설치할 수도 있습니다.<br>
먼저 도커에 접속하는 방법을 참고하여 접속합니다. (<a href="http://csleoss.etri.re.kr:8088/images/contents/manual_1.0/Filezilla.html"> Filezilla를 이용하여 KSB 툴박스 docker 컨테이너에 접속하기 </a>)<br>
도커에 있는 zookeeper-3.4.9 폴더를 /home/csle 폴더에 복사합니다.<br>
그리고 심볼릭링크을 설정합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">ln</span> -s /home/csle/zookeeper-3.4.9 /home/csle/zookeeper
</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 keyword">echo</span> <span class="token string">"export JAVA_HOME=/usr/lib/jvm/java-8-oracle"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PATH=\<span class="token variable">$PATH</span>:\<span class="token variable">$JAVA_HOME</span>/bin"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PATH=/opt/apache-maven-3.3.9/bin:\<span class="token variable">$PATH</span>"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export HADOOP_HOME=/home/csle/hadoop-2.7.3"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export HADOOP_PREFIX=\<span class="token variable">$HADOOP_HOME</span>"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PATH=\<span class="token variable">$PATH</span>:\<span class="token variable">$HADOOP_PREFIX</span>/bin"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PATH=\<span class="token variable">$PATH</span>:\<span class="token variable">$HADOOP_PREFIX</span>/sbin"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export HADOOP_CONF_DIR=\<span class="token variable">$HADOOP_HOME</span>/etc/hadoop"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export YARN_CONF_DIR=\<span class="token variable">$HADOOP_HOME</span>/etc/hadoop"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export HADOOP_MAPRED_HOME=\<span class="token variable">${HADOOP_PREFIX}</span>"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export HADOOP_COMMON_HOME=\<span class="token variable">${HADOOP_PREFIX}</span>"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export HADOOP_HDFS_HOME=\<span class="token variable">${HADOOP_PREFIX}</span>"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export YARN_HOME=\<span class="token variable">${HADOOP_PREFIX}</span>"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export HADOOP_COMMON_LIB_NATIVE_DIR=\<span class="token variable">${YARN_HOME}</span>/lib/native"</span><span class="token operator">>></span>\
~/.bashrc
<span class="token keyword">echo</span> \
<span class="token string">"export HADOOP_OPTS="</span>-Djava.library.path<span class="token operator">=</span>\<span class="token variable">$YARN_HOME</span>/lib/native<span class="token string">""</span> <span class="token operator">>></span>\
~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export ZOOKEEPER_HOME=/home/csle/zookeeper-3.4.9"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export ZOOKEEPER_PREFIX=\<span class="token variable">$ZOOKEEPER_HOME</span>"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export ZOO_LOG_DIR=\<span class="token variable">$ZOOKEEPER_HOME</span>/logs"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PATH=\<span class="token variable">$PATH</span>:\<span class="token variable">$ZOOKEEPER_HOME</span>/bin"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export SPARK_HOME=/home/csle/spark-2.3.0-bin-hadoop2.7"</span> <span class="token operator">>></span>\
~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PATH=\<span class="token variable">$PATH</span>:\<span class="token variable">$SPARK_HOME</span>/bin"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export HBASE_HOME=/home/csle/hbase-1.2.4"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PATH=\<span class="token variable">$PATH</span>:\<span class="token variable">$HBASE_HOME</span>/bin"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export KAFKA_HOME=/home/csle/kafka_2.11-0.10.0.1"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PATH=\<span class="token variable">$PATH</span>:\<span class="token variable">$KAFKA_HOME</span>/bin"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export \
MONGODB_HOME=/home/csle/mongodb-linux-x86_64-ubuntu1404-3.4.1"</span> <span class="token operator">>></span>\
~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PATH=\<span class="token variable">$PATH</span>:\<span class="token variable">$MONGODB_HOME</span>/bin"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export LANGUAGE=ko_KR.UTF-8"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export LANG=ko_KR.UTF-8"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PATH=/home/csle/anaconda3/bin:\<span class="token variable">$PATH</span>"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export ACTIVATOR_HOME=/home/csle/activator-dist-1.3.12"</span> <span class="token operator">>></span>\
~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PATH=\<span class="token variable">$PATH</span>:\<span class="token variable">$ACTIVATOR_HOME</span>/bin"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PATH=\<span class="token variable">$PATH</span>:/home/csle/KBE"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export KSB_HOME=/home/csle/ksb-csle"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PYTHONPATH=/home/csle/ksb-csle/pyML/:\<span class="token variable">$PYTHONPATH</span>"</span> <span class="token operator">>></span>\
~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PYTHONPATH=./:/home/csle/ksb-csle/ksblib:\<span class="token variable">$PYTHONPATH</span>"</span> <span class="token operator">>></span>\
~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PYSPARK_PYTHON=/home/csle/anaconda3/bin/python"</span> <span class="token operator">>></span>\
~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PYSPARK_DRIVER_PYTHON=/home/csle/anaconda3/bin/python"</span> <span class="token operator">>></span>\
~/.bashrc
<span class="token keyword">echo</span> <span class="token string">"export PATH=\<span class="token variable">$PATH</span>:/home/csle/anaconda3/bin/"</span> <span class="token operator">>></span> ~/.bashrc
<span class="token function">source</span> ~/.bashrc
</pre><h2 class="mume-header" id="host-pc-anaconda3-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] Anaconda3 설치하기</h2>

<p>가상환경을 이용하여 tensorflow cpu버전을 설치하기 위해 anaconda3를 홈페이지(<a href="https://repo.anaconda.com/archive/">https://repo.anaconda.com/archive/</a>)에서<br>
&quot;Anaconda3-4.2.0-Linux-x86_64.sh&quot;버전을 다운받습니다.<br>
아래의 명령을 이용하여 csle 홈 폴더에 anaconda3를 설치합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">bash</span> Anaconda3-4.2.0-Linux-x86_64.sh -b -p /home/csle/anaconda3
</pre><h3 class="mume-header" id="host-pc-%EA%B8%B0%ED%83%80-%EB%9D%BC%EC%9D%B4%EB%B8%8C%EB%9F%AC%EB%A6%AC-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] 기타 라이브러리 설치하기</h3>

<p>pyspark에서 사용하는 python에 관련 라이브러리를 설치합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash">conda update -y conda  <span class="token operator">&amp;&amp;</span> \
conda <span class="token function">install</span> -c conda-forge protobuf  <span class="token operator">&amp;&amp;</span> \
pip <span class="token function">install</span> py4j  <span class="token operator">&amp;&amp;</span> \
pip <span class="token function">install</span> --upgrade pip  <span class="token operator">&amp;&amp;</span> \
pip <span class="token function">install</span> hdfs  <span class="token operator">&amp;&amp;</span> \
conda <span class="token function">install</span> -y hdfs3 libhdfs3 -c conda-forge
</pre><h2 class="mume-header" id="host-pc-tensorflow-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-cpu%EB%B2%84%EC%A0%84">[Host PC] tensorflow 설치하기 (cpu버전)</h2>

<p>tensorflow 설치를 위한 가상환경을 설치합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash">conda update -y conda <span class="token operator">&amp;&amp;</span> \
conda create -y -n tensorflow python<span class="token operator">=</span>3.5
</pre><pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">source</span> activate tensorflow
pip <span class="token function">install</span> <span class="token string">"tensorflow==1.6.0"</span>  <span class="token operator">&amp;&amp;</span> \
pip <span class="token function">install</span> setuptools  <span class="token operator">&amp;&amp;</span> \
pip <span class="token function">install</span> matplotlib  <span class="token operator">&amp;&amp;</span> \
pip <span class="token function">install</span> pandas  <span class="token operator">&amp;&amp;</span> \
pip <span class="token function">install</span> scikit-optimize  <span class="token operator">&amp;&amp;</span> \
pip <span class="token function">install</span> hdfs  <span class="token operator">&amp;&amp;</span> \
conda <span class="token function">install</span> -y hdfs3 libhdfs3 -c conda-forge
<span class="token function">source</span> deactivate
</pre><h2 class="mume-header" id="host-pc-ksb-%ED%88%B4%EB%B0%95%EC%8A%A4-%ED%8C%8C%EC%9D%BC-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] KSB 툴박스 파일 설치하기</h2>

<p>KSB 프레임워크를 호스트 서버에 직접 설치하는 경우에도 ksb_toolbox_v1.tar.gz 파일이 필요합니다.<br>
<a href="http://csleoss.etri.re.kr:8088/kor/sub02_01.do" title="&#xB2E4;&#xC6B4;&#xB85C;&#xB4DC;"> 다운로드</a> 페이지로부터 KSB 툴박스 파일을 다운로드합니다.</p>
<ul>
<li>ksb_toolbox_v1.tar.gz : KSB 툴박스 파일<br>
<br></li>
</ul>
<p>csle 사용자 계정의 home에 ksb_toolbox_v1.tar.gz 압축을 해제합니다. 결과적으로 /home/csle/ksb-csle 폴더가 생성됩니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash">   csle@csle1:~$ <span class="token function">tar</span> zxvf ksb_toolbox_v1.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 프레임워크 1.0 버전의 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)<br>
<br></li>
</ul>
<h2 class="mume-header" id="host-pc-ksb-csle-config-%ED%8C%8C%EC%9D%BC-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0">[Host PC] ksb-csle config 파일 설정하기</h2>

<p>/home/csle/ksb-csle/conf/ksb.conf 파일을 사용자 PC에 맞게 수정합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash">csle <span class="token punctuation">{</span>
    user <span class="token punctuation">{</span>
        home <span class="token operator">=</span> <span class="token string">"/home/csle"</span>      <span class="token comment"># 사용자 home 디렉토리를 지정합니다.</span>
    <span class="token punctuation">}</span>
    home <span class="token operator">=</span> <span class="token string">"/home/csle/ksb-csle"</span> <span class="token comment"># KSB home 디렉토리를 지정합니다.</span>
    submit.cli <span class="token operator">=</span> <span class="token string">"true"</span>
    scheduler.initialization <span class="token operator">=</span> <span class="token string">"false"</span>
<span class="token punctuation">}</span>

servers <span class="token punctuation">{</span>
    gateway <span class="token punctuation">{</span>
        baseUrl <span class="token operator">=</span> <span class="token string">"http://KSB_GATEWAY:SERVICEPORT"</span>
    <span class="token punctuation">}</span>
    kubernetes <span class="token punctuation">{</span>
        <span class="token function">enable</span> <span class="token operator">=</span> <span class="token string">"false"</span>
        baseUrl <span class="token operator">=</span> <span class="token string">"http://SERVICENAME.ksb.local:30100"</span>
        imgRepositoryUrl <span class="token operator">=</span> <span class="token string">"docker.io"</span>
        kubernetes_yaml_path <span class="token operator">=</span> <span class="token string">"/kubernetes"</span>
        masterIp <span class="token operator">=</span> <span class="token string">"csle1"</span> <span class="token comment"># Kubernetes 마스터 도메인 이름 혹은 IP를 지정합니다.</span>
        masterPort <span class="token operator">=</span> <span class="token string">"2243"</span> <span class="token comment"># Kubernetes SSH 포트 번호를 지정합니다.</span>
        nodesIp <span class="token operator">=</span> <span class="token string">"csle2, csle3"</span>
        <span class="token comment"># Kubernetes 노드들의 도메인 이름 혹은 IP들을 지정합니다.</span>
        user <span class="token operator">=</span> <span class="token string">"csle"</span>       <span class="token comment"># Kubernetes 서버의 사용자 ID를 지정합니다.</span>
        externalKafka <span class="token punctuation">{</span>
            brokerHostName <span class="token operator">=</span> <span class="token string">"csle1"</span>  
            <span class="token comment"># 외부 Kafka broker서버 도메인 이름을 지정합니다.</span>
            brokerHostIp <span class="token operator">=</span> <span class="token string">"192.168.0.5"</span>  
            <span class="token comment"># 외부 Kafka broker서버 IP을 지정합니다.</span>
          <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
</pre><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>
        python_path <span class="token operator">=</span> <span class="token string">"/anaconda3/envs/tensorflow/bin/python"</span>
        <span class="token comment"># 사용자 PC의 tensorflow python 위치를 지정합니다.</span>
        python_code_project_path <span class="token operator">=</span> <span class="token string">"/analysis"</span>
    <span class="token punctuation">}</span>
    pyspark <span class="token punctuation">{</span>
        python_path <span class="token operator">=</span> <span class="token string">"/anaconda3/bin/python"</span>
        <span class="token comment"># 사용자 PC의 python 위치를 지정합니다.</span>
        python_code_project_path <span class="token operator">=</span> <span class="token string">"/pyML"</span>
    <span class="token punctuation">}</span>
    spark <span class="token punctuation">{</span>
        home <span class="token operator">=</span> <span class="token string">"/spark"</span>  <span class="token comment"># 사용자 PC의 spark home 위치를 지정합니다.</span>
        bin <span class="token operator">=</span> <span class="token string">"/spark/bin/spark-submit"</span>
        master <span class="token operator">=</span> <span class="token string">"local[*]"</span> <span class="token comment"># spark master 모드를 지정합니다.</span>
        deploy <span class="token operator">=</span> <span class="token string">"client"</span>   <span class="token comment"># spark deploy 모드를 지정합니다.</span>
        logging <span class="token operator">=</span> <span class="token string">"true"</span>    
        autoIncreaseModelPath <span class="token operator">=</span> <span class="token string">"true"</span>
    <span class="token punctuation">}</span>
    yarn <span class="token punctuation">{</span>
        home <span class="token operator">=</span> <span class="token string">"/hadoop/bin"</span> <span class="token comment"># 사용자 PC의 yarn 위치를 지정합니다.</span>
    <span class="token punctuation">}</span>
    postgres <span class="token punctuation">{</span>
        db <span class="token operator">=</span> <span class="token string">"csledb"</span>
        uri <span class="token operator">=</span> <span class="token string">"jdbc:postgresql://localhost:5432/csledb"</span>
        user <span class="token operator">=</span> <span class="token string">"csle"</span>
        password <span class="token operator">=</span> <span class="token string">"csle1234"</span>
    <span class="token punctuation">}</span>
    webtoolkit <span class="token punctuation">{</span>
        db <span class="token operator">=</span> <span class="token string">"ui"</span>
        uri <span class="token operator">=</span> <span class="token string">"jdbc:postgresql://localhost:5432/uidb"</span>
        user <span class="token operator">=</span> <span class="token string">"csle"</span>
        password <span class="token operator">=</span> <span class="token string">"csle1234"</span>
    <span class="token punctuation">}</span>
    hadoop <span class="token punctuation">{</span>
        home <span class="token operator">=</span> <span class="token string">"/hadoop/"</span> <span class="token comment"># 사용자 PC의 hadoop 위치를 지정합니다.</span>
        master <span class="token operator">=</span> <span class="token string">"csle1"</span>  <span class="token comment"># 사용자 PC의 hadoop master 이름을 지정합니다.</span>
        port <span class="token operator">=</span> <span class="token string">"9000"</span>     <span class="token comment"># 사용자 PC의 hadoop master port를 지정합니다.</span>
        hdfs <span class="token punctuation">{</span>
            activated <span class="token operator">=</span> <span class="token string">"true"</span>
            baseDir <span class="token operator">=</span> <span class="token string">"/user/"</span>
            modelPath <span class="token operator">=</span> <span class="token string">"/model"</span>
            datasetPath <span class="token operator">=</span> <span class="token string">"/dataset"</span>
        <span class="token punctuation">}</span>
        webhdfs <span class="token punctuation">{</span>
            port <span class="token operator">=</span> <span class="token string">"50070"</span>
            baseDir <span class="token operator">=</span> <span class="token string">"/webhdfs/v1"</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
    hbase.zookeeper.quorum <span class="token operator">=</span> <span class="token string">"localhost"</span>
    kbe <span class="token punctuation">{</span>
        serverIp <span class="token operator">=</span> <span class="token string">"localhost"</span>
        serverPort <span class="token operator">=</span> <span class="token string">"9876"</span>
        serverType <span class="token operator">=</span> <span class="token string">"jena"</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</pre><h2 class="mume-header" id="host-pc-startservicesh-stopservicesh-%EC%83%9D%EC%84%B1%ED%95%98%EA%B8%B0">[Host PC] <a href="http://startService.sh">startService.sh</a>, <a href="http://stopService.sh">stopService.sh</a> 생성하기</h2>

<p>/home/csle에 <a href="http://startService.sh">startService.sh</a>, <a href="http://stopService.sh">stopService.sh</a> 파일을 생성합니다.</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> ~/startService.sh
<span class="token comment">#!/bin/bash</span>
<span class="token function">sudo</span> <span class="token function">service</span> <span class="token function">ssh</span> restart
<span class="token function">sudo</span> <span class="token function">service</span> postgresql restart

<span class="token function">bash</span> /home/csle/zookeeper-3.4.9/bin/zkServer.sh start
<span class="token function">ssh</span> csle@master -p 2243 <span class="token string">"cd /home/csle/zookeeper-3.4.9/bin; \
./zkServer.sh start"</span>
<span class="token function">ssh</span> csle@csle1  -p 2243 <span class="token string">"cd /home/csle/zookeeper-3.4.9/bin; \
./zkServer.sh start"</span>
start-dfs.sh
start-yarn.sh
start-hbase.sh
/home/csle/kafka/bin/kafka-server-start.sh \
/home/csle/kafka/config/server.properties <span class="token operator">&amp;</span>
/home/csle/ui_of_csle/apache-tomcat-7.0.81/bin/catalina.sh start <span class="token operator">&amp;</span>
/home/csle/start-mongo.sh <span class="token operator">&amp;</span>
<span class="token function">sleep</span> 5
<span class="token function">cd</span> /home/csle/ksb-csle/bin
/home/csle/ksb-csle/bin/startKnowledge_service.sh localhost 9876
EOT
<span class="token function">chmod</span> +x /home/csle/startService.sh
<span class="token function">cat</span> <span class="token operator">&lt;&lt;</span>EOT <span class="token operator">>></span> ~/stopService.sh
<span class="token comment">#!/bin/bash</span>
stop-hbase.sh
<span class="token function">bash</span> /home/csle/kafka/bin/kafka-server-stop.sh
stop-yarn.sh
stop-dfs.sh
<span class="token function">bash</span> /home/csle/zookeeper-3.4.9/bin/zkServer.sh stop
/home/csle/ui_of_csle/apache-tomcat-7.0.81/bin/catalina.sh stop
/home/csle/stop-mongo.sh
<span class="token function">cd</span> /home/csle/ksb-csle/bin
/home/csle/ksb-csle/bin/stopKnowledge_service.sh
<span class="token function">sudo</span> <span class="token function">service</span> postgresql stop
EOT
<span class="token function">chmod</span> +x /home/csle/stopService.sh
</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><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-hadoop-hdfs-%EC%82%AC%EC%9A%A9%EC%9E%90-%EA%B3%84%EC%A0%95-%EC%B6%94%EA%B0%80%ED%95%98%EA%B8%B0">[Host PC] Hadoop Hdfs 사용자 계정 추가하기</h2>

<p>사용자 환경에 맞게 설치되어 있는 Hadoop Hdfs를 가동한 후, 아래 명령을 이용하여 hdfs에 ksbuser_etri_re_kr 사용자 폴더를 추가합니다.<br>
만약 Hadoop 2.7.3 설치하기에서 도커 컨테이너로부터 /home/csle/data 폴더를 복사한 경우, 이미 사용자 폴더가 생성된 hdfs을 복사한 상태이므로 이 절차를 생략합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token function">su</span> - csle
hdfs dfs -mkdir -p /user/ksbuser_etri_re_kr/dataset
hdfs dfs -mkdir -p /user/ksbuser_etri_re_kr/model

hdfs dfs -chown ksbuser_etri_re_kr:supergroup  /user/ksbuser_etri_re_kr/
hdfs dfs -chown ksbuser_etri_re_kr:supergroup \
/user/ksbuser_etri_re_kr/dataset
hdfs dfs -chown ksbuser_etri_re_kr:supergroup \
/user/ksbuser_etri_re_kr/model
</pre><h2 class="mume-header" id="host-pc-ksb-%EC%A7%80%EC%8B%9D%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EC%97%94%EC%A7%84-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] KSB 지식베이스 엔진 설치하기</h2>

<p>KSB 지식베이스엔진(KSB-Knowledge Engine)을 사용하기 위한 절차 및 예제를 소개합니다.</p>
<h3 class="mume-header" id="%EC%A7%80%EC%8B%9D%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EC%97%94%EC%A7%84-%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0">지식베이스 엔진 가져오기</h3>

<p>KSB 지식베이스엔진은 현재 Docker 컨테이너에 포함되어 배포 되고 있습니다.</p>
<p>도커에 접속하는 방법을 참고하여 접속합니다. (<a href="http://csleoss.etri.re.kr:8088/images/contents/manual_1.0/Filezilla.html"> Filezilla를 이용하여 KSB 툴박스 docker 컨테이너에 접속하기 </a>)<br>
도커에 있는 ksb-knowledge 폴더를 Host PC의 /home/csle 폴더에 복사합니다.</p>
<h3 class="mume-header" id="play-framework-activator-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">Play framework Activator 설치하기</h3>

<p>KSB 지식베이스 엔진은 Play framework 기반 엔진이며, 이를 실행하기 위해서는 <a href="https://downloads.typesafe.com/typesafe-activator/1.3.12/typesafe-activator-1.3.12.zip" title="Play framework Activator">Play framework Activator</a>를 사전에 설치해야 합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token comment"># Play framework Activator 다운로드</span>
<span class="token function">wget</span> https://downloads.typesafe.com/typesafe-activator/1.3.12/\
typesafe-activator-1.3.12.zip

<span class="token comment"># 압축해제</span>
unzip typesafe-activator-1.3.12.zip

<span class="token comment"># Activator bin 경로를 환경변수에 등록</span>
<span class="token function">export</span> PATH<span class="token operator">=</span><span class="token string">"/home/csle/activator-dist-1.3.12/bin:<span class="token variable">$PATH</span>"</span>
</pre><h3 class="mume-header" id="ksb-%EC%A7%80%EC%8B%9D%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EC%97%94%EC%A7%84-%EC%8B%9C%EC%9E%91-%EB%B0%8F-%EC%A2%85%EB%A3%8C-%ED%95%98%EA%B8%B0">KSB 지식베이스 엔진 시작 및 종료 하기</h3>

<p>KSB 지식베이스 엔진을 시작하려면, 해당폴더 (/home/csle/ksb-csle/bin)로 이동하여, startknowledge_service.sh 스크립트를 ip address와 port 번호와 함께 실행합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token comment"># KSB 지식베이스 실행 스크립트가 있는 경로로 이동</span>
<span class="token function">cd</span> /home/csle/ksb-csle/bin
<span class="token comment"># KSB 지식베이스 엔진 시작</span>
<span class="token comment">#(./startknowledge_service.sh ip_address port_number)</span>
./startknowledge_service.sh 127.0.0.1 9876
</pre><p>KSB 지식베이스 엔진을 종료하려면, 해당폴더 (/home/csle/ksb-csle/bin)로 이동하여, stopKnowledge_service.sh 스크립트를 실행합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token comment"># KSB 지식베이스 엔진 종료</span>
./stopKnowledge_service.sh
</pre><h3 class="mume-header" id="%EC%98%A8%ED%86%A8%EB%A1%9C%EC%A7%80-%ED%8C%8C%EC%9D%BC-upload-%ED%95%98%EA%B8%B0">온톨로지 파일 Upload 하기</h3>

<p>KSB 지식베이스 엔진이 Start 되어 있는 상황에서, 사용자가 로컬 파일에 작성된 온톨로지 파일(.owl, .rdf, .rdfs)을 KSB 지식베이스 엔진에 Upload 하는 기능을 설명합니다. 본 예제에서는 KSB 지식베이스 엔진 내부 폴더에 제공하는 공통 온톨로지 파일을 이용합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token comment"># 예제 수행 온톨로지 확인을 위해 해당 경로로 이동</span>
<span class="token function">cd</span> /home/csle/ksb-knowledge/KBE/ontologies
</pre><p><img src="./images/1.3_HowToInstallKsbFrameWork_02.png" alt="KSB &#xACF5;&#xD1B5; &#xC628;&#xD1A8;&#xB85C;&#xC9C0;" title="KSB &#xACF5;&#xD1B5; &#xC628;&#xD1A8;&#xB85C;&#xC9C0;"></p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token comment"># Curl 명령어 restful request 수행 (url: /loadOntologies, parameter: 온톨로지 경로)</span>
<span class="token function">curl</span> -X POST http://127.0.0.1:9876/loadOntologies -H <span class="token string">'Cache-Control: \
no-cache'</span> -H <span class="token string">'Content-Type: text/plain'</span> -d ./ontologies
</pre><p><img src="./images/1.3_HowToInstallKsbFrameWork_03.png" alt="KSB &#xC9C0;&#xC2DD;&#xBCA0;&#xC774;&#xC2A4; &#xC5D4;&#xC9C4; &#xC628;&#xD1A8;&#xB85C;&#xC9C0; upload &#xD654;&#xBA74;" title="KSB &#xC9C0;&#xC2DD;&#xBCA0;&#xC774;&#xC2A4; &#xC5D4;&#xC9C4; &#xC628;&#xD1A8;&#xB85C;&#xC9C0; upload &#xD654;&#xBA74;"></p>
<p>KSB 지식베이스 엔진에 Upload된 온톨로지는 KSB 지식베이스 엔진이 제공하는  쿼리 Restful API(<code>http://127.0.0.1:9876/query</code>)를 통해 확인할 수 있습니다. 이를 위해 Restful Client(본 예제에서는 Postman)를 실행하고, URL과 질의 쿼리 내용을 아래와 같이 입력하여 실행합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token comment"># 본 쿼리는 SPAQRL 1.1의 형태의 질의이며,</span>
<span class="token comment"># 이는 온톨로지 thing:Thing 클래스의 서브 클래스를 검색하기 위한 쿼리입니다.</span>
PREFIX  rdfs: <span class="token operator">&lt;</span>http://www.w3.org/2000/01/rdf-schema<span class="token comment">#></span>
PREFIX  owl:  <span class="token operator">&lt;</span>http://www.w3.org/2002/07/owl<span class="token comment">#></span>
PREFIX  workflow: <span class="token operator">&lt;</span>http://csle.etri.re.kr/Workflow/<span class="token operator">></span>
PREFIX  thing: <span class="token operator">&lt;</span>http://csle.etri.re.kr/Thing/<span class="token operator">></span>
<span class="token keyword">select</span> * where <span class="token punctuation">{</span>
  ?s  rdfs:subClassOf thing:Thing.
  FILTER <span class="token punctuation">(</span><span class="token operator">!</span>isBlank<span class="token punctuation">(</span>?s<span class="token punctuation">))</span>
<span class="token punctuation">}</span>
</pre><p><img src="./images/1.3_HowToInstallKsbFrameWork_04.png" alt="&#xC628;&#xD1A8;&#xB85C;&#xC9C0; Upload &#xACB0;&#xACFC; &#xD655;&#xC778; &#xD654;&#xBA74;" title="&#xC628;&#xD1A8;&#xB85C;&#xC9C0; Upload &#xACB0;&#xACFC; &#xD559;&#xC778; &#xD654;&#xBA74;"></p>
<h2 class="mume-header" id="ioe-%EC%82%AC%EB%AC%BC-%EB%93%B1%EB%A1%9D">IoE 사물 등록</h2>

<p>KSB 지식베이스 엔진은 IoE 정보를 지식화하여 정보의 연계, 추론을 통한 지식정보를 사용자에게 제공하는 기능이 있습니다. IoE 표준(oneM2M)의 사물 스펙을 지식화하는 기능을 제공합니다.</p>
<p>본 예제에서는 Json 포맷의 사물 스펙을 사용합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token comment"># Json 포맷의 사물 스펙(예제로 사용한 IoE 사물의 id는 a1234이며,</span>
<span class="token comment"># indoor temperature and humidity 센서입니다.)</span>
<span class="token punctuation">{</span>
      <span class="token string">"version"</span><span class="token keyword">:</span> <span class="token string">"1.0"</span>,
      <span class="token string">"id"</span><span class="token keyword">:</span> <span class="token string">"a1234"</span>,
      <span class="token string">"registrationTime"</span><span class="token keyword">:</span> <span class="token string">"20170102112233"</span>,
      <span class="token string">"properties"</span><span class="token keyword">:</span> <span class="token punctuation">{</span>
        <span class="token string">"name"</span><span class="token keyword">:</span> <span class="token string">"indoor_env_1"</span>,
        <span class="token string">"owner"</span><span class="token keyword">:</span> <span class="token string">"foo@gmail.com"</span>,
        <span class="token string">"description"</span><span class="token keyword">:</span> <span class="token string">"indoor temperature and humidity"</span>,
        <span class="token string">"gid"</span><span class="token keyword">:</span> <span class="token string">"global_unique_id_1"</span>,
        <span class="token string">"model"</span><span class="token keyword">:</span> <span class="token string">"modelA"</span>,
        <span class="token string">"coordinates"</span><span class="token keyword">:</span> <span class="token punctuation">{</span>
          <span class="token string">"latitude"</span><span class="token keyword">:</span> 33.3,
          <span class="token string">"longitude"</span><span class="token keyword">:</span> 122.2,
          <span class="token string">"altitude"</span><span class="token keyword">:</span> 0
        <span class="token punctuation">}</span>,
        <span class="token string">"location"</span><span class="token keyword">:</span> <span class="token string">"seoul korea"</span>,
        <span class="token string">"users"</span><span class="token keyword">:</span> <span class="token punctuation">[</span><span class="token string">"bar@gmail.com"</span><span class="token punctuation">]</span>,
        <span class="token string">"tag"</span><span class="token keyword">:</span> <span class="token punctuation">[</span><span class="token string">"my room"</span>, <span class="token string">"temperature"</span>, <span class="token string">"humidity"</span><span class="token punctuation">]</span>,
        <span class="token string">"madeBy"</span><span class="token keyword">:</span> <span class="token string">"companyA"</span>,
        <span class="token string">"hostedBy"</span><span class="token keyword">:</span> <span class="token string">"companyB"</span>
      <span class="token punctuation">}</span>,
      <span class="token string">"resources"</span><span class="token keyword">:</span> <span class="token punctuation">[</span>
        <span class="token punctuation">{</span>
          <span class="token string">"name"</span><span class="token keyword">:</span> <span class="token string">"sensors"</span>,
          <span class="token string">"description"</span><span class="token keyword">:</span> <span class="token string">"temperature and humidity in my room"</span>,
          <span class="token string">"attributes"</span><span class="token keyword">:</span> <span class="token punctuation">[</span>
            <span class="token punctuation">{</span>
              <span class="token string">"name"</span><span class="token keyword">:</span> <span class="token string">"temperature"</span>,
              <span class="token string">"dataType"</span><span class="token keyword">:</span> <span class="token string">"double"</span>,
              <span class="token string">"unit"</span><span class="token keyword">:</span> <span class="token string">"celsius"</span>,
              <span class="token string">"min"</span><span class="token keyword">:</span> <span class="token string">"-80"</span>,
              <span class="token string">"max"</span><span class="token keyword">:</span> <span class="token string">"80"</span>,
              <span class="token string">"description"</span><span class="token keyword">:</span> <span class="token string">"temperature in my room"</span>
            <span class="token punctuation">}</span>,
            <span class="token punctuation">{</span>
              <span class="token string">"name"</span><span class="token keyword">:</span> <span class="token string">"humidity"</span>,
              <span class="token string">"dataType"</span><span class="token keyword">:</span> <span class="token string">"double"</span>,
              <span class="token string">"unit"</span><span class="token keyword">:</span> <span class="token string">"percent"</span>,
              <span class="token string">"min"</span><span class="token keyword">:</span> <span class="token string">"0"</span>,
              <span class="token string">"max"</span><span class="token keyword">:</span> <span class="token string">"100"</span>,
              <span class="token string">"description"</span><span class="token keyword">:</span> <span class="token string">"humidity in my room"</span>
            <span class="token punctuation">}</span>
          <span class="token punctuation">]</span>,
          <span class="token string">"operations"</span><span class="token keyword">:</span> <span class="token punctuation">[</span>
            <span class="token punctuation">{</span>
              <span class="token string">"opType"</span><span class="token keyword">:</span> <span class="token string">"get"</span>,
              <span class="token string">"args"</span><span class="token keyword">:</span> <span class="token punctuation">[</span><span class="token string">"temperature"</span>, <span class="token string">"humidity"</span><span class="token punctuation">]</span>,
              <span class="token string">"description"</span><span class="token keyword">:</span> <span class="token string">"get current temperature and humidity"</span>
            <span class="token punctuation">}</span>
          <span class="token punctuation">]</span>
        <span class="token punctuation">}</span>
      <span class="token punctuation">]</span>
    <span class="token punctuation">}</span>
</pre><p>KSB 지식베이스 엔진이 제공하는  사물등록  Restful API (<code>http://127.0.0.1:9876/registThing</code>)를 통해 KSB 지식베이스 엔진에 사물 스펙정보를 등록 할 수 있습니다.</p>
<p><img src="./images/1.3_HowToInstallKsbFrameWork_05.png" alt="&#xC0AC;&#xBB3C;&#xB4F1;&#xB85D; &#xD654;&#xBA74;" title="&#xC0AC;&#xBB3C;&#xB4F1;&#xB85D; &#xD654;&#xBA74;"></p>
<p>다음과 같은 쿼리 Restful API을 수행하여 결과를 확인합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token comment"># 본 쿼리는 SPAQRL 1.1의 형태의 질의이며,</span>
<span class="token comment"># 이는 온톨로지 thing:Thing 클래스의 인스턴스를 검색하기 위한 쿼리입니다.</span>
PREFIX  rdf:  <span class="token operator">&lt;</span>http://www.w3.org/1999/02/22-rdf-syntax-ns<span class="token comment">#></span>
PREFIX  owl:  <span class="token operator">&lt;</span>http://www.w3.org/2002/07/owl<span class="token comment">#></span>
PREFIX  workflow: <span class="token operator">&lt;</span>http://csle.etri.re.kr/Workflow/<span class="token operator">></span>
PREFIX  thing: <span class="token operator">&lt;</span>http://csle.etri.re.kr/Thing/<span class="token operator">></span>
<span class="token keyword">select</span> * where <span class="token punctuation">{</span>
  ?s rdf:type thing:Thing.
<span class="token punctuation">}</span>
</pre><p><img src="./images/1.3_HowToInstallKsbFrameWork_06.png" alt="&#xC0AC;&#xBB3C;&#xB4F1;&#xB85D;&#xD655;&#xC778;&#xD654;&#xBA74;" title="&#xC0AC;&#xBB3C;&#xB4F1;&#xB85D;&#xD655;&#xC778;&#xD654;&#xBA74;"></p>
<h2 class="mume-header" id="ioe-%EC%82%AC%EB%AC%BC-%EC%84%BC%EC%84%9C%EB%8D%B0%EC%9D%B4%ED%84%B0%EB%A5%BC-%ED%86%B5%ED%95%B4-%EC%A7%80%EC%8B%9D%EC%B6%94%EB%A1%A0%ED%95%98%EA%B8%B0">IoE 사물 센서데이터를 통해 지식추론하기</h2>

<p>KSB 지식베이스 엔진은 IoE 디바이스의 센서데이터를 이용하여, 상황을 추론할 수 있는 기능을 제공합니다.<br>
본 예제의 시나리오는 앞에서 등록된 온도센서(thing id : a1234)로부터 온도가 28도 이상이면 더운 상황(HotContext)을 추론하고,<br>
추론된 정보를 통해 Hue(thing id : S_HUE_light_3)를 파란색으로 켜는 동작을 하는 간단한 시나리오 입니다.</p>
<p>이를 위해 Hue의 제어 명령을 등록합니다. (Restful API: <code>http://127.0.0.1:9876/addDeviceControl</code>)</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token comment"># Json 포맷의 사물제어 스펙(id S_HUE_light_3의 Hue)</span>
<span class="token punctuation">[</span>
   <span class="token punctuation">{</span><span class="token string">"id"</span><span class="token keyword">:</span><span class="token string">"hue_turnon_Blue"</span>,
     <span class="token string">"thingId"</span><span class="token keyword">:</span><span class="token string">"S_HUE_light_3"</span>,
     <span class="token string">"resourceId"</span><span class="token keyword">:</span><span class="token string">"controller"</span>,
     <span class="token string">"operationId"</span><span class="token keyword">:</span><span class="token string">"setState"</span>,
     <span class="token string">"controlContents"</span>:<span class="token punctuation">[</span>
        <span class="token punctuation">{</span><span class="token string">"name"</span><span class="token keyword">:</span><span class="token string">"on"</span>,<span class="token string">"value"</span><span class="token keyword">:</span><span class="token string">"true"</span><span class="token punctuation">}</span>,
        <span class="token punctuation">{</span><span class="token string">"name"</span><span class="token keyword">:</span><span class="token string">"bri"</span>,<span class="token string">"value"</span><span class="token keyword">:</span><span class="token string">"254"</span><span class="token punctuation">}</span>,
        <span class="token punctuation">{</span><span class="token string">"name"</span><span class="token keyword">:</span><span class="token string">"hue"</span>,<span class="token string">"value"</span><span class="token keyword">:</span><span class="token string">"46920"</span><span class="token punctuation">}</span>,
        <span class="token punctuation">{</span><span class="token string">"name"</span><span class="token keyword">:</span><span class="token string">"sat"</span>,<span class="token string">"value"</span><span class="token keyword">:</span><span class="token string">"254"</span><span class="token punctuation">}</span>
       <span class="token punctuation">]</span>
   <span class="token punctuation">}</span>,
  <span class="token punctuation">{</span><span class="token string">"id"</span><span class="token keyword">:</span><span class="token string">"hue_turnon_Red"</span>,
   <span class="token string">"thingId"</span><span class="token keyword">:</span><span class="token string">"S_HUE_light_3"</span>,
   <span class="token string">"resourceId"</span><span class="token keyword">:</span><span class="token string">"controller"</span>,
   <span class="token string">"operationId"</span><span class="token keyword">:</span><span class="token string">"setState"</span>,
   <span class="token string">"controlContents"</span>:<span class="token punctuation">[</span>
      <span class="token punctuation">{</span><span class="token string">"name"</span><span class="token keyword">:</span><span class="token string">"on"</span>,<span class="token string">"value"</span><span class="token keyword">:</span><span class="token string">"true"</span><span class="token punctuation">}</span>,
      <span class="token punctuation">{</span><span class="token string">"name"</span><span class="token keyword">:</span><span class="token string">"bri"</span>,<span class="token string">"value"</span><span class="token keyword">:</span><span class="token string">"254"</span><span class="token punctuation">}</span>,
      <span class="token punctuation">{</span><span class="token string">"name"</span><span class="token keyword">:</span><span class="token string">"hue"</span>,<span class="token string">"value"</span><span class="token keyword">:</span><span class="token string">"65535"</span><span class="token punctuation">}</span>,
      <span class="token punctuation">{</span><span class="token string">"name"</span><span class="token keyword">:</span><span class="token string">"sat"</span>,<span class="token string">"value"</span><span class="token keyword">:</span><span class="token string">"254"</span><span class="token punctuation">}</span>
      <span class="token punctuation">]</span>
  <span class="token punctuation">}</span>,
  <span class="token punctuation">{</span><span class="token string">"id"</span><span class="token keyword">:</span><span class="token string">"hue_turnon_Green"</span>,
    <span class="token string">"thingId"</span><span class="token keyword">:</span><span class="token string">"S_HUE_light_3"</span>,
    <span class="token string">"resourceId"</span><span class="token keyword">:</span><span class="token string">"controller"</span>,
    <span class="token string">"operationId"</span><span class="token keyword">:</span><span class="token string">"setState"</span>,
    <span class="token string">"controlContents"</span>:<span class="token punctuation">[</span>
       <span class="token punctuation">{</span><span class="token string">"name"</span><span class="token keyword">:</span><span class="token string">"on"</span>,<span class="token string">"value"</span><span class="token keyword">:</span><span class="token string">"true"</span><span class="token punctuation">}</span>,
       <span class="token punctuation">{</span><span class="token string">"name"</span><span class="token keyword">:</span><span class="token string">"bri"</span>,<span class="token string">"value"</span><span class="token keyword">:</span><span class="token string">"254"</span><span class="token punctuation">}</span>,
       <span class="token punctuation">{</span><span class="token string">"name"</span><span class="token keyword">:</span><span class="token string">"hue"</span>,<span class="token string">"value"</span><span class="token keyword">:</span><span class="token string">"25500"</span><span class="token punctuation">}</span>,
       <span class="token punctuation">{</span><span class="token string">"name"</span><span class="token keyword">:</span><span class="token string">"sat"</span>,<span class="token string">"value"</span><span class="token keyword">:</span><span class="token string">"254"</span><span class="token punctuation">}</span>
      <span class="token punctuation">]</span>
   <span class="token punctuation">}</span>
<span class="token punctuation">]</span>
</pre><p>추론 규칙을 적용하기 위해, KSB-Knowledge/KBE/rules 폴더의 &quot;KBE.rues&quot; 파일을 열고 아래와 같이 추론 규칙을 추가합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token comment"># 온도센서의 센싱값이 28이상이면 이벤트 Temp_HOT을 생성합니다.</span>
<span class="token punctuation">[</span>domain_temperature_hot:
 	<span class="token punctuation">(</span>?e event:hasEventValue ?v<span class="token punctuation">)</span>,
 	<span class="token punctuation">(</span>?v thing:hasType ?t<span class="token punctuation">)</span>,
 	<span class="token punctuation">(</span>?t thing:attributeName ?name<span class="token punctuation">)</span>,
 	equal<span class="token punctuation">(</span>?name, <span class="token string">"temperature"</span><span class="token punctuation">)</span>,
 	<span class="token punctuation">(</span>?v thing:hasValue ?value<span class="token punctuation">)</span>,
 	ge<span class="token punctuation">(</span>?value, 28<span class="token punctuation">)</span>
     -<span class="token operator">></span>
    <span class="token punctuation">(</span>?e event:hasEventStatus domain:Temp_HOT<span class="token punctuation">)</span>
 <span class="token punctuation">]</span>
 <span class="token comment"># 이벤트 Temp_HOT이면 더운 상황(HotContext)을 생성합니다.</span>
 <span class="token punctuation">[</span>HotContext_context:
    <span class="token punctuation">(</span>?e event:hasEventStatus domain:Temp_HOT<span class="token punctuation">)</span>
    -<span class="token operator">></span> <span class="token punctuation">(</span>?e rdf:type domain:HotContext<span class="token punctuation">)</span>
 <span class="token punctuation">]</span>
 <span class="token comment"># 더운 상황(HotContext)이면 Hue를 파란색으로 켭니다.</span>
 <span class="token punctuation">[</span>HotContext_service:
   	<span class="token punctuation">(</span>?e rdf:type domain:HotContext<span class="token punctuation">)</span>
     -<span class="token operator">></span>
    <span class="token punctuation">(</span>?e service:derives domain:hue_turnon_Blue<span class="token punctuation">)</span>
 <span class="token punctuation">]</span>
</pre><p>본 예제를 실행하기 위해 온도센서(thing id: a1234)의 값을 32.6으로 설정하고, Restful API(<code>http://127.0.0.1:9876/recommendDeviceControl</code>)를 실행합니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token comment"># 온도센서(thingId : a1234)의 센싱값이 32.6으로 설정합니다.</span>
<span class="token punctuation">{</span>
      <span class="token string">"thingId"</span><span class="token keyword">:</span> <span class="token string">"a1234"</span>,
      <span class="token string">"resourceId"</span><span class="token keyword">:</span> <span class="token string">"sensors"</span>,
      <span class="token string">"time"</span><span class="token keyword">:</span> <span class="token string">"20170330103347"</span>,
      <span class="token string">"values"</span><span class="token keyword">:</span> <span class="token punctuation">[</span>
         <span class="token punctuation">{</span>
            <span class="token string">"name"</span><span class="token keyword">:</span> <span class="token string">"temperature"</span>,
            <span class="token string">"value"</span><span class="token keyword">:</span> <span class="token string">"32.6"</span>
         <span class="token punctuation">}</span>
       <span class="token punctuation">]</span>
    <span class="token punctuation">}</span>
</pre><p>Restful API를 실행한 결과는 다음과 같습니다.</p>
<pre data-role="codeBlock" data-info="sh" class="language-bash"><span class="token comment"># 상황(context)가 "HotContext"이고, 상황에 따른 서비스(service)가</span>
<span class="token comment"># "hue_turnon_Blue"이며 그것에 해당하는 사물 제어정보를 리턴합니다.</span>
<span class="token punctuation">[</span>
    <span class="token punctuation">{</span>
        <span class="token string">"thingId"</span><span class="token keyword">:</span> <span class="token string">"S_HUE_light_3"</span>,
        <span class="token string">"resourceId"</span><span class="token keyword">:</span> <span class="token string">"controller"</span>,
        <span class="token string">"context"</span><span class="token keyword">:</span> <span class="token punctuation">[</span>
            <span class="token string">"HotContext"</span>
        <span class="token punctuation">]</span>,
        <span class="token string">"service"</span><span class="token keyword">:</span> <span class="token string">"hue_turnon_Blue"</span>,
        <span class="token string">"controls"</span><span class="token keyword">:</span> <span class="token punctuation">{</span>
            <span class="token string">"sat"</span><span class="token keyword">:</span> <span class="token string">"254"</span>,
            <span class="token string">"hue"</span><span class="token keyword">:</span> <span class="token string">"46920"</span>,
            <span class="token string">"bri"</span><span class="token keyword">:</span> <span class="token string">"254"</span>,
            <span class="token string">"on"</span><span class="token keyword">:</span> <span class="token string">"true"</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">]</span>
</pre><p><img src="./images/1.3_HowToInstallKsbFrameWork_07.png" alt="&#xC0AC;&#xBB3C;&#xCD94;&#xB860; &#xD655;&#xC778;&#xD654;&#xBA74;" title="&#xC0AC;&#xBB3C;&#xCD94;&#xB860; &#xD655;&#xC778;&#xD654;&#xBA74;"></p>

      </div>
      <div class="md-sidebar-toc"><ul>
<li><a href="#ksb-%EC%9D%B8%EA%B3%B5%EC%A7%80%EB%8A%A5-%ED%94%84%EB%A0%88%EC%9E%84%EC%9B%8C%ED%81%AC-%EC%84%A4%EC%B9%98">KSB 인공지능 프레임워크 설치</a>
<ul>
<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-etchosts-%EC%88%98%EC%A0%95%ED%95%98%EA%B8%B0">[Host PC] /etc/hosts 수정하기</a></li>
<li><a href="#host-pc-java-8-oracle-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] java-8-oracle 설치하기</a></li>
<li><a href="#host-pc-ksb-%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-hadoop-273-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] Hadoop 2.7.3 설치하기</a></li>
<li><a href="#host-pc-spark-230-bin-hadoop27-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] spark-2.3.0-bin-hadoop2.7 설치하기</a></li>
<li><a href="#host-pc-hbase-124optional-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] hbase 1.2.4(optional) 설치하기</a></li>
<li><a href="#host-pc-kafka-211-01001optional-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] kafka 2.11-0.10.0.1(optional) 설치하기</a></li>
<li><a href="#host-pc-zookeeper-349optional-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] zookeeper 3.4.9(optional) 설치하기</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-anaconda3-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] Anaconda3 설치하기</a>
<ul>
<li><a href="#host-pc-%EA%B8%B0%ED%83%80-%EB%9D%BC%EC%9D%B4%EB%B8%8C%EB%9F%AC%EB%A6%AC-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] 기타 라이브러리 설치하기</a></li>
</ul>
</li>
<li><a href="#host-pc-tensorflow-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-cpu%EB%B2%84%EC%A0%84">[Host PC] tensorflow 설치하기 (cpu버전)</a></li>
<li><a href="#host-pc-ksb-%ED%88%B4%EB%B0%95%EC%8A%A4-%ED%8C%8C%EC%9D%BC-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] KSB 툴박스 파일 설치하기</a></li>
<li><a href="#host-pc-ksb-csle-config-%ED%8C%8C%EC%9D%BC-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0">[Host PC] ksb-csle config 파일 설정하기</a></li>
<li><a href="#host-pc-startservicesh-stopservicesh-%EC%83%9D%EC%84%B1%ED%95%98%EA%B8%B0">[Host PC] startService.sh, stopService.sh 생성하기</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-hadoop-hdfs-%EC%82%AC%EC%9A%A9%EC%9E%90-%EA%B3%84%EC%A0%95-%EC%B6%94%EA%B0%80%ED%95%98%EA%B8%B0">[Host PC] Hadoop Hdfs 사용자 계정 추가하기</a></li>
<li><a href="#host-pc-ksb-%EC%A7%80%EC%8B%9D%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EC%97%94%EC%A7%84-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">[Host PC] KSB 지식베이스 엔진 설치하기</a>
<ul>
<li><a href="#%EC%A7%80%EC%8B%9D%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EC%97%94%EC%A7%84-%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0">지식베이스 엔진 가져오기</a></li>
<li><a href="#play-framework-activator-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0">Play framework Activator 설치하기</a></li>
<li><a href="#ksb-%EC%A7%80%EC%8B%9D%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EC%97%94%EC%A7%84-%EC%8B%9C%EC%9E%91-%EB%B0%8F-%EC%A2%85%EB%A3%8C-%ED%95%98%EA%B8%B0">KSB 지식베이스 엔진 시작 및 종료 하기</a></li>
<li><a href="#%EC%98%A8%ED%86%A8%EB%A1%9C%EC%A7%80-%ED%8C%8C%EC%9D%BC-upload-%ED%95%98%EA%B8%B0">온톨로지 파일 Upload 하기</a></li>
</ul>
</li>
<li><a href="#ioe-%EC%82%AC%EB%AC%BC-%EB%93%B1%EB%A1%9D">IoE 사물 등록</a></li>
<li><a href="#ioe-%EC%82%AC%EB%AC%BC-%EC%84%BC%EC%84%9C%EB%8D%B0%EC%9D%B4%ED%84%B0%EB%A5%BC-%ED%86%B5%ED%95%B4-%EC%A7%80%EC%8B%9D%EC%B6%94%EB%A1%A0%ED%95%98%EA%B8%B0">IoE 사물 센서데이터를 통해 지식추론하기</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>