개발자의 길

influxDB 소개&설치 - windows 본문

1. 개발자

influxDB 소개&설치 - windows

자르르 2023. 7. 28. 11:53


– InfluxDB 특징

  • 하나의 데이터 포인트마다 timestamp를 식별자로 가짐 (시간 데이터에 최적화)
  • CR(ud) DB : 시계열 데이터를 저장하고 조회하는데 최적화된 DB, 수정 삭제 가능하나 권장 안함
  • RESTful API 제공 
  • Schemaless Design : 따로 테이블 생성 과정 필요 없음
  • 중복 데이터 자동 인식 저장
  • 데이터 보존 주기 (RP) 설정 가능'

 

RDBMS 와 InfluxDB 용어 비교

RDBMS InfluxDB
Database
Bucket
Table
Measurement
Indexed Column
Tag Key
InIndexed Column
Field Key

– InfluxDB 데이터 구조

Line Protocal 구조

 

InfluxDB는 데이터 한 줄이 하나의 Point를 이룬다.

이 point들이 쌓이고 쌓여 Line Protocal 구조를 이룬다.

 

구조를 보면 제일 먼저 테이블을 명시해주고 구분자와 공백을 준 후 세개의 컬럼을 나열한다.

  • Tag Key : 인덱싱된 컬럼, 무조건 String 타입, 생략 가능
  • Field Key : 인덱싱 되지 않은 일반 컬럼, 하나의 measurement에 꼭 하나 이상의 Field Key 필요,  (Float / Integer / String / Boolean 타입 가능)
  • Time Key : 데이터 입력시 생략하면 UTC기준 now( ), 기본 microseconds 단위를 사용, 단위 변경도 가능

여기서 Field Value는 기본이 Float타입이다. 만약 Integer형으로 넣고 싶다면 432i 이런식으로 뒤에 i를 붙여주면 된다.

 

 

***) window 에서 local에 설치 하여 할때는 1.x 버전으로 설치한다.

 

2.x부터 gui를 제공해주지만, k6와 연동하여 사용하려면, 일반적인 설치가 아닌 docker 설치를 통해서만 가능하다.

설치

- influxDB 1.x

https://portal.influxdata.com/downloads/

 

Downloads

Telegraf open source data collector Telegraf is a plugin-driven server agent for collecting and sending metrics and events from databases, systems, and IoT sensors. Telegraf is written in Go and compiles into a single binary with no external dependencies,

portal.influxdata.com

위 링크로 들어가서 아래로 스크롤을 쭉 내리면, 1.x 버전을 설치할수 있는 가이드가 있다.

 

해당 가이드의 window 버전으로 선택을 하면,

윈도우에서 powerShell을 실행하여서, 아래 wget 써있는 부분을 다 복사하여 실행하면 된다.

다운 후에 설치까지 다 진행한다.

 

정상적으로 다 설치되었으면

C:\Program Files\InfluxData\influxdb\influxdb-1.8.10-1

폴더가 생겨있을것이다.

이 안에 influxd.exe를 cmd 창으로 실행하면 된다.

기본포트는 8086이고, 1.x버전에서는 따로 gui를 제공해주고 있지않다.

 

이런 상태로 cmd창을 안닫으면 계속 실행중인 것이다.

 

 

- influxDB 2.x

https://portal.influxdata.com/downloads/

 

Downloads

Telegraf open source data collector Telegraf is a plugin-driven server agent for collecting and sending metrics and events from databases, systems, and IoT sensors. Telegraf is written in Go and compiles into a single binary with no external dependencies,

portal.influxdata.com

도커를 사용한다면, 도커의 image만 받아서 하는게 베스트 이고, 그냥 local에 설치할수도 있다.

참고로 k6와 연동해서 하려면 도커 설치로만 해야 하고, 여기 정식 설치 루트 말고

 

https://github.com/grafana/xk6-output-influxdb

 

GitHub - grafana/xk6-output-influxdb: k6 extension to output real-time test metrics to an InfluxDB 2.x database.

k6 extension to output real-time test metrics to an InfluxDB 2.x database. - GitHub - grafana/xk6-output-influxdb: k6 extension to output real-time test metrics to an InfluxDB 2.x database.

github.com

여기의 git 을 이용해서 설치해야한다.

k6 공식페이지에서도 이렇게 안내 하고 있다.

https://k6.io/docs/results-output/real-time/influxdb/

 

InfluxDB

k6 has an output extension to store k6 metrics in InfluxDB v2. This document shows you how to configure this integration.

k6.io

docker를 이용한다면, 해당 위 링크 가이드를 보고 하면 된다.

 

우선 우리는 지금 windows에 설치를 할 예정이다.

 

윈도우에서 powerShell을 실행하여서, 아래 wget 써있는 부분을 다 복사하여 실행하면 된다.

다운 후에 설치까지 다 진행한다.

 

정상적으로 다 설치되었으면

C:\Program Files\InfluxData\influxdb\influxdb2_windows_amd64

여기 폴더가 생긴것을 알수 있고,

그 안에 influxd.exe 를 cmd 창으로 실행하면 된다.

기본 포트 8086으로 뜬다.

http://localhost:8086

 

'1. 개발자' 카테고리의 다른 글

k6 - grafana - influxdb 연동  (0) 2023.07.28
Grafana 소개&설치  (0) 2023.07.28
K6 설치 및 사용 방법 - window  (0) 2023.07.28
nvm 설치 및 node 설치 - 사용법(mac&windows)  (0) 2022.02.22
코드리뷰를 시작하자  (0) 2021.04.20


이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.
공유하기 링크
Comments