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