Redash 安裝部署

介紹

是一款開源的BI工具,提供了基於web的數據庫查詢和數據可視化功能。html

官網:https://redash.io/node

GitHub:https://github.com/getredash/redashpython

 

環境選擇

官方支持的環境有 Ubuntu 16.04, AWS, Google Compute Cloud 和 Docker。nginx

https://redash.io/help-onpremise/setup/setting-up-redash-instance.htmlc++

 

Ubuntu部署

wget https://raw.githubusercontent.com/getredash/redash/master/setup/ubuntu/bootstrap.sh
sudo chmod +x bootstrap.sh
sudo ./bootstrap.sh

執行完成後,訪問http://ip:80git

 

Centos部署

依賴:Python (2.7), PostgreSQL (9.3 or newer), Redis (2.8.3 or newer) and Node.js (v6 or newer)github

參考:https://redash.io/help-onpremise/dev/setup.htmlweb

系統環境:CentOS Linux release 7.4.1708 (Core) redis

Redash版本:3.0.0sql

  • 初始化
yum update -y
yum install -y gcc gcc-c++ cyrus-sasl-devel make
yum install -y pwgen python-devel python-pip supervisor
yum install -y nginx curl wget redis
yum install -y libffi-devel 
yum install -y mariadb-devel
  • PostgreSQL 9.5安裝、配置

http://www.cnblogs.com/shhnwangjian/p/8392050.html

yum install -y libpqxx-devel
  • redis啓動
systemctl start redis
  • 目錄和帳號建立
mkdir -p /opt/redash
adduser --system --no-create-home -s /sbin/nologin redash
chown redash /opt/redash
  • 包下載
cd /opt/redash
sudo -u redash wget https://github.com/getredash/redash/archive/v3.0.0.tar.gz
sudo -u redash tar xvf v3.0.0.tar.gz
ln -nfs /opt/redash/redash-3.0.0 /opt/redash/current
  • 環境配置
pwgen -1s 32獲取值,用於REDASH_COOKIE_SECRET

vim /opt/redash/.env
export REDASH_LOG_LEVEL="INFO"
export REDASH_REDIS_URL=redis://localhost:6379/0
export REDASH_DATABASE_URL="postgresql:///redash"
export REDASH_COOKIE_SECRET=RwQL7TTb9O5w0NKQAfu4eXE3tPVeqvvF

ln -nfs /opt/redash/.env /opt/redash/current/.env
  • pip安裝
cd /opt/redash/current
pip install --upgrade pip
pip install setproctitle

vim /root/.bash_profile 
export PATH="/usr/pgsql-9.5/bin:$PATH"

pip install psycopg2
pip install -r requirements.txt
pip install setuptools==3.4.4
pip install -r requirements_all_ds.txt
  • npm安裝
curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
yum install -y nodejs
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install
cnpm run build
  • 數據庫建立
sudo -u postgres createuser redash --no-superuser --no-createdb --no-createrole
sudo -u postgres createdb redash --owner=redash
sudo -u redash bin/run ./manage.py database create_tables
  • supervisord配置
cp /opt/redash/current/setup/ubuntu/files/supervisord.conf /etc/supervisord.d/redash.ini
systemctl start supervisord
  • Nginx配置
cp /opt/redash/current/setup/ubuntu/files/nginx_redash_site /etc/nginx/conf.d/nginx_redash_site.conf
修改/etc/nginx/conf.d/nginx_redash_site.conf中端口爲8080

頁面訪問http://ip:8080

 

工做原理

參考:https://zhuanlan.zhihu.com/p/31292944

 

 

配置介紹

https://redash.io/help-onpremise/setup/settings-environment-variables.html

相關文章
相關標籤/搜索