Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Connexus Digital 2 posts 82 karma points
    Jul 20, 2017 @ 11:03
    Connexus Digital
    0

    Sharing media across load balancers

    Hello, We currently have a website that is load balanced across 2 servers with one side of the load balancer also serving an admin site. We believe we have set everything up correctly with regards to publishing pages and we can confirm that changes are pushed out to the non admin sites. The problem we face is that media is uploaded through the admin site which means that the file physically exists only on one of the folder structures. The 2 non-admin sites however do not have that physical file in their folder structure which means they will not serve media. Is there something I'm missing here? Do I have to do something to get the file into the other sites or is there a setting to get the media from a specific site?

    Ideally we would like the media uploaded to all of the websites so that requests are load balanced properly.

    Thanks,

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Jul 21, 2017 @ 06:58
    Dave Woestenborghs
    100

    Hi,

    This is normal. The file are uploaded to the admin server and not on the front end servers.

    There are several optoins you can do.

    • Upload the files to a central location eg. Azure blob storage
    • Make sure files are accessible for all servers
    • Replicate the files to the front end servers

    Some more information can be found here : https://our.umbraco.org/documentation/Getting-Started/Setup/Server-Setup/load-balancing/flexible

    Dave

  • Connexus Digital 2 posts 82 karma points
    Jul 28, 2017 @ 12:16
    Connexus Digital
    0

    Thanks for the reply. I think we are going to go down the route of a file replication service running on the server that will copy files over every 2 minutes. I also found that if you edit the FileSystemProvider.config file to this then it will force Umbraco to get the media from the Admin site:

      <Provider alias="media" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
    <Parameters>
      <!-- Umbraco Default Path -->
      <!--Add this key to the ADMIN site only -->
      <add key="virtualRoot" value="~/media/" />
    
    
      <!-- ADD THESE KEYS TO THE LOAD BALANCED SITES ONLY -->
      <!-- ***** IT IS IMPERATIVE THAT YOU PROVIDE THE FULL PATH TO THE MEDIA FOLDER ***** -->
      <!--<add key="rootPath" value="\\MYSERVER\FULL-PATH-TO-THE-MEDIA-FOLDER"/>
      <add key="rootUrl" value="http://myadminumbracosite.co.uk/media" />-->
    </Parameters>
    

    Then the next thing you need to do is kill the media cache every 5 seconds on your non-admin sites.

Please Sign in or register to post replies

Write your reply to:

Draft