Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation without docker? #4528

Closed
guidopetri opened this issue Jan 8, 2020 · 10 comments
Closed

Installation without docker? #4528

guidopetri opened this issue Jan 8, 2020 · 10 comments

Comments

@guidopetri
Copy link
Contributor

The docker file listed uses a Postgres docker image. However, this somehow seems incompatible with having your own Postgres installation (it fails connecting).

Is it possible to install Redash without using Docker? I'm able to run npm install and npm run build, as well as run my own instance of Redis, but then I'm not sure which file/function to run to get Redash to start, since they all seem to refer to running inside a Docker container.

@susodapop
Copy link
Contributor

Hi @charlesoblack, we use Github for tracking bugs on the main repo. Please direct your question to our user forum. Thanks.

@guidopetri
Copy link
Contributor Author

Hi @susodapop , this is a bug on the main repo. There isn't enough documentation for a successful installation without using Docker.

@susodapop
Copy link
Contributor

There isn't enough documentation for a successful installation without using Docker.

Correct. Redash is intended for use with Docker. If you want to deploy without a container then the user forum is the right place to ask.

@guidopetri
Copy link
Contributor Author

I don't understand why a .md can't be added explaining what the requirements are and what to run to get Redash working. Do you not agree that this would only add to the project?

@guidopetri
Copy link
Contributor Author

Maybe (if you really want to only allow/endorse Redash via Docker) there could be a docker file that doesn't spin up its own Redis, Postgres, Nginx instances?

@arikfr
Copy link
Member

arikfr commented Jan 9, 2020

@charlesoblack it's not a bug, but a configuration issue and/or missing documentation.

While we would love to our documentation to be as comprehensive as possible we have out limits. To make things easy we provide cloud images (for AWS, GCE and DigitalOcean) and reference setup that can be used on any Ubuntu host.

But I'm pretty sure your issue can be resolved without switching from Docker.

However, this somehow seems incompatible with having your own Postgres installation (it fails connecting).

Is this a Postgres database you want to query using Redash or the one you want Redash to use for its own metadata?

@guidopetri
Copy link
Contributor Author

I've been following the reference setup and that's the only reason I got this far. I also had to follow the Dockerfile itself.

My issue is that I have a Nginx and PostgreSQL set up outside of docker, so instead of running another set of Nginx + PostgreSQL inside docker, I'd like for Redash to be able to use the already-set-up instances. I'm new to docker, but it doesn't seem like it's possible - and especially not without modifying the docker-compose.yml file.

Additionally (and this is more of a nitpicky thing), if I want to run Redash on a port different than 5000, what would I do? I'm unable to figure this out from the reference setup.

Thanks again for your help - I'm sure these are silly questions, but I do believe having them documented somewhere on the repo is useful to those of us who don't know how to use docker to its fullest extent.

@arikfr
Copy link
Member

arikfr commented Jan 9, 2020

I'll assume you're using this docker-compose.yml file: https://github.com/getredash/setup/blob/master/data/docker-compose.yml.

To run nginx on the host, you will need:

  1. Remove the nginx service definition in the Compose file:

https://github.com/getredash/setup/blob/cb47626b6823cbafac407b3e8991e97f53121f6e/data/docker-compose.yml#L44-L52

  1. Setup nginx on the host to proxy to localhost:5000. If you want to use a different port just change line 14 from 5000:5000 to use whatever port you want. The syntax is HOST:CONTAINER (i.e. port on the host and the port it maps to on the container). So to use port 5001 on the host you will change this to 5001:5000.

To use Postgres on the host, you should:

  1. Remove the Postgres service definition: https://github.com/getredash/setup/blob/cb47626b6823cbafac407b3e8991e97f53121f6e/data/docker-compose.yml#L38-L43. Remove the dependency: https://github.com/getredash/setup/blob/cb47626b6823cbafac407b3e8991e97f53121f6e/data/docker-compose.yml#L5.

  2. Add to /opt/redash/env a DATABASE_URL line which has the connection string to your Postgres server. Note that you will need to use the host's IP address there (instead of localhost). I think there is a hostname for the host, but I don't remember it.

I hope this helps.

@arikfr
Copy link
Member

arikfr commented Jan 9, 2020

Oh, and after you make the changes to the compose file, run docker-compose up -d again so it picks up the changes.

@guidopetri
Copy link
Contributor Author

Tips for anyone else who gets lost:

  • make sure you allow postgres connections from outside localhost (listen_addresses = '*' in postgresql.conf and edit pg_hba.conf according to your username/db, auth method and set ip range to 172.16.0.0/12 to enable any docker container to use it + check your firewall settings to allow that same ip range on your postgresql port)
  • before "finishing" setting up, run docker-compose run --rm server create_db to create the required database schema, then run docker-compose up -d to bring up the containers

Thanks for your help Arik.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants