Superset

슈퍼셋(Superset) 설치

torukmakto 2023. 5. 18. 15:21

Apache Superset을 설치해 보도록 하겠습니다.

 

주로 사용하는 윈도우(Windows 10) OS에 설치 하려고 보니 해당 홈페이지에

아래와 같이 '공식적으로 윈도우는 지원하지 않음' 으로 나와 있네요.

 

출처:superset.apache.org

 

하지만 구글링 해보니 몇 가지 방법이 있었고그 중에 아래의 방법이 가장 용이했습니다.

(제가 모르는 더 간편한 방법이 있을 수도…)

 

사전 준비 사항

1.설치관련 파일 Download

   : 아래의 사이트에서 다음의 3가지 파일을 내려 받습니다.

     1) 위치: https://github.com/alitrack/superset_app

     2) 파일

          - python-3.8.10-embed-amd64.zip

          - get-pip.py

          - python_geohash-0.8.5-cp38-cp38-win_amd64.whl       

 

Download 대상 파일

 

2.윈도우 C: 드라이브에 Superset 디렉토리를 생성합니다.. (: C:\Superset)

3.생성된 Superset 디렉토리 아래에 python 디렉토리를 생성하고, Download 받은 파일 중

    아래 이름의 파일에 대해 압축을 풀어줍니다.

    - python-3.8.10-embed-amd64.zip  

   ※ 상기 파일을 압축풀면 나오는 32개 항목 전체를 python 디렉토리 아래로 복사해 줍니다.

   - 압축 해제된 파일 중 'python38._pth' 파일에 대해서는 다음과 같이 수정해 줍니다.

    메모장에서 열어 '#' 제거 후 저장.

 

4.나머지 두 개의 파일은 Superset 디렉토리 아래에 복사해 줍니다

    - get-pip.py

    - python_geohash-0.8.5-cp38-cp38-win_amd64.whl

5.이제 C:\Superset 아래에 다음과 같은 형태로 디렉토리가 구성되어 있어야 합니.   

 

Superset 설치 디렉토리구성

 

설치 하기

1. Window 10에서 cmd 창을 관리자 권한으로 열고위에서 생성한 C:\Superset\python
   디렉토리로 이동합니다.

    [명령어]

    cd \
    cd Superset/python
2. 해당 디렉토리에서 pip install 위해 아래 명령어를 입력하고 실행합니다.

    [명령어]

    python ..\get-pip.py

     pip install 위치: C:\Superset\python\Scripts
    참고로, PIP Python Package를위한 Package Manager .

 

'PIP' installation

 

3. 다음으로 python_geohash’를 install 합니다.

    [명령어]

    python -m pip install ..\python_geohash-0.8.5-cp38-cp38-win_amd64.whl

 

'python_geohash' installation

 

4. 그 다음에는C:\Superset\python\Scripts 디렉토리로 동하여 apache superset

    install 합니.

    [명령어]

    cd Scripts

    pip install apache-superset pillow

 

'Apache Superset' installation

     다음 명령어도 실행해 줍니다.

      [명령어]

      pip install markdown==3.2.2

 

'markdown' installation

     

5. Superset 초기화 작업을 위해 C:\Superset\python 디렉토리에서 아래 명령어를 실행합니다.

    [명령어]

    CD ..

    python -m pip install markupsafe==2.0.1

 

'markupsafe' installation

 

6. C:\Superset\python 디렉토리에서 아래 명령어를 실행합니다.

    [명령어]

    pip install path.py

 

'path.py' installation

 

7. C:\Superset\python\Scripts 디렉토리로 이동하여 Superset DB 초기화 합니다.

    [명령어]

    CD scripts

    superset db upgrade

 

Superset DB 초기화

 

8. 아래 명령어로 superset admin user 생성합니다.

    [명령어] 

    set FLASK_APP=superset

 

Superset admin user 생성 (a)

     다음 명령어도 실행해 줍니다.

     [명령어]

     superset fab create-admin

 

Superset admin user 생성 (b)

       상기 화면의 요청에 따라 사용할 ‘Username’, ‘User first name’, ‘User last name’,

           ‘Email’, ‘Password’ 순차적으로 입력해 줍니다.

          .

9. Superset example data를 생성합니다.

    [명령어]

    superset load_examples

   

Superset sample data 생성

 

10. Superset 기본 role 권한을 생성합니다.

      [명령어]

      superset init

      

Superset 기본 Role과 권한 생성

 

11. Superset Web Server 기동 (port 8080).  (C:\Superset\python\Scripts 폴더에서 실행)

      [명령어]

      superset run -p 8088 --with-threads --reload --debugger

     

Superset Web Server  기동

          ※종료시에는CTRL+C 입력

 

Superset 열기

1. 상기와 같이 정상적으로 Server가 기동 되면웹브라우저 (chrome, Edge ) 주소창에 

    다음의 URL입력합니다.

 

     http://127.0.0.1:8088/  또는 http://localhost:8088/

   

    정상적으로 설치가 되었으면 아래와 같은 'Sign In' 화면을 볼 수 있습니다.

 

superset 로그인 화면

 

2. 상기 화면에서 기존에 생성했던 ‘Username’ ‘Password’ 입력하면 아래와 같은 

    화면을   있습니다.

    

Superset 홈 화면

 

3. 또한, ‘Dashboard’ 항목 아래, ‘World Bank’s Data’ 클릭하면 아래와 같은 화면을   

    있습니다.

 

Sample Dashboard 선택
Dashboard - World Bank's Data

 

이상으로 Window 10 환경에 Apache Superset설치해 보았습니다.