Documentation Center

Setting up caching nodes and microservice clients for Content Delivery embedded caching

Embedded caching on the server is handled through the Content Deployer and through the Content Service. Both services contain Ignite libraries and appear as Ignite nodes in an Ignite cluster. By default, both Ignite nodes act as servers joined in a cluster, storing cached entities and performing computational tasks. You can change this default setup in several ways, according to your preferences.

About this task

The default, out-of-the-box implementation requires additional microservice memory to store the cache. You may not want to use that much memory in your microservice(s). To counteract this problem, set up a separate standalone Ignite cluster (acting as a server), and have one or both services act as clients of that cluster.

Procedure

  1. To set up a standalone Ignite cluster to act as server, download the Ignite ZIP file to a server from the following URL: https://dlcdn.apache.org/ignite/2.15.0/apache-ignite-2.15.0-src.zip and unpack it to a directory of your choice.
  2. Under the libs/ directory of the Ignite root directory, create a subdirectory called lib/.
  3. Copy the following third-party libraries from the lib/ directory of either microservice to the libs/lib/ directory of the standalone Ignite instance:
    • The Hikari Connection Pool, HikariCP-VERSION.jar, where VERSION is the version of the library
    • Your Oracle of Microsoft SQL Server JDBC Driver
    • Your SLF4J API libraries, slf4j-api-VERSION.jar, where VERSION is the version of the library
    • The Content Delivery Ignite library, udp-common-ignite-VERSION.jar, where VERSION is the version of the library
  4. On the machine on which your Ignite server is installed, ensure the existence of an environment variable called USER_LIBS set to the location of your copied JARs, that is, IGNITEROOT\libs\lib, where IGNITEROOT is the Ignite server root directory.
  5. Make a backup copy of the file default-config.xml as found in the config/ subdirectory of the Ignite root directory.
  6. Overwrite the config/default-config.xml file with the contents of the config/cache-conf.xml file as found in your Content Service. In that file, you already configured the database in which to store cached entities, during installation.
  7. Designate this standalone Ignite instance as the server by ensuring that its config/default-config.xml contains this line:
    <property name="clientMode" value="false" />
  8. Designate one or both services as Ignite clients by ensuring that their config/cache-conf.xml files contain this line:
    <property name="clientMode" value="true" />
  9. If, after making these changes and restarting the affected services, you find that caching is not working as expected, you must restart your other nodes as well (Content Deployer and the Ignite server).