首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法从redash连接到localhost

无法从redash连接到localhost
EN

Stack Overflow用户
提问于 2018-08-28 02:05:00
回答 1查看 2.6K关注 0票数 2

我正在尝试从Redash连接到本地的postgres。(来自redash.io和http://0.0.0.0:5000/),但无法连接到它。一个我可以连接localhost的其他工具,但是从Redash我得到了错误:

代码语言:javascript
复制
 Connection Test Failed:
 could not connect to server: Connection refused Is the server running 
 on host "localhost" (::1) and accepting TCP/IP connections on port 
 5432? could not connect to server: Connection refused Is the server 
 running on host "localhost" (127.0.0.1) and accepting TCP/IP 
 connections on port 5432?

你知道问题出在哪里吗?我正在使用docker作为我本地的Redash,这可能会导致这个问题,但我也从redash.io那里得到了同样的错误。

这是我的docker-compose文件:

代码语言:javascript
复制
# This configuration file is for **development** setup. For production, refer to
# docker-compose.production.yml.
version: '2'
services:
  server:
    build: .
    command: dev_server
    depends_on:
      - postgres
      - redis
    ports:
      - "5000:5000"
    volumes:
      - ".:/app"
    environment:
      PYTHONUNBUFFERED: 0
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
  worker:
    build: .
    command: scheduler
    volumes_from:
      - server
    depends_on:
      - server
    environment:
      PYTHONUNBUFFERED: 0
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
      QUEUES: "queries,scheduled_queries,celery"
      WORKERS_COUNT: 2
  redis:
    image: redis:3.0-alpine
    restart: unless-stopped
  postgres:
    image: postgres:9.5.6-alpine
    # The following turns the DB into less durable, but gains significant performance improvements for the tests run (x3
    # improvement on my personal machine). We should consider moving this into a dedicated Docker Compose configuration for
    # tests.
    command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
    restart: unless-stopped

您可以在this repo中查看整个项目。谢谢。

EN

回答 1

Stack Overflow用户

发布于 2018-08-29 19:31:02

已将localhost更改为host.docker.internal以使其正常工作。

票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52044739

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档