Memcached endpoint for RHDG 8

Solution Verified - Updated

Environment

  • Red Hat Data Grid (RHDG)
    • 8
  • OpenShift

Issue

  • We use memcached together with golang but miss the memcached for RHDG8, what is the reason?
  • Memcached has been deprecated in the release notes of 8.0.0, what is the reason?
  • Is it possible to use memcached with RHDG 8.0?
  • Memcached is not enabled for the RHDG8 image and Operators in OpenShift environment, is it possible to use it and how to configure it?

Resolution

The legacy implementation of memcache has been deprecated and will be replaced in a future major release because of missing security and utilization of the text protocol without improvements.
With Data Grid 8.5 the better meta memcached protocol which supports SSL/TLS security will be implemented, see This content is not included.JDG-3874 for more details.

Instead of memcached the REST protocol can be used for most of the cases and REST is well tested and fully supported.

To reactivate the memcached endpoint the following configuration can be added to infinispan.xml.
The Operator is designed to favour usage simplicity.
Consider that the endpoint might be removed in future releases.

<cache-container name="default" statistics="true">
   ...
   <distributed-cache name="memcachedCache"/>  <!-- this is the default name for memcache endpoint -->
</cache-container>

<socket-bindings default-interface="public" port-offset="${infinispan.socket.binding.port-offset:0}">
   ...
   <socket-binding name="memcached" port="11221"/>
</socket-bindings>

<endpoints> 
   <endpoint socket-binding="default" security-realm="default">
      ...
      <memcached-connector name="memcached" socket-binding="memcached"/>  <!--  with attribute cache the cache can be named different -->
   </endpoint>
</endpoints>

Data Grid Operator

Memcached is unavailable in the DG Operator.
Although one could set a config-map with memcached ports, and create service to set it up, creating a service is not sufficient. Since the port needs to be exposed on the StatefulSet pod definition as well, which is controlled by the Operator, which would then require the Operator to be disabled for this to be accomplished.
For these cases, Helm Charts are a better fit as the Memcached endpoint can easily be exposed.

RESP (Redis) protocol

With RHDG 8.4 the RESP3 protocol is available as Tech Preview, is now fully supported with RHDG 8.5.

Root Cause

The implemented memcached in RHDG7 is using the text protocol without security features and it was not used often.

Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.