开发环境搭建步骤建议使用mac和ubuntu系统,同事刚开始使用windows安装,过程中遇到很多问题,临时改用ubuntu系统,本文适用mac和ubuntu系统。1.github获取代码及安装需要的python包https://github.com/getredash/…以下安装过程使用master分支作为开发环境版本,release/6.0.x也适用。2.修改Python解释器版本redash适用python2.7开发。3.创建application4.创建数据库并建表本地安装pgsql并创建数据库,安装pgsql的过程此处省略,可以百度查下。修改redash下面settings/init.py数据库连接信息Terminal运行表创建语句./manage.py database create_tables5.本地安装redis过程读者可以百度查下,本地安装redis之后redash关于redis的配置不需要修改。6.打包前端Terminal运行npm install,install 完成后运行运行npm run watch或者运行npm run build7.Terminal运行命令启动celerycelery如果不启动,在查询sql的时候,查询会一直处于等待状态。celery worker –app=redash.worker –beat -Qscheduled_queries,queries,celery -c2启动成功后显示如下:8.运行application完成注册之后浏览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安装成功。