Copied to clipboard

Flag this post as spam?

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


  • Simon Dingley 1470 posts 3427 karma points c-trib
    Jun 01, 2018 @ 09:38
    Simon Dingley
    0

    Comparison of Examine Indexes Between Servers in Load Balanced Environment

    I have a load balanced site (2 servers) and occasionally, for reasons currently unknown, the search index on the slave node might lose content and stop returning the results it should.

    When I look at the Index directory in the Temp folder after this is brought to my attention it looks very much like it was starting to rebuild the index and stopped. Nothing of any interest in the logs and it's not a regular occurrence but is cause for concern at the moment due to a critically important time for the site and in particular the data that disappears.

    The data is in an Index of its own and the configuration looks like this:

    ExamineIndex.config

    <IndexSet SetName="AwardIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/{machinename}/Award/">
        <IndexAttributeFields>
            <add Name="id" />
            <add Name="nodeName" />
            <add Name="updateDate" />
            <add Name="writerName" />
            <add Name="path" />
            <add Name="nodeTypeAlias" />
            <add Name="parentID" />
        </IndexAttributeFields>
        <IncludeNodeTypes>
            <add Name="Award" />
        </IncludeNodeTypes>
    </IndexSet>
    

    ExamineSettings.config

    ExamineIndexProvider

    <add name="AwardIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
       supportUnpublished="false"
       supportProtected="false"
       interval="10"
       analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>
    

    ExamineSearchProvider

    <add name="AwardSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
         analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" enableLeadingWildcards="true"/>
    

    What I am looking to do is to somehow get notified when the index gets into this state and looking for some ideas.

    My thoughts at the moment are to perhaps implement something in a similar fashion the lastsync file and write a index document count to file on disk and then perform some sort of comparison between the file on each server.

    Obviously, this is a short-term solution as I would like to identify and fix the problem at source but if anyone has any ideas in the meantime I'd appreciate any input.

    Thanks, Simon

  • Phil Atkinson 51 posts 244 karma points
    Jun 01, 2018 @ 11:17
    Phil Atkinson
    0

    2 solutions I know of:

    1. a custom healthcheck endpoint that checkes indexes (we use this), if they go unhealthy the box is binned and replaced with a fresh one, which will build its cache fresh on boot.

    2. I saw a dashboard add-on for the backoffice that shows this information from all your servers in one location so you can monitor, and then rebuild the index at a push of a button.

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Jun 01, 2018 @ 11:56
    Simon Dingley
    0

    Hi Phil,

    Thanks for your input.

    1. That was something I considered but then I was not sure how from a Health Check I can independently check the status of indexes on each server - would it not only check the index on the server executing the HealthCheck (which would always be the same, master node)? Is your solution something you would care to share more information on?

    2. Any ideas what the name of the package was? The more I am coming up against challenges relating to the state of the load balanced server instances the more I am thinking it is actually a necessity to have something like that. At the moment there is a lot of manual file comparisons between the servers which is not ideal or efficient.

    Cheers, Simon

  • Phil Atkinson 51 posts 244 karma points
    Jun 01, 2018 @ 11:57
    Phil Atkinson
    0

    we have aws fire the healthcheck on all servers (master and slaves)

    https://github.com/CrumpledDog/ExamineDistributedDashboard

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Jun 01, 2018 @ 13:58
    Simon Dingley
    0

    Thanks, I'll take a look. I'm not using AWS but I'm guessing the principle still applies to other environments.

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Jun 01, 2018 @ 14:16
    Dave Woestenborghs
    0

    Hi Somon,

    Are you running on Azure web apps. I think you need to update your Examine configuration then.

    https://our.umbraco.org/documentation/Getting-Started/Setup/Server-Setup/azure-web-apps#best-practices

    Dave

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Jun 01, 2018 @ 14:42
    Simon Dingley
    0

    Hi Dave,

    No, surprising as it might be these days I am in fact running managed servers that are not on AWS or Azure or any of that sort of black magic :)

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Jun 01, 2018 @ 15:01
    Dave Woestenborghs
    0

    Are you handling some CacheRefresher events in your code. We had a issue in one of ours that stopped the "slave" servers from updating.

    Dave

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Jun 01, 2018 @ 15:04
    Simon Dingley
    0

    Not really, we touched on that in another thread the other day:

    See Distributed cache lastsync value on the master instance is behind the slave

    It has been fine for the past few days so not sure what caused it last time.

    EDit: The two may well be related though!

Please Sign in or register to post replies

Write your reply to:

Draft