Comments (5)
Thank you for raising it. I will try to check what could be going wrong. Meanwhile, could you please tell me if 18137 is your application port on which 'user-service' is listening? Also, may I know what is the 'address' you are providing to consul when you are registering it?
from sarathi.
from sarathi.
Great! Lets say you registered the user-service with consul as:
consul.agent.service.register({ name: 'user-service', id: 'user-service-' + (Math.random()*1000), address: '<ipAddressOfService>' port: 18137 }, function(err) { if (err) throw err; });
Could you please tell me what is the value of in your case, if you are providing an address? If not, you should provide here IP the of container in which your user-service is running, you can get this IP by running docker inspect <containerId>
. If you have bound the container port on localhost by passing -p
parameter, you should pass your docker-host IP as service address to consul.
from sarathi.
I'll be closing this as 'not a bug', if you feel otherwise, please feel free to reopen and update.
from sarathi.
Just one quick suggestion here. In consul discovery strategy (in discoverInstances prototype), the serviceDiscovery.nodes should have the array of service details which should contain the following,
_.forEach(result, (serviceDetails) => {
instance.serviceDiscovery.nodes.push({
address: serviceDetails.Node.Address,
port: serviceDetails.Service.Port,
url: `http://${serviceDetails.Node.Address}:${serviceDetails.Service.Port}/`
});
});
I am using serviceDetails.Node.Address instead of serviceDetails.Service.Address. Because when you are running your application in docker the serviceDetails.Node.Address will the containers ip instead of instance ip. I got it working when i used the above instance ip instead of containers ip.
from sarathi.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sarathi.