Open NikHusachenko opened 6 months ago
UseLocalhostClustering Is made to connect on same computer one silo and one client for dev purpose. Orleans is not designed to pass in direct connection though part (client, silo, ...) except in specific local condition (For dev).
With the docker compose you create a virtual network where every container have a virtual IP in it like theire was on separate computer.
You can: 1) Orlean Way: Use a db image and the nuget package associate to provide a meeting point
2) You can change to gateway to redirect docker localhost to the computer one instead on the docker one. It will by pass the docker virtual network for localhost connection.
Attention: Solution 2 will only work with One silo.
Orleans is designed to use a DB a meeting point for cluster nodes (Silo) and/or clients. Through docker it's easy to have one. PS: Sometime the client close because it can connect to any silo. I advise you to delay the client start to prevent it
@MickaelThumerel
The host.docker.internal should be mentioned in the Orleans-Server? I am using UseDevelopmentClustering for the server? Should I mention host.docker.internal for the PrimarySiloEndpoint, insteand of IPAddress.Loopback or IPAddress.Any?
This host.docker.internal:host-gateway should be mentioned in the docker-compose, for the server container?
@cameliaonu => host.docker.internal for the PrimarySiloEndpoint, insteand of IPAddress.Loopback or IPAddress.Any : YES
It must be configured in both client and silo.
In the docker compose you must write the redirection as extra host. cf Docker Compose spec
for the AdvertisedIPAddress, i'm not sure of what is for. sorry
I try to deploy Silo client and silo server on Docker via docker-compose, but I get error that silo client cannot connect to other container on port 30000. I set upped containers for talking, and I can send simple http request from first project to second and get response. But I can't run project using Orleans. This is code for client:
Server code:
In the future I have to use UseRedisClustering instead a UseLocalhostClustering. This project successfully run in local PC, but in Docker I get exception ''Connection attempt to endpoint S127.0.0.1:30000:0 failed". This is Dockerfile.silo for server project:
And Dockerfile for client project:
And docker-compose:
As you are seen, all parts configured well, but I don't know why this doesn't work. Please, help me resolve this problem, because I did 250 container builds tries for last two days and can't solve this alone