체크 record 선정


SELECT * FROM "sejong_bike"
WHERE bike_id LIKE 'SJ-0001' 
     AND user_id='junecy'
ORDER BY __time
LIMIT 1

 

 

#1 .csv 파일을 직접 vi로 수정하여 druid에 반영이 되었는지 확인 


 

$ vi data_fn.csv

# 1번 record station_rental_id = 0101로 변경

 

반영 안되는 것 확인

 

 

 

#2. druid에 record ingestion 후 druid에 반영이 되었는지 확인


Updating existing data

 

 

This spec creates a datasource called updates-tutorial from the quickstart/tutorial/updates-data.json input file.

{
  "type" : "index_parallel",
  "spec" : {
    "dataSchema" : {
      "dataSource" : "updates-tutorial",
      "timestampSpec": {
        "column": "timestamp",
        "format": "iso"
      },
      "dimensionsSpec" : {
        "dimensions" : [
          "animal"
        ]
      },
      "metricsSpec" : [
        { "type" : "count", "name" : "count" },
        { "type" : "longSum", "name" : "number", "fieldName" : "number" }
      ],
      "granularitySpec" : {
        "type" : "uniform",
        "segmentGranularity" : "week",
        "queryGranularity" : "minute",
        "intervals" : ["2018-01-01/2018-01-03"],
        "rollup" : true
      }
    },
    "ioConfig" : {
      "type" : "index_parallel",
      "inputSource" : {
        "type" : "local",
        "baseDir" : "quickstart/tutorial",
        "filter" : "updates-data2.json"
      },
      "inputFormat" : {
        "type" : "json"
      },
      "appendToExisting" : false
    },
    "tuningConfig" : {
      "type" : "index_parallel",
      "maxRowsPerSegment" : 5000000,
      "maxRowsInMemory" : 25000
    }
  }
}

 

bin/post-index-task --file quickstart/tutorial/updates-init-index.json --url http://localhost:8081

 

druid console에서 확인

 

'Database > Druid' 카테고리의 다른 글

Druid Quickstart  (0) 2020.08.21
How to install Druid 0.19.0 on Cent OS 8  (0) 2020.08.21
CentOS 8 에서 Druid Console 외부접속하기  (0) 2020.08.05
How to install Druid 0.13.0 on CentOS 8  (0) 2020.07.31
[MacOS] Druid 설치  (0) 2020.07.23

1. local disk와 연결

Base directory : quickstart/tutorial/
file filter : wikiticker-2015-09-12-sampled.json.gz

 

입력 후 데이터 확인하고 [Next: Parse data] 클릭

 

 

 

2. parse data 확인

 

input format은 json

[Next: Parse time] 클릭

 

 

 

3. parse time 확인

 

확인 후 configure schema까지 skip

 

 

 

4. configure schema에서 rollup 세팅

 

 

 

5. segment granularity 'day' 로 설정

 

[Next: Tune] -> [Next: Publish] 클릭

 

 

 

6. spec 확인 

 

 

[Submit] 클릭

 

 

data ingestion이 Running -> Success로 변하면 상단 메뉴바의 [datasources] -> 오른쪽 랜치모양 아이콘 클릭

 

 

 

7. [query with SQL] -> 쿼리문 작성 -> [run]

 

 

아래에서 쿼리에 대한 결과를 확인할 수 있다

 

 

 

 

