建议使用mac和ubuntu系统,同事刚开始使用windows安装,过程当中遇到不少问题,改用ubuntu系统,本文适用mac和ubuntu系统。前端
官网建议使用虚拟机或Dockerpython
Windows users: while it should be possible to run Redash on a Windows machine, we don't know anyone who did this and lived to tell. We recommend using some sort of a virtual machine or Docker in such case.
https://github.com/getredash/...
如下安装过程使用master分支做为开发环境版本,release/6.0.x、release/7.0.0也适用。mysql
redash适用python2.7开发。git
本地安装pgsql并建立数据库,安装pgsql的过程此处省略,能够百度查下。github
修改redash下面settings/__init__.py数据库链接信息redis
Terminal运行表建立语句sql
./manage.py database create_tables数据库
过程读者能够百度查下,本地安装redis以后redash关于redis的配置不须要修改。npm
Terminal运行npm install
,install 完成后运行运行npm run watch
或者运行npm run build
ubuntu
celery若是不启动,在查询sql的时候,查询会一直处于等待状态。
celery worker --app=redash.worker --beat -Qscheduled_queries,queries,celery -c2
debug模式启动
celery worker --app=redash.worker --beat --loglevel=INFO -Qscheduled_queries,queries,celery -c2
启动成功后显示以下:
完成注册以后浏览data source
笔者在data source遇到个问题,安装完以后仅显示部分数据源,没有mysql,hive等。
经排查发现mysqldb,hive模块引入失败
运行pip install MySQLdb报以下错误Could not find a version that satisfies the requirement MySQLdb (from versions: )No matching distribution found for MySQLdb
能够参考篇文章https://blog.51cto.com/legeha...
Terminal运行
pip install MySQL-python
成功后显示以下:
笔者运行时本地已安装好mysql,同事使用Ubuntu,遇到了文章中一样的问题,本地环境没有安装mysql,安装mysql以后,运行 pip install MySQL-python,也顺利完成。
注意:MySQL-python 安装完成以后须要重启celery,不然在建立好数据源以后查询的时候会报以下错误:
Error running query: 'NoneType' object has no attribute 'annotate_query'
到此为止,redash安装成功。