Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
2
Help us understand the problem. What is going on with this article?
@nakan-D128

mac CatalinaでRedash構築

More than 1 year has passed since last update.

まえおき

mac Catalina上にRedashを構築したときにいろいろとはまったので手順をメモ

リポジトリをクローン

$ git clone https://github.com/getredash/redash.git
$ git checkout refs/tags/v8.0.0

構築に必要なコマンドをインストール

$ brew install pwgen

Dockerをダウンロードしてインストール

ディレクトリの作成

$ sudo mkdir /opt/redash
$ sudo chown $USER:staff /opt/redash
$ mkdir /opt/redash/postgres-data

docker-compose.ymlのコピー

$ cd /opt/redash
$ cp <クローンしたパス>/redash/setup/docker-compose.yml .

DockerのFile sharingにフォルダを追加

スクリーンショット 2020-02-19 23.46.00.png

<クローンしたパス>/redash/setup/setup.shの書き換え

#!/usr/bin/env bash
# This script setups dockerized Redash on Ubuntu 18.04.
set -eu

REDASH_BASE_PATH=/opt/redash

create_config() {
    if [[ -e $REDASH_BASE_PATH/env ]]; then
        rm $REDASH_BASE_PATH/env
        touch $REDASH_BASE_PATH/env
    fi

    COOKIE_SECRET=$(pwgen -1s 32)
    SECRET_KEY=$(pwgen -1s 32)
    POSTGRES_PASSWORD=$(pwgen -1s 32)
    REDASH_DATABASE_URL="postgresql://postgres:${POSTGRES_PASSWORD}@postgres/postgres"

    echo "PYTHONUNBUFFERED=0" >> $REDASH_BASE_PATH/env
    echo "REDASH_LOG_LEVEL=INFO" >> $REDASH_BASE_PATH/env
    echo "REDASH_REDIS_URL=redis://redis:6379/0" >> $REDASH_BASE_PATH/env
    echo "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" >> $REDASH_BASE_PATH/env
    echo "REDASH_COOKIE_SECRET=$COOKIE_SECRET" >> $REDASH_BASE_PATH/env
    echo "REDASH_SECRET_KEY=$SECRET_KEY" >> $REDASH_BASE_PATH/env
    echo "REDASH_DATABASE_URL=$REDASH_DATABASE_URL" >> $REDASH_BASE_PATH/env
}

setup_compose() {
    cd $REDASH_BASE_PATH
    echo "export COMPOSE_PROJECT_NAME=redash" >> ~/.bash_profile
    echo "export COMPOSE_FILE=$REDASH_BASE_PATH/docker-compose.yml" >> ~/.bash_profile
    export COMPOSE_PROJECT_NAME=redash
    export COMPOSE_FILE=$REDASH_BASE_PATH/docker-compose.yml
    sudo docker-compose run --rm server create_db
    sudo docker-compose up -d
}

create_config
setup_compose

setup.shの実行

$ sh <クローンしたパス>/redash/setup/setup.sh

redashにアクセス

ブラウザでhttp://localhost:5000

スクリーンショット 2020-02-19 23.59.50.png

参考文献

2
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
nakan-D128
iOS/Androidエンジニアです プライベートでiOSアプリをリリースしてます https://itunes.apple.com/jp/app/stockey/id1407877357?mt=8

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
2
Help us understand the problem. What is going on with this article?