介绍
是一款开源的BI工具,提供了基于web的数据库查询和数据可视化功能。
官网:
GitHub:
环境选择
官方支持的环境有 Ubuntu 16.04, AWS, Google Compute Cloud 和 Docker。
Ubuntu部署
wget https://raw.githubusercontent.com/getredash/redash/master/setup/ubuntu/bootstrap.shsudo chmod +x bootstrap.shsudo ./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)
参考:
系统环境:CentOS Linux release 7.4.1708 (Core)
Redash版本:3.0.0
- 初始化
yum update -yyum install -y gcc gcc-c++ cyrus-sasl-devel makeyum install -y pwgen python-devel python-pip supervisoryum install -y nginx curl wget redisyum install -y libffi-devel yum install -y mariadb-devel
- PostgreSQL 9.5安装、配置
yum install -y libpqxx-devel
- redis启动
systemctl start redis
- 目录和账号创建
mkdir -p /opt/redashadduser --system --no-create-home -s /sbin/nologin redashchown redash /opt/redash
- 包下载
cd /opt/redashsudo -u redash wget https://github.com/getredash/redash/archive/v3.0.0.tar.gzsudo -u redash tar xvf v3.0.0.tar.gzln -nfs /opt/redash/redash-3.0.0 /opt/redash/current
- 环境配置
pwgen -1s 32获取值,用于REDASH_COOKIE_SECRETvim /opt/redash/.envexport REDASH_LOG_LEVEL="INFO"export REDASH_REDIS_URL=redis://localhost:6379/0export REDASH_DATABASE_URL="postgresql:///redash"export REDASH_COOKIE_SECRET=RwQL7TTb9O5w0NKQAfu4eXE3tPVeqvvFln -nfs /opt/redash/.env /opt/redash/current/.env
- pip安装
cd /opt/redash/currentpip install --upgrade pippip install setproctitlevim /root/.bash_profile export PATH="/usr/pgsql-9.5/bin:$PATH"pip install psycopg2pip install -r requirements.txtpip install setuptools==3.4.4pip install -r requirements_all_ds.txt
- npm安装
curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -yum install -y nodejsnpm install -g cnpm --registry=https://registry.npm.taobao.orgcnpm installcnpm run build
- 数据库创建
sudo -u postgres createuser redash --no-superuser --no-createdb --no-createrolesudo -u postgres createdb redash --owner=redashsudo -u redash bin/run ./manage.py database create_tables
- supervisord配置
cp /opt/redash/current/setup/ubuntu/files/supervisord.conf /etc/supervisord.d/redash.inisystemctl 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
工作原理
参考:
配置介绍