'2017/08/18'에 해당되는 글 2건

  1. 2017.08.18 [td-agent] td-agent 설치 및 테스트
  2. 2017.08.18 [elasticsearch5] thread pool status


td-agent 설치하는 예제이다. td-agent는 fluentd의 래퍼 프로그램이다. 



rpm은 다음 링크로 설치한다. 


http://docs.fluentd.org/articles/install-by-rpm




$ sudo usermod -a -G adm td-agent

$ sudo -E /usr/sbin/td-agent-gem install fluent-plugin-record-reformer -v 0.8.2

$ sudo -E /usr/sbin/td-agent-gem install fluent-plugin-grep -v 0.3.4

$ sudo -E /usr/sbin/td-agent-gem install fluent-plugin-fields-parser -v 0.1.1




설치가 제대로 되었는지 확인한다. 


$ td-agent --version

td-agent 0.12.12





설정 파일을 생성한다.


$ sudo vi /etc/td-agent/td-agent.conf



 <source>

    type tail

    path /tmp/test.log

    pos_file /var/run/td-agent/test.log.pos

    tag public.test-service1.raw

    format /^(?<time>\S+ \S+) - \[(?<level>\S+)\] (?<msg>.+)/

    time_format %Y-%m-%d %H:%M:%S,%L

  </source>

  <match public.test-service1.raw>

    type record_reformer

    enable_ruby false

    tag public.test-service1

    <record>

      hostname ${hostname}

      phase alpha

    </record>

  </match>

  <match public.test-service1>

    type stdout

  </match>
</source>

  


문법을 확인한다.


sudo td-agent -c /etc/td-agent/td-agent.conf



데몬 실행 후 /tmp/test.log 로그를 확인한다.



2017-08-18 19:39:39,000 - [WARN] time over

2017-08-18 19:39:39 +0900 public.test-service1: {"level":"WARN","msg":"time over","hostname":"aaaaa.google.com","phase":"alpha"}



잘 동작하면 td-agent가 계속 동작하도록 한다.


sudo /sbin/chkconfig td-agent on

'Cloud' 카테고리의 다른 글

fluent-plugin-extract_query_params  (0) 2017.08.23
[펌] fluentd 성능  (0) 2017.08.21
fluentd 공부  (0) 2017.08.16
[펌] 한국 오픈 스택 2017 자료 올라옴  (0) 2017.08.16
[펌] fluentd 사용 사례  (0) 2017.08.15
Posted by '김용환'
,



elasticsearch의 쓰레드 상태를 보려면 다음과 같은 _cat/thread_pool 를 본다. 


$ curl -s http://abc.google.com:9200/_cat/thread_pool


abc.google.com           bulk                 7  0  784202

abc.google.com           fetch_shard_started  0  0       0

abc.google.com           fetch_shard_store    0  0       0

abc.google.com           flush                0  0       0

abc.google.com           force_merge          0  0       0

abc.google.com           generic              0  0       0

abc.google.com           get                  0  0       0





3,4,5번째 컬럼은 active, queue, rejected를 의미한다. 


bulk api thread가 더이상 요청을 받지 못해 rejected 된 현황을 보여준다. 

Posted by '김용환'
,