此内容没有您所选择的语言版本。
Using the RESP protocol endpoint with Data Grid
Use the Data Grid RESP endpoint to interact with remote caches
Abstract
Red Hat Data Grid 复制链接链接已复制到粘贴板!
Data Grid is a high-performance, distributed in-memory data store.
- Schemaless data structure
- Flexibility to store different objects as key-value pairs.
- Grid-based data storage
- Designed to distribute and replicate data across clusters.
- Elastic scaling
- Dynamically adjust the number of nodes to meet demand without service disruption.
- Data interoperability
- Store, retrieve, and query data in the grid from different endpoints.
Data Grid documentation 复制链接链接已复制到粘贴板!
Documentation for Data Grid is available on the Red Hat customer portal.
Data Grid downloads 复制链接链接已复制到粘贴板!
Access the Data Grid Software Downloads on the Red Hat customer portal.
You must have a Red Hat account to access and download Data Grid software.
Making open source more inclusive 复制链接链接已复制到粘贴板!
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.
Chapter 1. Using the RESP endpoint 复制链接链接已复制到粘贴板!
Data Grid Server includes an experimental module that implements the RESP3 protocol. The RESP endpoint allows Redis clients to connect to one or several Data Grid-backed RESP servers and perform cache operations.
RESP protocol endpoint is available as a technology preview feature.
1.1. Technology Previews 复制链接链接已复制到粘贴板!
Technology Preview features or capabilities are not supported with Red Hat production service-level agreements (SLAs) and might not be functionally complete.
Red Hat does not recommend using Technology Preview features or capabilities for production. These features provide early access to upcoming product features, which enables you to test functionality and provide feedback during the development process.
For more information, see Red Hat Technology Preview Features Support Scope.
1.2. Enabling the RESP endpoint 复制链接链接已复制到粘贴板!
Add the resp-connector to Data Grid Server configuration to enable the RESP endpoint. You can enable the RESP endpoint with:
- Standalone Data Grid Server deployments, exactly like standalone Redis, where each server instance runs independently of each other.
- Clustered Data Grid Server deployments, where server instances replicate or distribute data between each other. Clustered deployments provides clients with failover capabilities.
Prerequisites
- Install Data Grid Server.
Procedure
- Open your Data Grid Server configuration for editing.
Add cache configuration to the
cache-containersection if required.Cache configuration cannot enable capabilities that violate the RESP protocol. For example, specifying expiration values in a cache for the RESP endpoint results in a fatal error at startup.
TipConfigure your cache with Protobuf encoding if you want to view cache entries in the Data Grid Console (
encoding media-type="application/x-protostream").-
Add an
endpointdeclaration to your configuration. Add the
resp-connectorelement and specify the name of the cache to use with the RESP connector with thecacheattribute.You can use only one cache with the RESP endpoint.
-
Declare the security realm to use with the RESP endpoint with the
security-realmattribute, if required. - Ensure that the endpoint declaration also adds a Hot Rod and REST connector.
- Save the changes to your configuration.
Verification
When you start Data Grid Server check for the following log message:
[org.infinispan.SERVER] ISPN080018: Started connector Resp (internal)
[org.infinispan.SERVER] ISPN080018: Started connector Resp (internal)
You can now connect to the RESP endpoint with a Redis client. For example, with the Redis CLI you can do the following to add an entry to the cache:
redis-cli -p 11222 --user username --pass password
redis-cli -p 11222 --user username --pass password
127.0.0.1:11222> SET k v OK 127.0.0.1:11222> GET k "v" 127.0.0.1:11222> quit
127.0.0.1:11222> SET k v
OK
127.0.0.1:11222> GET k
"v"
127.0.0.1:11222> quit
RESP endpoint configuration
XML
JSON
YAML
1.3. Redis commands 复制链接链接已复制到粘贴板!
The Data Grid RESP endpoint implements the following Redis commands: