0

We have an microservices application with 5 stateless services

  1. eShopWeb
  2. eShopAPI
  3. eShopOrder
  4. eShopBasket and eShopPayments

We created an service fabrics cluster in azure with 3 nodes. Now we want to configure like as follows

  1. eShopWeb and eShopOrder need to run on node 1
  2. eShopAPI and eShopPayments needs to run on node 2
  3. eShopOrder needs to run on node 3.

How to achieve the above configuration to rum multiple micro services on same node

data rec
  • 35
  • 5

2 Answers2

1

You shouldn't care which node runs which service. By tying services to nodes you undermine the self-healing capabilities of SF (what if node 2 fails?). Also, you can't do rolling upgrades this way (except for eShopOrder).

I'd recommend avoiding placement constraints if you can. Unless you have multiple node types, or a large cluster.

Service affinity is for legacy services that are so chatty that they don't perform well when on separate nodes, because of latency in communication.

(And for production, you should use 5 nodes.)

LoekD
  • 11,402
  • 17
  • 27
0

You have two options here.

  1. Placement constraints. You can get details in this question. But I would not recommend this as natural balancing ability will be useless here.
  2. Service affinity. You can find more info here. It's when some services are on the same node as another. But be aware: this rule could be broken; read documentation carefully.

I would go with the second approach and see how it works at least in staging environment.

cassandrad
  • 3,412
  • 26
  • 50