일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- OPCUA
- dense_vector
- filebeat
- airflow
- json
- Data Engineering
- query
- windows
- elasticsearch
- devtools
- PYTHON
- Tutorial
- ubuntu
- package.json
- node.js
- ELK
- KoA
- 7.7.1
- path.data
- Crontab
- DSL
- CSV
- logstash
- typescript
- grok
- framework
- venv
- configure
- elastic
- kibana
- Today
- Total
Gibbs Kim's playground
[ElasticStack-33] Machinebeat test with opcua 본문
opc-ua 서버를 테스트하던 도중 해당 데이터를 ES에 적재하여야 하는 상황을 겪었다.
이때, machinebeat라는 수집도구를 사용하여 opc-ua 서버에서 ES로 적재하는 것을 알게되었다.
해당 과정에 대한 수행내역을 기록해본다.
1) opc-ua 테스트용 서버 구축
https://mingsigi.tistory.com/entry/opc-ua-test-server-via-python
opc ua test server via python
from time import sleep import random from opcua import Server server = Server() server.set_endpoint("opc.tcp://127.0.0.1:12345") server.register_namespace("Room1") objects = server.get_objects_node(..
mingsigi.tistory.com
2) machinebeat 파일 다운로드
- Github에 관련 데이터가 있다. (https://github.com/elastic/Machinebea)
elastic/Machinebeat
This is a beat for collecting data of machines, sensors and PLCs. At the moment this is supporting OPC UA and MQTT. More to add. - elastic/Machinebeat
github.com
- git clone (.zip 파일 받으면 실행에 필요한 machinebeat이 없다)
- 혹시 .zip을 받았다면 Makefile이 있는 경로에서 make를 실행하자
- 이러면 깃에서 필요한 파일들을 추가로 다운로드 받는다
- 클론한 파일은 다음과 같은 디렉토리로 구성되어 있다.
machinebeat/
---- machinebeat
---- machinebeat.yml
---- data/
---- logs/
---- modules.d/
- modules.d 디렉토리 아래에 *.yml 패턴의 설정파일이 두 개 있다.
mqtt.yml.disabled
opcua.yml.disabled
- opcua 연동을 위해서 YAML파일을 사용가능하게 바꿔보자
>> /home/user/machinebeat/modules.d/machinebeat enable opcua
- 명령어 사용 후 *.yml이 다음과 같이 바뀐다.
mqtt.yml.disabled
opcua.yml
- 이제 기존에 만들었던 테스트용 opcua와의 연동을 위해 opcua.yml 설정을 바꿔보자.
## vi opcua.yml
## ...
module: opcua
enabled: true
period: 2s
endpoint: "opc.tcp://127.0.0.1:12345"
## ...
- machinebeat를 구동해보자
home/user/machinebeat/machinebeat -e -c machinebeat.yml
'Tech 기록지 > Elastic Stack' 카테고리의 다른 글
[ElasticStack-32] Elasticsearch (On-premise) to Elasticsearch (Cloud) through Logstash (0) | 2021.03.03 |
---|---|
[ElasticStack-31] Logstash - JDBC input (0) | 2021.03.03 |
[ElasticStack-30] Elastic Cloud 사용자 사전 (0) | 2021.03.03 |
[ElasticStack-29] Elasticsearch 동의어 관리 방식 (2) | 2020.09.01 |
[ElasticStack-28] search.max_buckets, max_result_window 사이즈 증가 (0) | 2020.08.18 |