# Redash ###### tags: `Vitualization` ---  本篇主要說明如何利用docker 快速建立本地資料庫視覺化界面,Redash 可以透過SQL 語法快速建立表格的視覺化圖表,並可配置相關的儀表板內容,Redash同時加入使用者管理功能,幫助控管及公開給內部使用者使用,也可透過連結網址,分享給其他人,話不多說,我們開始吧。 --- # 啟動服務 Service Start `cd /redash` `docker-compose start` # 安裝 Install * 本系統使用Centos 8 ## 1. 安裝Docker,Docker Compose和Node.js 我們將使用Docker運行Redash所需的所有服務,除了Node.js,服務將在本地運行。 安裝[docker](https://docs.docker.com/engine/install/centos/)和[docker-compose](https://docs.docker.com/compose/install/)。 安裝[nodejs](https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-centos-8)(建議使用最新的LTS或更高版本,可以在OS / X上與Homebrew一起安裝) ## 2. Redash Install > [Redash](https://redash.io/help/open-source/dev-guide/docker) >* `npm run build` :error TS2688: Cannot find type definition file for 'jest'. >[Issue debug](https://gitmemory.com/issue/getredash/redash/5357/763303124) ## 3. Setting mail server ### 3.1 Google帳戶 `取得應用程式使用密碼` 透過gmail 發送,需開啟程式使用email權限及使用密碼 | 步驟 | 圖示 | | ---- | ------------------------ | | 右上角`應用程式icon`|<img src="https://i.imgur.com/Bfw2UUe.png" width="30"> | |google 帳戶設定<img src="https://i.imgur.com/3rsgMPR.png" width="50"> | <img src="https://i.imgur.com/79U8qun.png" width="200">| | `安全性設定`<br>>`登入google`|<img src="https://i.imgur.com/ukg9jNU.png" width="200"><img src="https://i.imgur.com/beG2qAP.png" width="300">| | 開啟完`兩步驟驗證`後<br>>`應用程式密碼` || | 建立應用程式密碼`選取應用程式`<br>>`其他(自訂名稱)`<br>> 複製應用程式密碼 |<img src="https://i.imgur.com/MA6IR9U.png" width="300"><img src="https://i.imgur.com/DJwDnxx.png" width="300">| ### 3.2 設定 Redash Mail Server 為了使系統能夠發送電子郵件(用戶邀請,密碼重置,警報觸發時等等),您需要使用所使用的郵件服務器配置Redash。郵件服務器配置是使用環境變量完成的。如果您使用的是我們的圖像之一,則可以通過編輯`/opt/redash/env`文件來實現。 相關的配置變量是(請注意,並非所有變數都是必需的): `REDASH_MAIL_SERVER` (默認值:localhost) `REDASH_MAIL_PORT` (默認值:25) `REDASH_MAIL_USE_TLS` (默認值:false) `REDASH_MAIL_USE_SSL` (默認值:false) `REDASH_MAIL_USERNAME` (默認值:無) `REDASH_MAIL_PASSWORD` (默認值:無) `REDASH_MAIL_DEFAULT_SENDER` (發送電子郵件地址) #### 3.2.1 配置如下: ``` REDASH_MAIL_SERVER: "smtp.gmail.com" REDASH_MAIL_PORT: 587 REDASH_MAIL_USE_TLS: "true" REDASH_MAIL_USERNAME: "你的google帳號@gmail.com" REDASH_MAIL_PASSWORD: "剛拿到的16碼密碼不含任何符號" REDASH_MAIL_DEFAULT_SENDER: "no-reply@example.com" ``` ### 3.3 重啟 docker-compose ``` cd /opt/redash docker-compose up -d ``` <img src="https://i.imgur.com/rR6AJ5s.png" width="600"> ### 3.4 測試Email ``` docker-compose run --rm server manage send_test_mail ``` 沒有報錯誤,測試沒問題。 <img src="https://i.imgur.com/cJSTaFr.png" width="600"> # 新增使用者 | 步驟 | 圖示 | | ----- | -- | | 新增使用者 | <img src="https://i.imgur.com/6G7dlRZ.png" width="700"><img src="https://i.imgur.com/JYWBSD3.png" width="300"> | | 信箱收件> 設定帳戶 | <img src="https://i.imgur.com/ssrIFp6.png" width="600"> | | 透過複製 |<img src="https://i.imgur.com/Zo2ECW1.png" width="400"> <br>加上主址`192.168.5.78:5000`>><br>`192.168.5.78:5000/invite/IjQi.YErdkg.aVsggsgS.......` 來開通帳號|
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.