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
# python3 업데이트
$ sudo yum list python3
$ sudo yum install python3 -y

# 파이썬 패키지 설치
$ sudo pip3 install cchardet==1.0.0
$ sudo pip3 install --upgrade setuptools

# PATH 설정
$ sudo su
$ vi ~/.bashrc

# alias python=python3
# alias pip=pip3

# 변경된 환경변수 적용
$ sudo source ~/.bashrc

# 파이썬, pip 버전확인
$ sudo python -V
$ sudo pip -V

 

bashrc 파일 수정

 

 

참고


https://medium.com/@sungmok.sohn/aws%EC%97%90%EC%84%9C-apache-superset%EC%9C%BC%EB%A1%9C-bi-%EA%B5%AC%EC%B6%95%ED%95%98%EA%B8%B0-1-ca12ad74b31b

 

AWS에서 Apache Superset으로 BI 구축하기(1)

비즈니스 인텔리전스 (Business Intelligence, BI) 개발이 필요하다면 Superset 을 추천합니다. Superset은 Python 기반으로 개발된 web 어플리케이션입니다. GUI로 차트 및 대시보드를 간편하게 관리할 수 있는�

medium.com

 

$ npm install -g ganache-cli

> scrypt@6.0.3 preinstall /usr/local/lib/node_modules/ganache-cli/node_modules/scrypt
> node node-scrypt-preinstall.js

npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/ganache-cli/cli.js
npm ERR! dest /usr/local/bin/ganache-cli
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/ganache-cli/cli.js' -> '/usr/local/bin/ganache-cli'
npm ERR! File exists: /usr/local/bin/ganache-cli
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/cona/.npm/_logs/2020-08-06T08_10_10_302Z-debug.log

 

node 버전이 높으면 호환이 안되는 것 확인 (컴파일 에러까지 이어짐)

 

 

해결방법


노드 버전 문제라고 판단해 버전 다운그레이드 진행

 

# node version manager 다운로드
$ brew install nvm

 

다운로드 진행 이후에 뜨는 내용 따라 진행 (Dapp 진행은 12 버전 추천)

 

$ nvm ls

# node 12.14.1 설치
$ nvm install 12.14.1

# 12.14.1로 바뀌었나 확인
$ node -v

# 다른 버전을 사용하고 싶다면 use 사용
$ nvm use 노드버전

 

 

 

참고


https://gist.github.com/falsy/8aa42ae311a9adb50e2ca7d8702c9af1

 

NVM(Node Version Manager) 맥OS에서 설치 & 사용하기

NVM(Node Version Manager) 맥OS에서 설치 & 사용하기. GitHub Gist: instantly share code, notes, and snippets.

gist.github.com

 

 

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

CentOS 8에 Vim 설치


$ sudo dnf search vim
$ sudo dnf info vim-minimal
$ sudo dnf info vim-enhanced
$ yum install vim-enhanced

 

 

사용방법

 

$ vim filename
$ vim /path/to/file
$ vim [options] my-code.sh



참고


https://www.cyberciti.biz/faq/how-to-install-vim-on-centos-8-using-dnf-yum/

 

How to install vim on CentOS 8 using dnf/yum - nixCraft

Are you missing VIM on CentOS 8? Here is how to easily install a version of the VIM editor which includes recent enhancements on CentOS 8 Linux using dnf.

www.cyberciti.biz

 

+ Recent posts