3월, 2018의 게시물 표시

ELK에 xpack 설치 후 logstash로 데이터 입력

1. xpack 다운로드  - [path]/x-pack-6.2.2.zip 2. xpack 설치 (in ELK modules) - $ ./bin/elasticsearch-plugin  install file://[path]/x-pack-6.2.2.zip - $ ./bin/kibana-plugin  install file://[path]/x-pack-6.2.2.zip - $ ./bin/logstash-plugin  install file://[path]/x-pack-6.2.2.zip 3. 패스워드 업데이트 - $ ./bin/x-pack/setup-passwords interactive ... Changed password for user [kibana] Changed password for user [logstash_system] Changed password for user [elastic] 4. 설정 파일 업데이트 - config/kibana.yml 업데이트 elasticsearch.username: "kibana" elasticsearch.password: [PW] - config/logstash.yml xpack.monitoring.elasticsearch.username: logstash_system xpack.monitoring.elasticsearch.password: [PW] 5. logstash로 데이터 insert하기 위한 User(예:logstash_insert)/Role 생성 - Kibana에 "elastic" ID로 로그인 후 설정 (세부 설정 생략) 6. logstash 에 insert 권한 가지 user를 통한 데이터 insert - 예시 output {     elasticsearch {         hosts => "localhost"         index => "test_index"    

Mosquitto test

1. Install Mosquitto broker $ sudo  apt-get install mosquitto $ netstat -nap | grep 1883 tcp        0      0 0.0.0.0:1883            0.0.0.0:*               LISTEN      -              tcp6       0      0 :::1883                 :::*                    LISTEN      -  2. Install Mosquitto client $ sudo apt-get install mosquitto-clients 3. Test Pub/Sub - subscribing "hello/world" Topic $ mosquitto_sub -d -t hello/world Client mosqsub/7013-dkyun77-Th sending CONNECT Client mosqsub/7013-dkyun77-Th received CONNACK Client mosqsub/7013-dkyun77-Th sending SUBSCRIBE (Mid: 1, Topic: hello/world, QoS: 0) Client mosqsub/7013-dkyun77-Th received SUBACK Subscribed (mid: 1): 0 (after executing the following command of mosquitto_pubg) Client mosqsub/7013-dkyun77-Th received PUBLISH (d0, q0, r0, m0, 'hello/world', ... (11 bytes)) Hello World $ mosquitto_pub -d -t hello/world -m "Hello World" Client mosqpub/6973-dkyun77-Th sending CONNECT Client mosqpu