Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column

CLI는 명령 창 모드에서 MCCS 서비스에 명령을 전달 할 수 있는 기능을 말합니다.

MCCS 가 제공하는 CLI 종류로는 로그에 임의의 로그를 추가 할 수 있는 mclog, 그룹에 명령을 내릴 수 있는 mcgroup, 리소스에 명령을 내릴 수 있는 mcres가 있습니다.

일반적으로 CLI는 스크립트MCCS CLI is a function that provides the command from command prompt of Window OS to MCCS service.
Types of CLI that MCCS provides are mclog.exe (add logs arbitrarily in MCCS log), mrgroup.exe (send command to MCCS group) and mcres.exe (send commands to MCCS resources).
In general, CLI is used to write script(*.bat, *.cmd) 파일을 작성하여 다양한 명령을 MCCS 서비스에 전달하는 용도로 사용합니다. CLI는 file and send commands to MCCS service.
MCCS CLI exists in '%MCCS_HOME%\bin에 존재합니다bin' directory. 

 

Column
width350px
Panel

이 페이지의 주요 내용Table of Contents

Table of Contents
maxLevel4

Info

MCCS 는 설치시 최초 사용자 계정으로 id 가 When you install MCCS, the initial user account ID is set to 'admin' 암호가 and the password is set to 'password'인 계정을 생성합니다.
CLI 명령을 실행시 id 와 password를 입력하지 않으면 , 위의 최초 사용자 계정의 id와 암호로 실행됩니다.
따라서 최초 사용자의 패스워드 변경시, 필수적으로 CLI 명령에 id와 password를 옵션으로 입력해야만 합니다.

CLI를 이용한 script (CLI 활용 예)

...

When you run the CLI command, you need to enter the ID and the password. Otherwise, the above initial ID and password will be used.
Thus, when you change the initial user password, you must enter the ID/password in the CLI command as options.

Examples of Batch script with MCCS CLI

Create CLITestGroup

Code Block
titleCreate CLITestGroup 생성
@echo on 
@echo ### CLITestGroupCreate 그룹이a 없다면new 신규 그룹을 생성합니다. 
group
set mclog="%MCCS_HOME%\bin\mclog.exe" 
set mcgroup="%MCCS_HOME%\bin\mcgroup.exe" 
%mclog% -n 192.168.100.2 -p 4321 -s CLITestGroup -l INFO -m "Start CLI 테스트Test 코드를 실행합니다Code." 

%mcgroup% -state CLITestGroup 
if not errorlevel 1 goto end 

@echo ### CLITestGroup을Create 생성합니다CLITestGroup. 
%mclog% -n 192.168.100.2 -p 4321 -s CLITestGroup -l INFO -m "CLITestGroup이 존재 하지 않아 그룹을 생성합니다Creat new group since CLITestGroup does not exist." 
%mcgroup% -u admin -pw password -add CLITestGroup 
%mcgroup% -u admin -pw password -modify CLITestGroup -a TargetNodeList Beta,Alpha 
%mclog% -n 192.168.100.2 -p 4321 -s CLITestGroup -l INFO -m "CLITestGroup을 생성했습니다.CLITestGroup is created"  

:end
%mclog% -n 192.168.100.2 -p 4321 -s CLITestGroup -l INFO -m "Terminates CLI 테스트Test 코드를 종료합니다Node."

...

Create and Online CLITestProcess in group CLITestGroup

Code Block
title그룹 CTITestGroup에 CLITestProcess 생성 및 온라인Create and Online CLITestProcess in group CLITestGroup
@echo on 
@echo ### CLITestProcess를Starts 시작합니다CLITestProcess. 
set mclog="%MCCS_HOME%\bin\mclog.exe" 
set mcres="%MCCS_HOME%\bin\mcres.exe" 

%mclog% -n 192.168.100.2 -p 4321 -s CLITestProcess -l INFO -m "Starts CLI 테스트Test 코드를 실행합니다Code." 

@echo ### CLITestProcess가Test 있는지if 검사합니다.CLITestProcess exist
%mcres% -u admin -pw password -list CLITestProcess 
if not errorlevel 3 goto end 

:cliTestProcessCreat 
@echo ### CLITestProcess  리소스를After creating 생성한a 후에resource, 활성화enable 시킵니다it. 
%mclog% -n 192.168.100.2 -p 4321 -s CLITestProcess -l INFO -m "Create and cause CLITestProcess 리소스를resource 생성하고go 온라인 시킵니다online." 

%mcres% -u admin -pw password -add CLITestProcess -t Process -g CLITestGroup 
%mcres% -u admin -pw password -modify CLITestProcess -a Path c:\wordpad01.exe 
%mcres% -u admin -pw password -modify CLITestProcess -a InteractWithDesktop true 
%mcres% -u admin -pw password -enable CLITestProcess 
%mcres% -u admin -pw password -online CLITestProcess -n Beta 

:end 
@echo ### 그룹Monitors 상태를group 모니터링 합니다state. 
%mclog% -n 192.168.100.2 -p 4321 -s CLITestGroup -l INFO -m "Terminates CLI 테스트Test 코드를 종료합니다Code."
mclog -n 192.168.100.2 -p 4321 -s cli -l ERROR -m "mclog test message"