LoginSignup
2
2

More than 5 years have passed since last update.

Ubuntu 16.04 への re:dash 導入メモ

Last updated at Posted at 2017-09-22

Ubuntu 16.04 に re:dash をインストールするまで。
Ubuntu は vagrant で起動。

Docker インストール

まず Docker インストール。Docker なしでのインストール方法は不明。

$ sudo apt-get install apt-transport-https ca-certificates

$ sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

$ echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list

$ sudo apt-get update

$ sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual

$ sudo curl -L "https://github.com/docker/compose/releases/download/1.16.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

$ sudo chmod +x /usr/local/bin/docker-compose

re:dash インストール


$ git clone https://github.com/getredash/redash.git

$ cd redash/setup/ubuntu/

$ sudo sh bootstrap.sh

re:dash の Web コンソールに接続

クライアントから HTTP 標準ボート(80)で re:dash に接続できる。

Data Source に踏み台を経由した DBMS を指定

SSH トンネリング

re:dash ホスト上から SSH トンネリング接続する。

書き方
$ ssh -NL [re:dash ホストの空きポート番号]:[DBMS のホスト]:[DBMS のポート番号] 踏み台ホスト

以下のケースの設定例。

  • 踏み台: fumidai-host.com
  • 踏み台 SSH アカウント: foo
  • DBMS ホスト: dbms-mysql-host.com (MySQL サーバー)
$ ssh -NL 13306:dbms-mysql-host.com:3306 foo@fumidai-host.com

re:dash ホスト上で上記のようなトンネリング設定をして、Data Source には以下のように指定する。

  • Host: 127.0.0.1
  • Port: 13306
  • User: MySQL サーバーのユーザー
  • Password: MySQL サーバーのパスワード

autossh による接続維持

トンネリング切断に対応するためには、autossh を使うとよい。

$ autossh -M 0 -f -NL 13306:dbms-mysql-host.com:3306 foo@fumidai-host.com

SSH 秘密鍵にパスフレーズが設定されている場合、ssh-agent でキーを登録しておく必要がある。

Data Source に Treasure Data を指定

Settings > Data Sources >

「Type」が2つあるが、以下のように指定する。

  • 上側には「TreasureData」を指定
  • 下側には「hive」または「presto」を指定
2
2
1

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
2
2