Docker Community Forums

Share and learn in the Docker community.

IIS Container can not replicate in swarm cluster


(Andiit) #1

Hello there.

I have two Machines running WS 16. Have create a Swarm Cluster with One leader and one worker.

The problem is synchronization of IIS Container (created at leader) cant replicate in this cluster.

Steps:

  1. docker run -d -p 80:80 --ip=172.x.x.x --name IIStest microsoft/iis ping -t localhost

  2. at ther path of container \inetpub\test have create an index.htm (works ok at IP of Leader)

  3. create a service : docker service create --name=iis --replicas=1 --endpoint-mode=dnsrr --network=cluster --publish mode=host,target=80,published=80 microsoft/iis:latest

So index.htm of container at leader can not replicate to the worker, and also vice versa changes of index.htm

Please advise how to resolve container replication if one node goes down, and the configuration to be the same.


(Andiit) #2

I checked and executed the Simple example: Use configs in a Windows service in https://docs.docker.com/engine/swarm/configs/#example-rotate-a-config

1.Saved the following into a new file index.html. at C;\wwwtest folder

> <html>
>   <head><title>Hello Docker</title></head>
>   <body>
>     <p>Hello Docker! You have deployed a HTML page.</p>
>   </body>
> </html>

> 2. docker config create homepage C:\wwwtest\index.html
> 3. docker service create --name my-iis --publish published=80,target=81 --config src=homepage,target="\inetpub\wwwroot\index.html" microsoft/iis:nanoserver

PS C:\Windows\system32> docker service ps my-iis

ID NAME IMAGE NODE DESIRED STATE CURRENT STATE
ERROR PORTS
lzymikliicjc my-iis.1 microsoft/iis:nanoserver Win16-Node2 Running Running 16 mi
nutes ago

Checked the index.html file at container of Node 2 is a missing shortcut .symlink and 0 kb

From web browse the error: This site can’t be reached
Synchronization in cluster does not work!?

Please advice