728x90
반응형

redash BI툴로 오픈소스이다.

bitnami 버전의 설치와 SMTP 세팅방법이다.

 

다운로드

wget https://bitnami.com/redirect/to/1471031/bitnami-redash-8.0.0-14-linux-x64-installer.run

권한 변경

chmod 755 bitnami-redash-8.0.0-14-linux-x64-installer.run


설치

/root/bitnami-redash-8.0.0-14-linux-x64-installer.run

[root ]# /root/bitnami-redash-8.0.0-14-linux-x64-installer.run
----------------------------------------------------------------------------
Welcome to the Bitnami Re:dash Stack Setup Wizard.

----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.

Re:dash : Y (Cannot be edited)

Is the selection above correct? [Y/n]: y

----------------------------------------------------------------------------
Installation folder

Please, choose a folder to install Bitnami Re:dash Stack

Select a folder [/opt/redash-8.0.0-14]:

----------------------------------------------------------------------------
Create Admin account

Bitnami Re:dash Stack admin user creation

Your real name [User Name]: admin

Email Address [user@example.com]: test@naver.com

Password :
Please confirm your password :
Do you want to configure mail support? [y/N]: y

----------------------------------------------------------------------------
Configure SMTP Settings

This is required so your application can send notifications via email.

Default email provider:

[1] GMail
[2] Custom
Please choose an option [1] : 1

----------------------------------------------------------------------------
Configure SMTP Settings

This data is stored in the application configuration files and may be visible to
others. For this reason, it is recommended that you do not use your personal
account credentials.

GMail address []: test@gmail.com   ### <-- gmail 주소 입력 --> 

GMail password :   ### <-- Gmail 패스워드 입력 중요!! -->
Re-enter :
----------------------------------------------------------------------------
Web Server Port

Choose a port that is not currently in use, such as port 81.

Apache Web Server Port [81]: 18080

----------------------------------------------------------------------------
Hostname that will be used to configure Re:dash. If this value is incorrect, you
may be unable to access your Re:dash installation from other computers.

Hostname [123.123.123.123]: redash-0

----------------------------------------------------------------------------
Setup is now ready to begin installing Bitnami Re:dash Stack on your computer.

Do you want to continue? [Y/n]: y

----------------------------------------------------------------------------
Please wait while Setup installs Bitnami Re:dash Stack on your computer.

 Installing
 0% ______________ 50% ______________ 100%
 #########################################

----------------------------------------------------------------------------
Setup has finished installing Bitnami Re:dash Stack on your computer.


웹서버 학인

ps -ef | grep apache


Redash 시작 & 중지 스크립트

728x90
redash 시작 스크립트 
/opt/redash-8.0.0-14/ctlscript.sh start
재시작
/opt/redash-8.0.0-14/ctlscript.sh restart
중지
/opt/redash-8.0.0-14/ctlscript.sh stop


간단하게 OS에서 메일 테스트

mail test@gmail.com
subject : test
test 입니다

Ctrl+D 로 마지막으로 전송


파이썬을 통한 메일 테스트
python mailingTest.py

# -*- coding: utf-8 -*-
import smtplib
smtp = smtplib.SMTP('smtp.gmail.com', 587)
#smtp = smtplib.SMTP('smtp.googlemail.com', 465)
smtp.ehlo()
smtp.starttls()
smtp.login('test@gmail.com','password')
smtp.sendmail('test@gmail.com',
              'test2@gmail.com',
              'Subject: redash smtp test!')
smtp.quit()


apache port 변경

/opt/redash-8.0.0-14/apache2/conf/httpd.conf

Listen 80 -> 18080 포트 변경
ServerName syf-redash-0.cocone:18080 로 변경

환경변수 REDASH_HOST 에 포트 추가

vi ./apps/redash/htdocs/.env




728x90
300x250

'IT > Opensource' 카테고리의 다른 글

Stunnel  (0) 2023.06.22
Docker 컨테이너를 전체 개방하지 않도록 iptables에서 제한  (0) 2021.08.12
Redash 설치 및 세팅 (Docker Compose 버전)  (0) 2021.08.11
LVS 사전 준비  (0) 2021.08.09
PMM 명령어  (0) 2021.07.30
728x90
반응형

Redash 설치 및 세팅 할 때 Docker Compose으로 사용

sudo yum remove docker docker-common docker-selinux docker-engine
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum -y install docker-ce docker-ce-cli containerd.io
sudo yum install -y --setopt=obsoletes=0 docker-ce docker-ce-selinux
sudo systemctl start docker && sudo systemctl enable docker
export VER="1.23.1"
sudo curl -L https://github.com/docker/compose/releases/download/${VER}/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo usermod -aG docker $USER
newgrp docker
 
