Data Grid での RESP プロトコルエンドポイントの使用

Red Hat Data Grid 8.4

Data Grid RESP エンドポイントを使用してリモートキャッシュと対話する

Red Hat Customer Content Services

概要

RESP エンドポイントを使用すると、Redis クライアントは、Data Grid でサポートされている 1 つ以上の RESP サーバーに接続し、キャッシュ操作を実行できます。

Red Hat Data Grid

Data Grid は、高性能の分散型インメモリーデータストアです。

スキーマレスデータ構造
さまざまなオブジェクトをキーと値のペアとして格納する柔軟性があります。
グリッドベースのデータストレージ
クラスター間でデータを分散および複製するように設計されています。
エラスティックスケーリング
サービスを中断することなく、ノードの数を動的に調整して要件を満たします。
データの相互運用性
さまざまなエンドポイントからグリッド内のデータを保存、取得、およびクエリーします。

Data Grid のドキュメント

Data Grid のドキュメントは、Red Hat カスタマーポータルで入手できます。

Data Grid のダウンロード

Red Hat カスタマーポータルで Data Grid Software Downloads にアクセスします。

注記

Data Grid ソフトウェアにアクセスしてダウンロードするには、Red Hat アカウントが必要です。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。まずは、マスター (master)、スレーブ (slave)、ブラックリスト (blacklist)、ホワイトリスト (whitelist) の 4 つの用語の置き換えから始めます。この取り組みは膨大な作業を要するため、今後の複数のリリースで段階的に用語の置き換えを実施して参ります。詳細は、Red Hat CTO である Chris Wright のメッセージ を参照してください。

第1章 RESP エンドポイントの使用

Data Grid サーバーには、RESP3 プロトコル を実装する実験的なモジュールが含まれています。RESP エンドポイントを使用すると、Redis クライアントは 1 つまたは複数の Data Grid がサポートする RESP サーバーに接続し、キャッシュ操作を実行できます。

重要

RESP プロトコルエンドポイントは、テクノロジープレビュー機能として利用できます。

1.1. テクノロジープレビュー

テクノロジープレビュー機能は、Red Hat の実稼働環境でのサービスレベルアグリーメント (SLA) ではサポートされておらず、機能的に完全でない可能性があります。

Red Hat は、テクノロジープレビュー機能の実稼働環境での使用を推奨していません。この機能により、近日発表予定の製品機能をリリースに先駆けてご提供でき、お客様は開発プロセス時に機能をテストして、フィードバックをお寄せいただくことができます。

詳細は、テクノロジープレビュー機能のサポート範囲 を参照してください。

1.2. RESP エンドポイントの有効化

resp-connector を Data Grid サーバー設定に追加して、RESP エンドポイントを有効にします。次の方法で RESP エンドポイントを有効にできます。

  • スタンドアロンの Data Grid サーバーデプロイメントは、各サーバーインスタンスが互いに独立して実行されるスタンドアロンの Redis とまったく同じです。
  • サーバーインスタンスが相互にデータを複製または分散する、クラスター化された Data Grid サーバーデプロイメント。クラスター化されたデプロイメントは、クライアントにフェイルオーバー機能を提供します。

前提条件

  • Data Grid Server をインストールします。

手順

  1. Data Grid Server 設定を開いて編集します。
  2. 必要に応じて、キャッシュ設定を cache-container セクションに追加します。

    キャッシュ設定では、RESP プロトコルに違反する機能を有効にすることはできません。たとえば、RESP エンドポイントのキャッシュに有効期限の値を指定すると、起動時に致命的なエラーが発生します。

    ヒント

    Data Grid コンソールでキャッシュエントリーを表示する場合は、キャッシュを Protobuf エンコーディングで設定します (encoding media-type="application/x-protostream")。

  3. 設定に endpoint 宣言を追加します。
  4. resp-connector 要素を追加し、cache 属性を使用して RESP コネクターで使用するキャッシュの名前を指定します。

    RESP エンドポイントで使用できるキャッシュは 1 つだけです。

  5. 必要に応じて、security-realm 属性を使用して、RESP エンドポイントで使用するセキュリティーレルムを宣言します。
  6. エンドポイント宣言で Hot Rod および REST コネクターも追加されていることを確認してください。
  7. 変更を設定に保存します。

検証

Data Grid サーバーを起動するときに、次のログメッセージを確認します。

[org.infinispan.SERVER] ISPN080018: Started connector Resp (internal)

Redis クライアントを使用して RESP エンドポイントに接続できるようになりました。たとえば、Redis CLI を使用すると、次のようにしてエントリーをキャッシュに追加できます。

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
RESP エンドポイント設定

XML

<endpoints>
  <endpoint socket-binding="default" security-realm="default">
    <resp-connector cache="mycache" />
    <hotrod-connector />
    <rest-connector/>
  </endpoint>
</endpoints>

JSON

{
  "server": {
    "endpoints": {
      "endpoint": {
        "socket-binding": "default",
        "security-realm": "default",
        "resp-connector": {
          "cache": "mycache"
        },
        "hotrod-connector": {},
        "rest-connector": {}
      }
    }
  }
}

YAML

server:
  endpoints:
    endpoint:
      socketBinding: "default"
      securityRealm: "default"
      respConnector:
        cache: "mycache"
      hotrodConnector: ~
      restConnector: ~

1.3. Redis コマンド

Data Grid RESP エンドポイントは、次の Redis コマンドを実装します。

法律上の通知

Copyright © 2024 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.