Redash 安装部署

介绍

是一款开源的BI工具,提供了基于web的数据库查询和数据可视化功能。

官网:https://redash.io/

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

 

环境选择

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

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

 

Ubuntu部署

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

执行完成后,访问http://ip:80

 

Centos部署

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

参考:https://redash.io/help-onpremise/dev/setup.html

系统环境:CentOS Linux release 7.4.1708 (Core) 

Redash版本:3.0.0

  • 初始化
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

 

posted @ 2018-02-05 15:19  shhnwangjian  阅读(21031)  评论(3编辑  收藏  举报