sudo yum -y update
curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -
sudo yum install -y nodejs
 
git clone https://github.com/getredash/redash.git
cd redash
npm install
npm run build

<-- 처음 docker로 등록시 SQL 쿼리 이슈 발생할 경우
sqlalchemy.exe 오류 발생시 (테이블이 정상적으로 생성되지 않은 경우)
sqlalchemy.exc.ProgrammingError
ProgrammingError: (psycopg2.ProgrammingError) relation “organizations” does not exist
LINE 2: FROM organizations
^
[SQL: ‘SELECT organizations.updated_at AS organizations_updated_at, organizations.created_at AS organizations_created_at, organizations.id AS organizations_id, organizations.name AS organizations_name, organizations.slug AS organizations_slug, organizations.settings AS organizations_settings \nFROM organizations \nWHERE organizations.slug = %(slug_1)s \n LIMIT %(param_1)s’] [parameters: {‘slug_1’: ‘default’, ‘param_1’: 1}] (Background on this error at:)
-->


docker-compose -f docker-compose.yml run --rm server create_db
docker-compose -f docker-compose.yml up

docker-compose.yml

SMTP 메일링 서비스는 AWS SES 사용

728x90
# This configuration file is for the **development** setup.
# For a production example please refer to getredash/setup repository on GitHub.
version: "2.2"
x-redash-service: &redash-service
  build:
    context: .
    args:
      skip_frontend_build: "true"
  volumes:
    - .:/app
x-redash-environment: &redash-environment
  REDASH_LOG_LEVEL: "INFO"
  REDASH_REDIS_URL: "redis://redis:6379/0"
  REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
  REDASH_RATELIMIT_ENABLED: "false"
  #REDASH_MAIL_SERVER: "localhost"
  #REDASH_MAIL_PORT : "25"
  #REDASH_MAIL_USE_TLS : "false"
  #REDASH_MAIL_USE_SSL : "false"
  #REDASH_MAIL_USERNAME: "None"
  #REDASH_MAIL_PASSWORD : "None"
  #REDASH_MAIL_DEFAULT_SENDER: "test@naver.com"
  REDASH_MAIL_SERVER: "email-smtp.ap-northeast-2.amazonaws.com"
  REDASH_MAIL_PORT : "587"
  REDASH_MAIL_USE_TLS : "true"
  #REDASH_MAIL_USE_SSL : "true"
  REDASH_MAIL_USERNAME: "AWS Access key"
  REDASH_MAIL_PASSWORD : "AWS Secret key"
  REDASH_MAIL_DEFAULT_SENDER: "test@naver.com"
  REDASH_ENFORCE_CSRF: "true" 
  REDASH_HOST : "ec2-3-37.amazonaws.com:5000"
  #REDASH_MAIL_DEFAULT_SENDER: "redash@example.com"
  #REDASH_MAIL_SERVER: "email"
  #REDASH_ENFORCE_CSRF: "true"
services:
  server:
    <<: *redash-service
    command: dev_server
    depends_on:
      - postgres
      - redis
    ports:
      - "5000:5000"
      - "5678:5678"
    environment:
      <<: *redash-environment
      PYTHONUNBUFFERED: 0
  scheduler:
    <<: *redash-service
    command: dev_scheduler
    depends_on:
      - server
    environment:
      <<: *redash-environment
  worker:
    <<: *redash-service
    command: dev_worker
    depends_on:
      - server
    environment:
      <<: *redash-environment
      PYTHONUNBUFFERED: 0
  redis:
    image: redis:3-alpine
    restart: unless-stopped
  postgres:
    image: postgres:9.5-alpine
    # The following turns the DB into less durable, but gains significant performance improvements for the tests run (x3
    # improvement on my personal machine). We should consider moving this into a dedicated Docker Compose configuration for
    # tests.
    ports:
      - "15432:5432"
    command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
    restart: unless-stopped
    environment:
      POSTGRES_HOST_AUTH_METHOD: "trust"
  email:
    image: djfarrelly/maildev
    ports:
      - "1080:80"
    restart: unless-stopped

AWS SES에서 초대할 메일 계정 확인 후 redash에서 다시 초대 필요

728x90
300x250

'IT > Opensource' 카테고리의 다른 글

Docker 컨테이너를 전체 개방하지 않도록 iptables에서 제한  (0) 2021.08.12
Redash 설치 및 세팅 (bitnami 버전)  (0) 2021.08.11
LVS 사전 준비  (0) 2021.08.09
PMM 명령어  (0) 2021.07.30
PMM 삭제 방법  (0) 2021.07.04

+ Recent posts