Druid와 Superset 연결


  • From the UI, enter the information about your clusters in the Sources -> Druid Clusters menu by hitting the + sign.
  • Once the Druid cluster connection information is entered, hit the Sources -> Refresh Druid Metadata menu item to populate
  • Navigate to your datasources

 

  • pydruid 설치
# superset에서 druid 사용하려면 설치 필수!
$ pip install pydruid

 

 

  • sources -> database -> +new 버튼 클릭

 

 

  • SQLAlchemy URI에  druid://XX.XX:8082/druid/v2/sql/
druid://<ip address>:8888/druid/v2/sql/

 

 

  • Allow Csv Upload, Allow CREATE TABLE AS, Allow DML 체크박스

 

 

  • Extra 옵션에서 아래와 같이 AUTOCOMMIT을 설정 => DB 작업 바로 반영 (에러발생)
"engine_params": {"isolation_level":"AUTOCOMMIT"},

 

 

  • Backend에  druid 확인 -> 연결 완료

 

 

 

 

Superset에서 Druid database SQL문 실행해보기


SQL Lab 클릭 -> SQL Editor 클릭 -> 원하는 쿼리문 작성

 

 

 

참고


https://docs.ncloud.com/ko/das/das-1-2.html

 

설명서

Superset 시작하기 패키지를 만든 후 최초 1회는 Superset 서버에 접속해서 제공된 스크립트를 실행하여 Superset 관리자 계정과 필요한 테이블과 대시보드 등을 생성하고 필요한 초기 설정 작업을 수��

docs.ncloud.com

 

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

How to install Superset on CentOS 8 (linux)  (0) 2020.08.10

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

+ Recent posts