windows安装redash

上一篇讲了windows安装docker

redash是什么?是一个非常高大上的报表系统,基本上能满足大不多说的业务使用场景。支持SQL和python脚本。哇咔咔,这是相当的强大滴

安装这个目的其实就是为了装redash,配置开发环境太麻烦了,而且总遇到各种奇怪的问题。所以还是先把项目跑起来再说

第一步:下载项目

git clone https://github.com/getredash/redash

第二步:进入目录

cd c:\redash

第三步修改

# This configuration file is for the **development** setup.
version: '3.2'
# For a production example please refer to getredash/setup repository on GitHub.
services:
  server:
    image: redash/redash:latest
    command: server
    depends_on:
      - postgres
      - redis
    ports:
      - "5000:5000"
    environment:
      PYTHONUNBUFFERED: 0
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
      REDASH_COOKIE_SECRET: "Q422k6vaXUk8"
      REDASH_WEB_WORKERS: 4
    restart: always
  worker:
    image: redash/redash:latest
    command: scheduler
    environment:
      PYTHONUNBUFFERED: 0
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
      REDASH_COOKIE_SECRET: "Q422k6vaXUk8"
      QUEUES: "queries,scheduled_queries,celery"
      WORKERS_COUNT: 2
    restart: always
  redis:
    image: redis:3.0-alpine
    restart: always
  postgres:
    image: postgres:9.5.6-alpine
    # volumes:
    #   - /opt/postgres-data:/var/lib/postgresql/data
    restart: always
  nginx:
    image: redash/nginx:latest
    ports:
      - "8889:80"
    depends_on:
      - server
    links:
      - server:redash
    restart: always

这里注意端口占用情况,前面的是外部映射的端口,后面的是容器的端口例如:8889:80  8889是电脑的端口,80是容器的端口。

好了,执行安装和启动

docker-compose run --rm server create_db
docker-compose up -d

为了更友好的访问,配置下nginx的映射吧

	server {
        listen       80;
		server_name  redash.oe.com;

        keepalive_timeout  120;

        client_max_body_size 50m;
		location /{
			proxy_http_version  1.1;
			proxy_connect_timeout 1;
			proxy_send_timeout 30;
			proxy_read_timeout 60;
			proxy_set_header Upgrade $http_upgrade;
			proxy_set_header Connection "upgrade";
			proxy_set_header Host $http_host;
			proxy_set_header X-Forwarded-Host $http_host;
			proxy_set_header X-Real-IP $remote_addr;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header Origin '';
			proxy_pass http://127.0.0.1:8889;
		}
    }

修改下host随便映射

127.0.0.1 redash.oe.com

重启nginx,访问redash.oe.com即可

至于二次开发,等我再研究研究

你可能感兴趣的:(redash)