체크 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

Superset 설치


pip3를 사용하여 superset을 설치해야 하므로 이전 포스팅의 pip3 업데이트를 진행 후 시작~!

2020/08/10 - [linux] - Linux python path설정 & pip3 업데이트

 

# Install superset
$ sudo pip install apache-superset

# Initialize the database
superset db upgrade

 

 

Admin user 생성


# Create an admin user (you will be prompted to set a username, first and last name before setting a password)
$ export FLASK_APP=superset

# admin user 생성
$ superset fab create-admin

 

 

load 데이터


# Load some data to play with
$ superset load_examples

# Create default roles and permissions
$ superset init

 

 

 

웹으로 확인하기


# To start a development web server on port 8088, use -p to bind to another port
$ superset run -p 8088 --with-threads --reload --debugger

 

만약, 서버에 붙어서 개발 중이라면 모든 ip 허용시키고 접근 (보안문제로 내부에서 테스트 할 때만 사용 권장)

$ superset run -h 0.0.0.0 -p 8088 --reload --debugger --with-threads

 

 

web화면

 

create admin에서 설정한 username과 password 사용

 

 

load 데이터로 시각화


 

 

참고


https://superset.apache.org/installation.html#superset-installation-and-initialization

 

Installation & Configuration — Apache Superset documentation

Getting Started Superset has deprecated support for Python 2.* and supports only ~=3.6 to take advantage of the newer Python features and reduce the burden of supporting previous versions. We run our test suite against 3.6, but 3.7 is fully supported as we

superset.apache.org

 

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

Superset에서 Druid database 사용하기  (1) 2020.08.10

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

 

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