Aither shows an approach how to bootstrap a microservice system in Node.js with Hemera 5 and docker. You can scale your worker in seconds and because we use NATS as “nervous system" for our distributed system we do not have to worry about service-discovery or load-balancing of hemera-services. We use traefik to load-balancing the api-gateway.
This configuration will setup:
- Hapi http server which act as api-gateway to the Hemera services.
- Microservice which is responsible to add two numbers.
- NATS server the underlying messaging system for Hemera.
- Jaeger CNCF Jaeger, a Distributed Tracing System.
- Natsboard dashboard to monitoring your NATS system in realtime.
- Traefik modern HTTP reverse proxy and load balancer made to deploy microservices with ease.
- Redis in memory cache for Hemera.
- Hapi 17
- Hemera 5
- Running the system
docker-compose up
- Start a request against load balancer OPEN
- Scale the system
docker-compose scale math-service=5 api=2
- Traefik http://localhost:8181/
- NATS Dashboard http://localhost:3000/
- NATS Endpoint http://localhost:8222/
- Jaeger http://localhost:16686/
npm install -g artillery
artillery run loadtest.yml
Print the html artillery report with artillery report <report.json>
thanks most of all to the community who create these awesome opensource software and thereby making it possible.