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

Running indexer and block_scout_web on different pods #2026

Closed
eduardonunesp opened this issue May 25, 2019 · 6 comments
Closed

Running indexer and block_scout_web on different pods #2026

eduardonunesp opened this issue May 25, 2019 · 6 comments
Labels
Feature question Further information is requested waiting on feedback Waiting for original opener to respond if bug is fixed

Comments

@eduardonunesp
Copy link

We're running the Dockerized image of the blockscout, however, we would like to run the indexer on a docker host and the web interface on another docker host, I wonder if is possible to run the web interface without call the indexer and run the indexer alone on a different host.

I did a few experiments on the terminal, so in order to run the indexer only:

# If run without the iex -S mix the indexer process will not hold the process
mix cmd --app indexer iex -S mix

However when running a similar command for the web interface on another terminal like

mix cmd --app block_scout_web mix phx.server

Looks like the indexer is running twice, I would like to know how to run those process separately and running only one if necessary on different machines, thanks :)

@vbaranov vbaranov added Feature question Further information is requested waiting on feedback Waiting for original opener to respond if bug is fixed labels May 30, 2019
@vbaranov
Copy link
Member

vbaranov commented Jun 3, 2019

@eduardonunesp

Looks like the indexer is running twice

Why do you think so?

This way, that you've run indexer and web application, is absolutely correct for separate launch. When you stop indexer, the web application should work and no news blocks should appear in the db. This is what I see in my test with this setup.

@eduardonunesp
Copy link
Author

Actually, the indexer isn't running twice using the configuration above, I noticed that when run mix cmd --app block_scout_web mix phx.server on macOS even with Ctrl+C to cancel the process it still needs some killall beam.smp to completely remove the process.

So the configuration above works to run both separately, just a small thing that I noticed is when running both separately (index and web interface) the web interface blocks didn't update automatically, looks like the WebSocket is inactivated

@eduardonunesp
Copy link
Author

Hey @vbaranov thanks for your answer, are you able to reproduce the issue above?

@vbaranov
Copy link
Member

@eduardonunesp yes, I can confirm that websocket doesn't work in a separate launch. I've created an issue. We will try to fix a websocket in this case.

@eduardonunesp
Copy link
Author

@vbaranov that's great thanks for the feedback

@vbaranov
Copy link
Member

The issue with websocket was fixed #2449. Now it is possible to divide indexer and web application. It is managed by env vars:

To run web application without indexer:

export DISABLE_INDEXER=true

To run indexer only (without web app):

export DISABLE_WEBAPP=true

Reference https://app.gitbook.com/@poa/s/blockscout/for-developers/information-and-settings/env-variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature question Further information is requested waiting on feedback Waiting for original opener to respond if bug is fixed
Projects
None yet
Development

No branches or pull requests

2 participants