Не удается подключиться к локальному хосту из redash - PullRequest
0 голосов
/ 27 августа 2018

Я пытаюсь подключиться к локальному postgres из Redash. (оба из redash.io и http://0.0.0.0:5000/), но не могут подключиться к нему. другие инструменты, которые я могу подключить localhost, но из Redash я получаю сообщение об ошибке:

 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?

Есть идеи, в чем может быть проблема? Я использую докер для локального Redash, что может вызвать проблему, но я получаю ту же ошибку и из redash.io.

Вот мой файл docker-compose:

# 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

Вы можете увидеть весь проект в этом репо . спасибо.

1 Ответ

0 голосов
/ 29 августа 2018

Изменено localhost на host.docker.internal чтобы заставить его работать.

...