Hi Carsten,

Thanks for your swift reply.

But that means, the procedure Adobe describes to correctly set up a standby 
instance on 
https://helpx.adobe.com/experience-manager/kb/how-to-setup-cold-standby-instance-in-AEM.html
 is not clear on this subject.

Is there *any* way you know to make this work?
Can I reset the state of the JCR installer so it picks up all config again?

Other thought is to change the components that really should not get active in 
standby mode to check the active runmode through the SlingSettings interface 
upon component start.
But that's quite a few, I'm thinking about components that start immediately, 
or components that are scheduled with a "scheduler.expression" 
(https://sling.apache.org/documentation/bundles/scheduler-service-commons-scheduler.html#scheduling-with-a-cron-expression)
 property. That way the component stays active for OSGi, but doesn't act 
because I programmed it to do so.

Too bad it renders this statement 
(https://sling.apache.org/documentation/bundles/sling-settings-org-apache-sling-settings.html#getting-the-run-modes-of-the-sling-instance-1)
 unusable:

> Getting run modes in this way is usually not needed, it's better to define 
> bundles or configurations that are only valid in specific run modes, rather 
> than making decisions in code based on run modes.

Kind regards

Wim

Op 30/07/2020 09:13 heeft Carsten Ziegeler <cziege...@apache.org> geschreven:

    Hi,

    the run mode "author" is sticky - once you start a AEM instance with
    that run mode it will continue to use it, regardless of what you specify
    on the next startup. So in your example, the run mode author is active
    for all three startups.

    Messing with the launchpad/config folder is not recommended as you can
    run in exactly the problems you describe. The OSGi installer (the main
    component used by the JCR installer) is not reverting changes done by
    other tools or humans. So what you describe is actually expected:

    When you manually remove configurations from launchpad/config and
    restart the instance (standby restart), the installer still has the
    state that it has installed the configurations previously. So it is not
    acting - this is the intended behaviour as the installer is not messing
    with changes done through other means (like this manual remove). And as
    "author" is a sticky run mode, the installer sees no change in the set
    of known configurations read from JCR.

    Similar on the next restart (without standby), the installer does not do
    anything. Again, author run mode still active, no change.

    Regards
    Carsten

    Am 30.07.2020 um 08:38 schrieb Wim Symons:
    > Hi all,
    >
    > After 2 weeks of waiting on Daycare to respond, I’m reaching out here,
    > as I think this is more Apache Sling related than AEM specific.
    >
    > I’m trying to successfully make an AEM primary author from a cold
    > standby author, but it fails.
    >
    > It fails because all our OSGi components with config bound to the
    > ‘author’ runmode doesn’t get installed after switching runmode.
    >
    > I looked at the source code, but it seems there is no way to trigger the
    > JcrInstaller to re-initialize all OSGi config stored in the repository.
    >
    > Is there any way to do that?
    >
    > A more detailed explanation of our process:
    >
    > You start by creating a standby author instance from a primary instance
    > (runmode “author” is active).
    >
    > The OSGi configuration for our components is stored in sling:OsgiConfig
    > nodes in the JCR below “config.author” folders.
    >
    > It is properly installed by the JCR Installer and the config files can
    > be found in the launchpad/config folder on disk.
    >
    > We shut down the instance, *and remove all our OSGi config from the
    > launchpad/config folder on disk*.
    >
    > We do that to avoid our components getting active in the standby runmode
    > as this is not wanted.
    >
    > The OSGi config stored in the launchpad/config folder on disk is used,
    > not the OSGi config from the JCR.
    >
    > I think this is **issue (1)**.
    >
    > We start the instance with runmode “standby”.
    >
    > All is fine, AEM is acting as a standby instance, and our components are
    > not active.
    >
    > We restart the instance, but now give it the runmode “author” again.
    >
    > We would expect all OSGi configuration from the sling:OsgiConfig nodes
    > below “config.author” folders would become installed by the OSGi
    > framework, but in fact, it does not.
    >
    > This is **issue (2)**.
    >
    > AEM acts as an author instance again, but all our components are not
    > active because they don’t have any OSGi config (launchpad/config is 
empty).
    >
    > How can I fix this?
    >
    > Or is this a situation Apache Sling can’t handle?
    >
    > Kind regards,
    >
    > *Wim Symons
    > AEM Lead Architect
    > *Digital Production Center
    >
    >
    > wim.sym...@vrt.be <mailto:wim.sym...@vrt.be>
    > Auguste Reyerslaan 52
    > B-1043 Brussel
    >
    >
    > VRT logo <http://www.vrt.be/>
    >
    >
    > -- Disclaimer --
    > Vlaamse Radio- en Televisieomroeporganisatie
    > Auguste Reyerslaan 52
    > 1043 Brussel
    >
    > nv van publiek recht
    > BTW BE 0244.142.664
    > RPR Brussel
    > VRT Gebruikersvoorwaarden <http://www.vrt.be/gebruiksvoorwaarden >
    >

    --
    --
    Carsten Ziegeler
    Adobe Research Switzerland
    cziege...@apache.org


-- Disclaimer --
Vlaamse Radio- en Televisieomroeporganisatie
Auguste Reyerslaan 52
1043 Brussel

nv van publiek recht
BTW BE 0244.142.664
RPR Brussel
VRT Gebruikersvoorwaarden <http://www.vrt.be/gebruiksvoorwaarden>

Reply via email to