Machcollectoradmin은 machcollectormanger를 관리하는 도구이다.
옵션과 기능 서술
[mach@localhost ~]$ machcollectoradmin --help ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved. ----------------------------------------------------------------- << Available option lists >> -u, --startup Startup collectormanager. -s, --shutdown Shutdown collectormanager. -d, --destroy Destroy meta data. -k, --kill Terminate collectormanager. --showcollectors Show collector list. --showservers Show server list. -h, --help Print collector argument guide. --createcollector=collector_name Create collector. --dropcollector=collector_name Drop collector. --startcollector=collector_name Start collector. --stopcollector=collector_name Stop collector. -m, --template=template_path Set template path. Template path is required to issues createcollector command. -t, --trace=[0,1] Set trace option. Start collector mode (default: 0) --createserver=host:port Manager registers itself to the server. --managername=managername Specify a name of the manager. If not specified, default name will be used.
machcollectormanager 실행
machcollectormanager는 직접 실행할 수 없고, machcollectoradmin을 통해서 실행해야 한다.
[mach@localhost ~]$ machcollectoradmin --startup ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved ----------------------------------------------------------------- Waiting for collectormanager start. Collectormanager started successfully.
machcollectormanager 종료
machcollectormanger를 중지하면 그 collectormanager가 관리하는 collector프로세스도 동시에 중지된다.
[mach@localhost ~]$ machcollectoradmin --shutdown ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved ----------------------------------------------------------------- CollectorManager server shutdown successfully.
machcollectormanager 메타 정보 삭제
machcollectormanager가 관리하는 collector, 데이터베이스 서버 등에 대한 정보를 삭제한다. machcollectormanager가 실행중이면 이 명령은 오류로 처리된다.
[mach@localhost ~]$ machcollectoradmin --destroy ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved. ----------------------------------------------------------------- Destroyed meta data successfully.
machcollectormanager 강제 종료
machcollectormanger가 shutdown과정을 대기하지 않고 즉시 중지한다.
[mach@localhost ~]$ machcollectoradmin --kill ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved. ----------------------------------------------------------------- Waiting for collectormanager terminated. Collectormanager terminated successfully.
Machbase Server 등록
machcollectormanger에 연결된 마크베이스 데이터베이스 서버를 설정한다. 이후 machsql을 통한 관리가 가능하다.
[mach@localhost ~]$ machcollectoradmin --createserver=127.0.0.1:5757 ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved. ----------------------------------------------------------------- Created the server successfully.
Machbase Server Name 지정
마크베이스 서버에 collectormanager를 등록할 때, 등록하는 collectormanager의 이름을 설정할 수 있다.
[mach@localhost ~]$ machcollectoradmin --createserver=127.0.0.1:5757 --managername=mach_manager ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved. ----------------------------------------------------------------- Created the server successfully.
Server List 출력
machcollectormanager에 등록된 데이터베이스 서버 리스트를 표시한다.
[mach@localhost ~]$ machcollectoradmin --showservers ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved. ----------------------------------------------------------------- ID 1 NAME 192.168.0.34:5757 ADDR 192.168.0.34 PORT 5757
Collector 생성
Collectormanger가 관리하는 collector를 생성한다. collector를 생성할 때, 이름과 템플릿 파일의 경로를 필수적으로 입력받는다.
collector의 이름은 createcollector의 인자로 입력받고, 템플릿 경로는 -m 또는 --template 옵션으로 지정해야 한다.
[mach@localhost ~]$ machcollectoradmin --createcollector=syslog --template=/home/hanchi/work/nfx/machbase_home/collector/syslog.tpl ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved. ----------------------------------------------------------------- Created the collector successfully.
템플릿 파일 지정
collector를 생성할 때, collector설정 파일인 템플릿 파일의 경로를 지정한다. 상대 경로인 경우 $MACHBASE_HOME/collector/ 디렉토리를 기준으로 한다.
[mach@localhost ~]$ machcollectoradmin --createcollector=syslog --template=syslog.tpl ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved. ----------------------------------------------------------------- Created the collector successfully.
Collector 실행
등록된 collector프로세스를 실행한다. 실행시 collector 이름을 명시해야 한다.
[mach@localhost ~]$ machcollectoradmin --startcollector=syslog ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved. ----------------------------------------------------------------- Started the collector successfully.
Collector 로그 메세지 설정
사용자가 컬렉터 실행시에 로그 메시지를 생성하도록 한다. 값을 1로 설정하면 생성되고 0으로 설정하면 생성하지 않는다.
[mach@localhost ~]$ machcollectoradmin --startcollector=syslog --trace=1 ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved. ----------------------------------------------------------------- Started the collector successfully.
Collector 중지
실행중인 컬렉터를 중지시킨다.
[mach@localhost ~]$ machcollectoradmin --stopcollector=syslog ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved. ----------------------------------------------------------------- Stopped the collector successfully.
Collector 제거
collector에 관련된 메타 정보를 삭제한다. 실행시 collector의 이름을 명시해야 한다.
[mach@localhost ~]$ machcollectoradmin --dropcollector=syslog ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbasae Inc. or its subsidiaries All Rights Reserved. ----------------------------------------------------------------- Dropped the collector successfully.
Collector 리스트 출력
등록된 collector의 리스트를 표시한다.
[mach@localhost ~]$ machcollectoradmin --showcollectors ----------------------------------------------------------------- machcollector administration tool Release Version - 3.5.0.826b8f2.community Copyright 2014, Machbase Inc. or its subsidiaries All Rights Reserved. ----------------------------------------------------------------- ID 1 NAME SYSLOG TEMPLATE_PATH syslog.tpl COLLECT_TYPE FILE SOURCE_FILE /var/log/syslog LOG_TYPE syslog PREPROCESS_PATH REGEX_PATH syslog.rgx REGEX (([a-zA-Z]+)\s+([0-9]+)\s+([0-9:]*))\s(\S+)\s+([^\n]+) END_REGEX \n LANGUAGE UTF-8 SLEEP_TIME 1000 PROCESS_BYTE 0 PROCESS_RECORD 0 PREV_PROCESS_BYTE 0 PREV_PROCESS_RECORD 0 RUN_FLAG 0