Salesforce

For DXA 2.0, how to install the DXA_2.0.X hotfix for the Model service?

« Go Back

Information

 
TitleFor DXA 2.0, how to install the DXA_2.0.X hotfix for the Model service?
URL Name000009348
Summary
Scope/EnvironmentSDL Tridion Sites
Question
For DXA 2.0, how to install the DXA_2.0.X hotfix for the Model service?
Answer
The DXA_2.0.2 hotfix changes the way the DXA Model Service retrieves content. This is now retrieved via direct database access using CIL. As a result you must add a valid CD license file and configure the content data store in cd_storage_conf.xml.  (At the time this article was written, March 2019, 2.0.2 was the latest available version of the Model service.  The installation process should be the same even if the minor version changes).

The update also includes improvements to caching and use of CIL allows caches to be synchronized via the Cache Channel service. This requires Apache ActiveMQ or similar.

For example, to install the updated DXA Model Service to the empty existing folder C:\svc\dxa-model\
  1. Unzip and move contents to C:\svc\dxa-model\
    unzip dxa-model-service-inprocess-2.0.1.zip
    move dxa-model-service\standalone\* C:\svc\dxa-model\
  2. Copy the installer folder from the original DXA Model Service release:
    copy -r C:\temp\SDL.DXA.NET.2.0\cis\dxa-model-service\standalone\installer C:\svc\dxa-model\
  3. Rename C:\svc\dxa-model\services\model-service-in-process to C:\svc\dxa-model\services\model-service
    (Or edit the path in ..\installer\build.gradle, line 360: '../services/model-service')
    move C:\svc\dxa-model\services\model-service-in-process C:\svc\dxa-model\services\model-service
  4. Open C:\svc\dxa-model\config\cd_storage_conf.xml
  5. Add the database connection details. This should be the same database used by the Content Service.
  6. Check the cache settings and ensure the itemTypes to be cached are set correctly.
  7. Add license location:
    <License Location="c:\UDP\cd_licenses.xml"/>
  8. Add the below property to C:\svc\dxa-model\config\application.properties. This is a workaround for a bug in Ehcache.
    org.ehcache.statisticsExecutor.poolSize=1
  9. Edit start.ps1 / start.sh and add the below JVM options (all on one line). You should have some of these options set already. These are known to work well, but you may still need to tune here. This sets the maximum memory used by the DXA Model Service to 8Gb. These settings are appropriate for the cache sizes in the ehcache.xml included with the DXA_2.0.2 hotfix.
    "-Xrs", "-Xms2048m", "-Xmx8192m", "-XX:+CMSScavengeBeforeRemark", "-XX:+CMSParallelRemarkEnabled", "-XX:+UseConcMarkSweepGC", "-XX:+UseCMSInitiatingOccupancyOnly", 
    "-XX:CMSInitiatingOccupancyFraction=70", "-XX:-UseLargePagesIndividualAllocation", "-XX:MaxTenuringThreshold=12", "-XX:NewRatio=3", "-XX:GCTimeRatio=80", "-XX:ParallelGCThreads=4"
  10. Edit C:\svc\dxa-model\config\logback.xml and add an appender named appender.cache:
    <appender name="appender.cache" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${log.folder}/dxa.cache.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>${log.history}</maxHistory>
        </rollingPolicy>
        <encoder>
            <charset>${log.encoding}</charset>
            <pattern>${log.pattern}</pattern>
        </encoder>
        <prudent>true</prudent>
    </appender>
  11. Run C:\svc\dxa-model\installer\prepare.bat to install the updated DXA Model Service. It's not necessary to re-register if it was already installed previously with the same URL.
    cd C:\svc\dxa-model\installer\
    prepare.bat
Reference
Attachment 1 
Attachment 2 
Attachment 3 
Attachment 4 
Attachment 5 

Powered by