3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

mac CatalinaでRedash構築

Posted at

まえおき

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

参考文献

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?