# 파일 다운로드
$ wget [http://mirror.navercorp.com/apache/druid/0.19.0/apache-druid-0.19.0-bin.tar.gz](http://mirror.navercorp.com/apache/druid/0.19.0/apache-druid-0.19.0-bin.tar.gz)

# 압축 해제
$ tar -xzf apache-druid-0.19.0-bin.tar.gz
$ cd apache-druid-0.19.0

# druid 실행 (druid 폴더에서 명령어 실행)
$ ./bin/start-micro-quickstart

 

 

참고


https://druid.apache.org/docs/latest/operations/single-server.html#nano-quickstart-1-cpu-4gb-ram

 

Single server deployment · Apache Druid

 

'Database > Druid' 카테고리의 다른 글

Druid quickstart - Updating existing data  (0) 2020.08.28
Druid Quickstart  (0) 2020.08.21
CentOS 8 에서 Druid Console 외부접속하기  (0) 2020.08.05
How to install Druid 0.13.0 on CentOS 8  (0) 2020.07.31
[MacOS] Druid 설치  (0) 2020.07.23

druid.host 변경


 

$ vim conf/druid/single-server/nano-quickstart/_common/common.runtime.properties

 

 

 

 

<ip address>:8888 접속 에러페이지가 안뜨는 오류 해결


 

원인 - CentOS 8의 방화벽 running으로 인해 외부 접속을 차단하여 페이지 접속 불가능

 

$ firewall-cmd --state 

# running 이면 방화벽 중단 
$ systemctl stop firewalld

 

http://<ip address>:8888

외부에서 실행 성공

 

 

참고


드루이드 라우터 설정 - https://druid.apache.org/docs/latest/design/router.html

 

Router Process · Apache Druid

 

druid configuration _common -  http://druidio.cn/docs/0.9.0/configuration/index.html

 

Druid |

Table of Contents API documentation Configuring Druid This describes the common configuration shared by all Druid nodes. These configurations can be defined in the common.runtime.properties file. JVM Configuration Best Practices There are four JVM paramete

druidio.cn

 

'Database > Druid' 카테고리의 다른 글

Druid quickstart - Updating existing data  (0) 2020.08.28
Druid Quickstart  (0) 2020.08.21
How to install Druid 0.19.0 on Cent OS 8  (0) 2020.08.21
How to install Druid 0.13.0 on CentOS 8  (0) 2020.07.31
[MacOS] Druid 설치  (0) 2020.07.23

Download Druid 0.13.0


# wget으로 다운로드
$ wget https://archive.apache.org/dist/incubator/druid/0.13.0-incubating/apache-druid-0.13.0-incubating-bin.tar.gz

# 압축해제
$ tar -xzf apache-druid-0.13.0-incubating-bin.tar.gz

# 폴더로 이동
$ cd apache-druid-0.13.0-incubating

 

 

Download Zookeeper 3.4.11


# curl로 zookeeper 다운로드 3.4.11 버전
$ curl https://archive.apache.org/dist/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz -o zookeeper-3.4.11.tar.gz

# 압축해제
$ tar -xzf zookeeper-3.4.11.tar.gz

# zookeeper 이동
$ mv zookeeper-3.4.11 zk

druid 폴더 안에서 Zookeeper 설치

 

 

Druid 실행


# From the apache-druid-0.13.0-incubating package root, run the following command
$ bin/supervise -c quickstart/tutorial/conf/tutorial-cluster.conf

druid 실행

 

 

참고


https://druid.apache.org/docs//0.13.0-incubating/tutorials/tutorial-kafka.html

 

Druid | Tutorial: Load streaming data from Kafka

Table of Contents

 

'Database > Druid' 카테고리의 다른 글

Druid quickstart - Updating existing data  (0) 2020.08.28
Druid Quickstart  (0) 2020.08.21
How to install Druid 0.19.0 on Cent OS 8  (0) 2020.08.21
CentOS 8 에서 Druid Console 외부접속하기  (0) 2020.08.05
[MacOS] Druid 설치  (0) 2020.07.23

 

1. 먼저, apache-druid 0.19.0 파일을 아래 링크에서 다운로드

https://www.apache.org/dyn/closer.cgi?path=/druid/0.19.0/apache-druid-0.19.0-bin.tar.gz

 

Apache Download Mirrors

Copyright © 2019 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache and the Apache feather logo are trademarks of The Apache Software Foundation.

www.apache.org

 

2. 파일을 다운로드받은 경로에서 terminal에 아래 명령어 입력

tar -xzf apache-druid-0.19.0-bin.tar.gz	//압축해제
cd apache-druid-0.19.0

압축해제 후 폴더로 이동

 

 

3. 퀵스타트 명령어 입력

./bin/start-micro-quickstart

error

명령어를 입력했더니 Druid는 Java8만 지원하니 설치하고 재시도하라는 메세지 출력

-> 괜히 무시했다가 나중에 탈나느니 아예 8로 맞춰주기로.. (방법은 더보기 클릭)

 

더보기

Java8 설치는 여기 -> https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html

 

java8 설치가 성공해도 여전히 컴퓨터는 java의 최신버전을 쓰기 때문에 변경을 해줘야 함

 

~ java -version				//현재 자바 버전 확인
~ /usr/libexec/java_home -V		//설치된 자바 버전 모두 확인
~ sudo vi ~/.zshrc			//비밀번호 입력

 

~ source ~/.zshrc	//수정한 파일 적용
~ java -version 	//버전 변경 되었는지 확인
변경 완료 화면

 

정상작동 스크린샷

 

Druid 종료는 control + c 

 

4. 이 주소에 접속했을 때 아래와 같은 화면이 출력되면 성공 

http://localhost:8888/

 

 


 

이 포스팅은 드루이드의 퀵스타트를 보고 따라하며 작성하였습니다.

 

https://druid.apache.org/docs/latest/tutorials/index.html

 

Quickstart · Apache Druid

 

 

+ Recent posts