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

nelson.cli in other cotainer #3

Open
antonionardella opened this issue Dec 22, 2017 · 8 comments
Open

nelson.cli in other cotainer #3

antonionardella opened this issue Dec 22, 2017 · 8 comments

Comments

@antonionardella
Copy link

antonionardella commented Dec 22, 2017

Hello Roman,

I'm again trying to build a docker-compose file.
My setup:

  • docker server IP 10.0.0.x
    • 4 containers:
      • iri
      • nelson.cli with hostname=nelson.cli
      • nelson.mon with hostname=nelson.mon
      • nelson.gui with hostname=nelson.gui

nelson.mon is connecting to nelson.cli:18600 and works fine.
nelson.gui runs on 10.0.0.x:5000 and can ping nelson.cli if I'm inside the cotainer, but is not able to connect to nelson.cli:18600. I've also tried: http://10.0.0.x:5000/nelson.cli/18600, with no success.

From what I understand (please bear with me, I'm not a developer), the nelson.gui is trying to connect to localhost:18600 through my browser, therefore cannot see the server. If i go to http://10.0.0.x:5000/nelson.cli/18600 it's still my browser trying to connect to nelson.cli.
My browser is running on my notebook, while nelson.cli is running on my server and my notebook doesn't know anything about nelson.cli.
This means that the nelson.gui is not talking to nelson.cli, but my notebook is, this may never work for similar setups. Please tell me if I'm wrong with this assumption.

To make it work, I had to give nelson.cli a public hostname like nelsoncli.mydomain.com and modify /src/redux/nelson-api.js to point to this url.
At this point the nelson.gui started working.

Is this by design or am I just hacking around in the blind and there is an easier way?

Thanks,
Antonio

@romansemko
Copy link

romansemko commented Dec 22, 2017

Hi Antonio, you have to run nelson.cli with "--apiHostname 0.0.0.0" so that it listens to non-local connections.

Then you run nelson.gui and access it in your browser like:

http://<nelson-gui-host-or-ip>:<nelson-gui-port>/<nelson-cli-host-or-ip>/<nelson-cli-api-port>

@antonionardella
Copy link
Author

antonionardella commented Dec 22, 2017

Hi,

my nelson.cli is running on 0.0.0.0 inside a docker container with hostname nelson.cli, nelson.mon is working with this setup.

But from my understanding nelson.gui if I set http://SERVERIP:5000/nelson.cli/18600 makes my browser which run on my notebook (not server), try to connect to the host nelson.cli.
The notebook does not know this host, since it is a docker container on the server and therefore not reachable from the outside.
The nelson.cli is reachable from the server instance, that is why nelson.mon works if it points to nelson.cli.

All the best,
Antonio

@romansemko
Copy link

Then, instead of "nelson.cli" you have to use your server ip: http://SERVERIP:5000/SERVERIP/18600

@antonionardella
Copy link
Author

OMG, of course.. that's clear! Thanks again!

@antonionardella
Copy link
Author

Sorry, have to reopen it.
Curl is working, the nelson.gui is not:
https://imgur.com/a/0wn7w

@romansemko
Copy link

This IP address looks like an internal/local address. Is your browser running on a machine in the same network so it knows how to access that IP?

@antonionardella
Copy link
Author

Yes, the browser has access to that IP.
Today after updating the docker images it works like a charm!

@antonionardella
Copy link
Author

Hi,

I've tried with the new version and added username and password.
Tried the following links:

http://antonionardella.eu:5000/antonionardella.eu/18600/#/nelsonuser:nelsonpass

gives:

Cannot GET /antonionardella.eu/18600/

This one:

http://antonionardella.eu:5000/#/nelsonuser:nelsonpass/antonionardella.eu/18600/

Gives a blank page.

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

2 participants