microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.01k stars 399 forks source link

Scale Docker Container #130

Open vany0114 opened 6 years ago

vany0114 commented 6 years ago

Hi guys,

I wanted to ask what is the best way to scale Docker containers in Service Fabric, I mean, I want to gain density per node, having multiple instances of the same container per node, but I only was able to scale one instance per node. I tried to partition the service but it didn't work, so I went with SingletonParition, but I really would like to have multiple instances of the same container per node.

Thanks in advance.

anmolah commented 6 years ago

@vany0114 increasing the number of partitions for your service or increasing the number of services should solve this for you. Why did partitioning the service not work ?

vany0114 commented 6 years ago

I don't know, I haven't able to figure it out. I have a cluster with 5 nodes, and this is the configuration for one of the service, in this case, I'm trying to deploy at least 2 instances (PartitionCount="2" ) per node.

<Service Name="Invoice" ServicePackageActivationMode="ExclusiveProcess">
      <StatelessService ServiceTypeName="InvoiceType" InstanceCount="[Invoice_InstanceCount]">
        <UniformInt64Partition PartitionCount="2" LowKey="1" HighKey="5" />
      </StatelessService>
</Service>

I have serveral erros: 2018-05-21_19-48-29 2018-05-21_19-43-27 2018-05-21_19-30-17

I really would appreciate your help

masnider commented 5 years ago

Depending on how your docker container is actually set up regarding networking and communication, the most common issue that causes this is a port conflict, where both container instances are trying to claim the same host port. @vany0114 did you ever get this sorted out?

vany0114 commented 5 years ago

No yet @masnider, and yeah, effectively it was a port conflict, I had a container which runs a web api thru a static port, let's say 5080, so I can't create several containers in the same node running over the same port, so I think I would need a reverse proxy to do that. So, you guys have some example showing how to use the SF reverse proxy to achieve that?