Machcollectoradmin은 machcollectormanger를 관리하는 도구이다.
Options and Descriptions
[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.
Execute 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.
Shutdown 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.
Destroy machcollectormanager Meta Data
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.
Kill 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.
Register 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.
Specify a 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.
Verify the 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
Create a Collector
Collectormanger가 관리하는 collector를 생성한다. collector를 생성할 때 --template 옵션을 지정해야 한다.
It creates a collector in a collector manager. The name of collector will be received as an argument. Each time a collector is created, --template and -m options must be used.
[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.
Specify a Template
collector를 생성할 때, collector설정 파일인 template파일의 경로를 지정한다. 상대 경로인 경우 $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.
Execute a 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.
Set Collector Tracing
사용자가 콜렉터 실행시에 추적 메시지를 생성하도록 한다. 값을 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.
Stop a 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.
Drop a 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.
Verify the Collector List
등록된 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