blob: 52e2512072273007c42c1e08b70f96fc5e3e595e [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pegasus | Redis</title>
<link rel="stylesheet" href="/assets/css/app.css">
<link rel="shortcut icon" href="/assets/images/favicon.ico">
<link rel="stylesheet" href="/assets/css/utilities.min.css">
<link rel="stylesheet" href="/assets/css/docsearch.v3.css">
<script src="/assets/js/jquery.min.js"></script>
<script src="/assets/js/all.min.js"></script>
<script src="/assets/js/docsearch.v3.js"></script>
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>Redis | Pegasus</title>
<meta name="generator" content="Jekyll v4.3.3" />
<meta property="og:title" content="Redis" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Redis adaptation" />
<meta property="og:description" content="Redis adaptation" />
<meta property="og:site_name" content="Pegasus" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2024-04-22T13:02:52+00:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Redis" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","dateModified":"2024-04-22T13:02:52+00:00","datePublished":"2024-04-22T13:02:52+00:00","description":"Redis adaptation","headline":"Redis","mainEntityOfPage":{"@type":"WebPage","@id":"/api/redis"},"url":"/api/redis"}</script>
<!-- End Jekyll SEO tag -->
</head>
<body>
<div class="dashboard is-full-height">
<!-- left panel -->
<div class="dashboard-panel is-medium is-hidden-mobile pl-0">
<div class="dashboard-panel-header has-text-centered">
<a href="/">
<img src="/assets/images/pegasus-logo-inv.png" style="width: 80%;">
</a>
</div>
<div class="dashboard-panel-main is-scrollable pl-6">
<aside class="menu">
<p class="menu-label">The Pegasus documentation</p>
<ul class="menu-list">
<li>
<a href="/docs/downloads"
class="">
Downloads
</a>
</li>
</ul>
<p class="menu-label">Building Pegasus</p>
<ul class="menu-list">
<li>
<a href="/docs/build/compile-by-docker"
class="">
Compile by docker (recommended)
</a>
</li>
<li>
<a href="/docs/build/compile-from-source"
class="">
Compile from source
</a>
</li>
</ul>
<p class="menu-label">Client Libs</p>
<ul class="menu-list">
<li>
<a href="/clients/java-client"
class="">
Java Client
</a>
</li>
<li>
<a href="/clients/cpp-client"
class="">
C++ Client
</a>
</li>
<li>
<a href="https://github.com/apache/incubator-pegasus/tree/master/go-client"
class="">
Golang Client
</a>
</li>
<li>
<a href="/clients/python-client"
class="">
Python Client
</a>
</li>
<li>
<a href="/clients/node-client"
class="">
NodeJS Client
</a>
</li>
<li>
<a href="/clients/scala-client"
class="">
Scala Client
</a>
</li>
</ul>
<p class="menu-label">Tools</p>
<ul class="menu-list">
<li>
<a href="/docs/tools/shell"
class="">
Pegasus Shell
</a>
</li>
<li>
<a href="https://github.com/pegasus-kv/admin-cli"
class="">
Admin CLI
</a>
</li>
<li>
<a href="https://github.com/pegasus-kv/pegic"
class="">
Pegasus data access CLI
</a>
</li>
</ul>
<p class="menu-label">API</p>
<ul class="menu-list">
<li>
<a href="/api/ttl"
class="">
TTL(Time To Live)
</a>
</li>
<li>
<a href="/api/single-atomic"
class="">
Single-Atomic Operations
</a>
</li>
<li>
<a href="/api/redis"
class="is-active">
Redis Adaption
</a>
</li>
<li>
<a href="/api/geo"
class="">
GEO Support
</a>
</li>
<li>
<a href="/api/http"
class="">
HTTP API
</a>
</li>
</ul>
<p class="menu-label">Admin</p>
<ul class="menu-list">
<li>
<a href="/administration/deployment"
class="">
Deployment
</a>
</li>
<li>
<a href="/administration/config"
class="">
Configurations
</a>
</li>
<li>
<a href="/administration/rebalance"
class="">
Rebalance
</a>
</li>
<li>
<a href="/administration/monitoring"
class="">
Monitoring
</a>
</li>
<li>
<a href="/administration/rolling-update"
class="">
Rolling Restart and Upgrade
</a>
</li>
<li>
<a href="/administration/scale-in-out"
class="">
Scale-in and Scale-out
</a>
</li>
<li>
<a href="/administration/resource-management"
class="">
Resource Management
</a>
</li>
<li>
<a href="/administration/cold-backup"
class="">
Cold Backup
</a>
</li>
<li>
<a href="/administration/meta-recovery"
class="">
Metadata Recovery
</a>
</li>
<li>
<a href="/administration/replica-recovery"
class="">
Replica Data Recovery
</a>
</li>
<li>
<a href="/administration/zk-migration"
class="">
Zookeeper Migration
</a>
</li>
<li>
<a href="/administration/table-migration"
class="">
Table Migration
</a>
</li>
<li>
<a href="/administration/table-soft-delete"
class="">
Table Soft-Delete
</a>
</li>
<li>
<a href="/administration/table-env"
class="">
Table Environment Variables
</a>
</li>
<li>
<a href="/administration/remote-commands"
class="">
Remote Command
</a>
</li>
<li>
<a href="/administration/partition-split"
class="">
Partition-Split
</a>
</li>
<li>
<a href="/administration/duplication"
class="">
Duplication
</a>
</li>
<li>
<a href="/administration/compression"
class="">
Data Compression
</a>
</li>
<li>
<a href="/administration/throttling"
class="">
Throttling
</a>
</li>
<li>
<a href="/administration/experiences"
class="">
Experiences
</a>
</li>
<li>
<a href="/administration/manual-compact"
class="">
Manual Compact
</a>
</li>
<li>
<a href="/administration/usage-scenario"
class="">
Usage Scenario
</a>
</li>
<li>
<a href="/administration/bad-disk"
class="">
Bad Disk Repair
</a>
</li>
<li>
<a href="/administration/whitelist"
class="">
Replica Server Whitelist
</a>
</li>
<li>
<a href="/administration/backup-request"
class="">
Backup Request
</a>
</li>
<li>
<a href="/administration/hotspot-detection"
class="">
Hotspot Detection
</a>
</li>
</ul>
</aside>
</div>
</div>
<!-- main section -->
<div class="dashboard-main is-scrollable">
<nav class="navbar is-hidden-desktop">
<div class="navbar-brand">
<a href="/" class="navbar-item">
<!-- Pegasus Icon -->
<img src="/assets/images/pegasus-square.png">
</a>
<div class="navbar-item">
<!--A simple language switch button that only supports zh and en.-->
<!--IF its language is zh, then switches to en.-->
<a class="button is-light is-outlined is-inverted" href="/zh/api/redis"><strong></strong></a>
</div>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" data-target="navMenu">
<!-- Appears in mobile mode only -->
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div class="navbar-menu" id="navMenu">
<div class="navbar-end">
<!--dropdown-->
<div class="navbar-item has-dropdown is-hoverable">
<a href=""
class="navbar-link ">
<span>
The Pegasus documentation
</span>
</a>
<div class="navbar-dropdown">
<a href="/docs/downloads"
class="navbar-item ">
Downloads
</a>
</div>
</div>
<!--dropdown-->
<div class="navbar-item has-dropdown is-hoverable">
<a href=""
class="navbar-link ">
<span>
Building Pegasus
</span>
</a>
<div class="navbar-dropdown">
<a href="/docs/build/compile-by-docker"
class="navbar-item ">
Compile by docker (recommended)
</a>
<a href="/docs/build/compile-from-source"
class="navbar-item ">
Compile from source
</a>
</div>
</div>
<!--dropdown-->
<div class="navbar-item has-dropdown is-hoverable">
<a href=""
class="navbar-link ">
<span>
Client Libs
</span>
</a>
<div class="navbar-dropdown">
<a href="/clients/java-client"
class="navbar-item ">
Java Client
</a>
<a href="/clients/cpp-client"
class="navbar-item ">
C++ Client
</a>
<a href="https://github.com/apache/incubator-pegasus/tree/master/go-client"
class="navbar-item ">
Golang Client
</a>
<a href="/clients/python-client"
class="navbar-item ">
Python Client
</a>
<a href="/clients/node-client"
class="navbar-item ">
NodeJS Client
</a>
<a href="/clients/scala-client"
class="navbar-item ">
Scala Client
</a>
</div>
</div>
<!--dropdown-->
<div class="navbar-item has-dropdown is-hoverable">
<a href=""
class="navbar-link ">
<span>
Tools
</span>
</a>
<div class="navbar-dropdown">
<a href="/docs/tools/shell"
class="navbar-item ">
Pegasus Shell
</a>
<a href="https://github.com/pegasus-kv/admin-cli"
class="navbar-item ">
Admin CLI
</a>
<a href="https://github.com/pegasus-kv/pegic"
class="navbar-item ">
Pegasus data access CLI
</a>
</div>
</div>
<!--dropdown-->
<div class="navbar-item has-dropdown is-hoverable">
<a href=""
class="navbar-link ">
<span>
API
</span>
</a>
<div class="navbar-dropdown">
<a href="/api/ttl"
class="navbar-item ">
TTL(Time To Live)
</a>
<a href="/api/single-atomic"
class="navbar-item ">
Single-Atomic Operations
</a>
<a href="/api/redis"
class="navbar-item is-active">
Redis Adaption
</a>
<a href="/api/geo"
class="navbar-item ">
GEO Support
</a>
<a href="/api/http"
class="navbar-item ">
HTTP API
</a>
</div>
</div>
<!--dropdown-->
<div class="navbar-item has-dropdown is-hoverable">
<a href=""
class="navbar-link ">
<span>
Admin
</span>
</a>
<div class="navbar-dropdown">
<a href="/administration/deployment"
class="navbar-item ">
Deployment
</a>
<a href="/administration/config"
class="navbar-item ">
Configurations
</a>
<a href="/administration/rebalance"
class="navbar-item ">
Rebalance
</a>
<a href="/administration/monitoring"
class="navbar-item ">
Monitoring
</a>
<a href="/administration/rolling-update"
class="navbar-item ">
Rolling Restart and Upgrade
</a>
<a href="/administration/scale-in-out"
class="navbar-item ">
Scale-in and Scale-out
</a>
<a href="/administration/resource-management"
class="navbar-item ">
Resource Management
</a>
<a href="/administration/cold-backup"
class="navbar-item ">
Cold Backup
</a>
<a href="/administration/meta-recovery"
class="navbar-item ">
Metadata Recovery
</a>
<a href="/administration/replica-recovery"
class="navbar-item ">
Replica Data Recovery
</a>
<a href="/administration/zk-migration"
class="navbar-item ">
Zookeeper Migration
</a>
<a href="/administration/table-migration"
class="navbar-item ">
Table Migration
</a>
<a href="/administration/table-soft-delete"
class="navbar-item ">
Table Soft-Delete
</a>
<a href="/administration/table-env"
class="navbar-item ">
Table Environment Variables
</a>
<a href="/administration/remote-commands"
class="navbar-item ">
Remote Command
</a>
<a href="/administration/partition-split"
class="navbar-item ">
Partition-Split
</a>
<a href="/administration/duplication"
class="navbar-item ">
Duplication
</a>
<a href="/administration/compression"
class="navbar-item ">
Data Compression
</a>
<a href="/administration/throttling"
class="navbar-item ">
Throttling
</a>
<a href="/administration/experiences"
class="navbar-item ">
Experiences
</a>
<a href="/administration/manual-compact"
class="navbar-item ">
Manual Compact
</a>
<a href="/administration/usage-scenario"
class="navbar-item ">
Usage Scenario
</a>
<a href="/administration/bad-disk"
class="navbar-item ">
Bad Disk Repair
</a>
<a href="/administration/whitelist"
class="navbar-item ">
Replica Server Whitelist
</a>
<a href="/administration/backup-request"
class="navbar-item ">
Backup Request
</a>
<a href="/administration/hotspot-detection"
class="navbar-item ">
Hotspot Detection
</a>
</div>
</div>
</div>
</div>
</nav>
<nav class="navbar is-hidden-mobile">
<div class="navbar-start w-full">
<div class="navbar-item pl-0 w-full">
<!--TODO(wutao): Given the limitation of docsearch that couldn't handle multiple input,
I make searchbox only shown in desktop. Fix this issue when docsearch.js v3 released.
Related issue: https://github.com/algolia/docsearch/issues/230-->
<div id="docsearch"></div>
</div>
</div>
<div class="navbar-end">
<div class="navbar-item">
<!--A simple language switch button that only supports zh and en.-->
<!--IF its language is zh, then switches to en.-->
<a class="button is-light is-outlined is-inverted" href="/zh/api/redis"><strong></strong></a>
</div>
</div>
</nav>
<section class="hero is-info lg:mr-3">
<div class="hero-body">
<p class="title is-size-2 is-centered">Redis Adaption</p>
</div>
</section>
<section class="section" style="padding-top: 2rem;">
<div class="content">
<h1 id="redis-adaptation">Redis adaptation</h1>
<h2 id="architecture">Architecture</h2>
<p>After deploying Redis Proxy to Pegasus, users can directly access the proxy through the Redis protocol, thereby indirectly accessing Pegasus services. The overall architecture is as follows:</p>
<p><img src="/assets/images/redis_proxy_arch.png" alt="redis_proxy_arch.png" class="img-responsive" /></p>
<p>Using the <a href="https://redis.io/topics/protocol">Redis Protocol</a> between Redis Client and Redis Proxy. Currently, thr proxy supports all <a href="https://redis.io/docs/reference/protocol-spec/">RESP2 protocols</a> data types (i.e. Simple Strings, Errors, Integers, Bulk Strings and Arrays).</p>
<p>Redis Proxy uses the Pegasus protocol to communicate with the Pegasus cluster. Here, the proxy acts as a regular Pegasus client, querying routing table from Meta Server and reading and writing user data with Replica Server.</p>
<h2 id="the-form-of-providing-services">The form of providing services</h2>
<p>Like the Redis service, the proxy instances are provided in the form of <code class="language-plaintext highlighter-rouge">host:port</code>. If the service pressure is high, multiple proxy instances can be provided to improve service throughput through horizontal scaling.</p>
<p>Proxy is stateless, and multiple proxy instances share the same backend Pegasus service. Load balancing can be achieved through methods such as round-robin or hash.</p>
<blockquote>
<p>The executable binary of Proxy is named <code class="language-plaintext highlighter-rouge">pegasus_rproxy</code>, <a href="/docs/build/compile-by-docker/#packaging">packed</a> by <code class="language-plaintext highlighter-rouge">./run.sh pack_tools</code></p>
</blockquote>
<h2 id="configuration">Configuration</h2>
<p>The configuration file rules for Redis Proxy follow <a href="/administration/config">Configurations</a>, referring to the <a href="https://github.com/apache/incubator-pegasus/blob/master/src/redis_protocol/proxy/config.ini">example</a>.</p>
<p>There are several unique configuration items in Proxy that need to be noted:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[apps.proxy]
name = proxy
type = proxy
; which pegasus cluster and table dose this proxy redirect to
; - 'onebox': the cluster name which will be used in the next section
; - 'temp': the table name in the cluster
arguments = onebox temp
; if using GEO APIs, an extra table name which will store geo index data
; should be appended, i.e.
; arguments = onebox temp temp_geo
; port serve for redis clients
ports = 6379
pools = THREAD_POOL_DEFAULT
run = true
[pegasus.clusters]
; meta serer list the proxy redirect to
onebox = 127.0.0.1:34601,127.0.0.1:34602,127.0.0.1:34603
</code></pre></div></div>
<h2 id="apis">APIs</h2>
<p>The native commands for Redis can be found <a href="https://redis.io/commands">here</a></p>
<p>The following interfaces are compatible with Redis native commands, but may support fewer parameters than Redis.</p>
<blockquote>
<p>The following documents provide all the parameters currently supported by Pegasus Redis Proxy, and those that are not provided are currently not supported.</p>
</blockquote>
<h3 id="protocol">Protocol</h3>
<h4 id="strings-api">Strings API</h4>
<p>For Redis <a href="https://redis.io/docs/data-types/strings/">strings</a> commands, the key corresponds to the hashkey in Pegasus, while the sortkey in Pegasus is set to an empty string <code class="language-plaintext highlighter-rouge">""</code>.</p>
<p>The supported commands are <code class="language-plaintext highlighter-rouge">SET</code>, <code class="language-plaintext highlighter-rouge">GET</code>, <code class="language-plaintext highlighter-rouge">TTL</code>, <code class="language-plaintext highlighter-rouge">INCR</code>, etc.</p>
<h4 id="geo-api">GEO API</h4>
<p><a href="geo">The Implementation Principle of GEO Commands</a></p>
<p>In Redis, the data operated by <a href="https://redis.io/docs/data-types/geospatial/">GEO</a> commands are added by <a href="https://redis.io/commands/geoadd/">GEOADD</a> commands, i.e. <code class="language-plaintext highlighter-rouge">GEOADD key longitude latitude member</code>. Here, the <code class="language-plaintext highlighter-rouge">key</code> has a “namespace” concept, but not the <code class="language-plaintext highlighter-rouge">key</code> operated by <code class="language-plaintext highlighter-rouge">SET</code> command.</p>
<p>In Pegasus Proxy, due to the difference of underlying implementation principles,the data operated by <code class="language-plaintext highlighter-rouge">GEO*</code> commands are added by <code class="language-plaintext highlighter-rouge">SET</code> command instead. The <code class="language-plaintext highlighter-rouge">key</code> of <code class="language-plaintext highlighter-rouge">SET</code> command corresponds to the <code class="language-plaintext highlighter-rouge">member</code> of <code class="language-plaintext highlighter-rouge">GEO*</code> commands, and the <code class="language-plaintext highlighter-rouge">key</code> of <code class="language-plaintext highlighter-rouge">GEO*</code> must be empty string <code class="language-plaintext highlighter-rouge">""</code>.</p>
<p>That is to say, in Pegasus’s Redis GEO data, there is no longer the concept of “namespace”, and all data is in the same space. To distinguish namespaces, a new table can be created in the Pegasus to achieve this.</p>
<p>The format of the <code class="language-plaintext highlighter-rouge">value</code> of <code class="language-plaintext highlighter-rouge">SET</code> commands refers to <a href="/api/geo#value-extrator">Value Extrator</a></p>
<h3 id="set">SET</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>SET key value [EX seconds]
</code></pre></div></div>
<h3 id="get">GET</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>GET key
</code></pre></div></div>
<h3 id="del">DEL</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>DEL key
</code></pre></div></div>
<p><strong>Note:</strong></p>
<p>When a key does not exist, the return value of Pegasus Proxy is slightly different from Redis:</p>
<ul>
<li>Redis: The interface returns 0, indicating that no valid data has been deleted this time</li>
<li>Pegasus Proxy: Since there is no distinction between non-existent and successfully deleted, return a unified 1 in both cases</li>
</ul>
<h3 id="setex">SETEX</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>SETEX key seconds value
</code></pre></div></div>
<h3 id="ttl">TTL</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>TTL key
</code></pre></div></div>
<h3 id="pttl">PTTL</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>PTTL key
</code></pre></div></div>
<h3 id="incr">INCR</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>INCR key
</code></pre></div></div>
<h3 id="incrby">INCRBY</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>INCRBY key increment
</code></pre></div></div>
<h3 id="decr">DECR</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>DECR key
</code></pre></div></div>
<h3 id="decrby">DECRBY</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>DECRBY key decrement
</code></pre></div></div>
<h3 id="geodist">GEODIST</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>GEODIST key member1 member2 [unit]
</code></pre></div></div>
<p><strong>Note:</strong></p>
<ul>
<li>The key rule follows the key rule of the Pegasus Proxy <code class="language-plaintext highlighter-rouge">GEO*</code> commands, which means that the <code class="language-plaintext highlighter-rouge">key</code> can only be an empty string <code class="language-plaintext highlighter-rouge">""</code>, and here the <code class="language-plaintext highlighter-rouge">member</code> corresponds to the <code class="language-plaintext highlighter-rouge">key</code> during the <code class="language-plaintext highlighter-rouge">SET</code> command</li>
</ul>
<h3 id="georadius">GEORADIUS</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>GEORADIUS key longitude latitude radius m|km|ft|mi [WITHCOORD][WITHDIST] [WITHHASH][COUNT count] [ASC|DESC]
</code></pre></div></div>
<p><strong>Note:</strong></p>
<ul>
<li>The key rule follows the key rule of the Pegasus Proxy <code class="language-plaintext highlighter-rouge">GEO*</code> commands, which means that the <code class="language-plaintext highlighter-rouge">key</code> can only be an empty string <code class="language-plaintext highlighter-rouge">""</code>, and here the <code class="language-plaintext highlighter-rouge">member</code> corresponds to the <code class="language-plaintext highlighter-rouge">key</code> during the <code class="language-plaintext highlighter-rouge">SET</code> command</li>
<li>Pegasus Proxy has modified the mean of <code class="language-plaintext highlighter-rouge">WITHHASH</code> parameter of Redis, using it will return the <code class="language-plaintext highlighter-rouge">value</code> of that <code class="language-plaintext highlighter-rouge">member</code></li>
</ul>
<h3 id="georadiusbymember">GEORADIUSBYMEMBER</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>GEORADIUSBYMEMBER key member radius m|km|ft|mi [WITHCOORD][WITHDIST] [WITHHASH][COUNT count] [ASC|DESC]
</code></pre></div></div>
<p><strong>Note:</strong></p>
<ul>
<li>The key rule follows the key rule of the Pegasus Proxy <code class="language-plaintext highlighter-rouge">GEO*</code> commands, which means that the <code class="language-plaintext highlighter-rouge">key</code> can only be an empty string <code class="language-plaintext highlighter-rouge">""</code>, and here the <code class="language-plaintext highlighter-rouge">member</code> corresponds to the <code class="language-plaintext highlighter-rouge">key</code> during the <code class="language-plaintext highlighter-rouge">SET</code> command</li>
<li>Pegasus Proxy has modified the mean of <code class="language-plaintext highlighter-rouge">WITHHASH</code> parameter of Redis, using it will return the <code class="language-plaintext highlighter-rouge">value</code> of that <code class="language-plaintext highlighter-rouge">member</code></li>
</ul>
<h2 id="sample">Sample</h2>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>// Strings commands sample
127.0.0.1:6379&gt; SET abc 1 EX 60
OK
127.0.0.1:6379&gt; GET abc
"1"
127.0.0.1:6379&gt; TTL abc
(integer) 52
127.0.0.1:6379&gt; INCR abc
(integer) 2
// GEO commands sample
127.0.0.1:6379&gt; SET 1cc0001000010290050356f "1cc0001000010290050356f|2018-06-10 23:59:59|2018-06-11 13:00:00|wx5j5ff05|116.886447|40.269031|4.863045|20.563248|0|-1"
OK
127.0.0.1:6379&gt; SET 2cc0001000010290050356f "2cc0001000010290050356f|2018-06-10 23:59:59|2018-06-11 13:00:00|wx5j5ff05|115.886447|41.269031|4.863045|20.563248|0|-1"
OK
127.0.0.1:6379&gt; GEORADIUS "" 116.889137 40.261774 1000 m COUNT 100 ASC WITHDIST WITHCOORD
1) 1) "1cc0001000010290050356f"
2) "838.600772"
3) 1) "116.886447"
2) "40.269031"
4) "1cc0001000010290050356f|2018-06-10 23:59:59|2018-06-11 13:00:00|wx5j5ff05|116.886447|40.269031|4.863045|20.563248|0|-1"
127.0.0.1:6379&gt; GEORADIUSBYMEMBER "" 1cc0001000010290050356f 1000 m WITHCOORD WITHDIST WITHHASH
1) 1) "1cc0001000010290050356f"
2) "0.000000"
3) 1) "116.886447"
2) "40.269031"
4) "1cc0001000010290050356f|2018-06-10 23:59:59|2018-06-11 13:00:00|wx5j5ff05|116.886447|40.269031|4.863045|20.563248|0|-1"
127.0.0.1:6379&gt; GEODIST "" 1cc0001000010290050356f 2cc0001000010290050356f m
"139483.293598"
</code></pre></div></div>
</div>
</section>
<footer class="footer">
<div class="container">
<div class="content is-small has-text-centered">
<div style="margin-bottom: 20px;">
<a href="http://incubator.apache.org">
<img src="/assets/images/egg-logo.png"
width="15%"
alt="Apache Incubator"/>
</a>
</div>
Copyright &copy; 2023 <a href="http://www.apache.org">The Apache Software Foundation</a>.
Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version
2.0</a>.
<br><br>
Apache Pegasus is an effort undergoing incubation at The Apache Software Foundation (ASF),
sponsored by the Apache Incubator. Incubation is required of all newly accepted projects
until a further review indicates that the infrastructure, communications, and decision making process
have stabilized in a manner consistent with other successful ASF projects. While incubation status is
not necessarily a reflection of the completeness or stability of the code, it does indicate that the
project has yet to be fully endorsed by the ASF.
<br><br>
Apache Pegasus, Pegasus, Apache, the Apache feather logo, and the Apache Pegasus project logo are either
registered trademarks or trademarks of The Apache Software Foundation in the United States and other
countries.
</div>
</div>
</footer>
</div>
<!-- right panel -->
<div class="dashboard-panel is-small is-scrollable is-hidden-mobile">
<p class="menu-label">
<span class="icon">
<i class="fa fa-bars" aria-hidden="true"></i>
</span>
Table of contents
</p>
<ul class="menu-list">
<li><a href="#redis-adaptation">Redis adaptation</a>
<ul>
<li><a href="#architecture">Architecture</a></li>
<li><a href="#the-form-of-providing-services">The form of providing services</a></li>
<li><a href="#configuration">Configuration</a></li>
<li><a href="#apis">APIs</a>
<ul>
<li><a href="#protocol">Protocol</a>
<ul>
<li><a href="#strings-api">Strings API</a></li>
<li><a href="#geo-api">GEO API</a></li>
</ul>
</li>
<li><a href="#set">SET</a></li>
<li><a href="#get">GET</a></li>
<li><a href="#del">DEL</a></li>
<li><a href="#setex">SETEX</a></li>
<li><a href="#ttl">TTL</a></li>
<li><a href="#pttl">PTTL</a></li>
<li><a href="#incr">INCR</a></li>
<li><a href="#incrby">INCRBY</a></li>
<li><a href="#decr">DECR</a></li>
<li><a href="#decrby">DECRBY</a></li>
<li><a href="#geodist">GEODIST</a></li>
<li><a href="#georadius">GEORADIUS</a></li>
<li><a href="#georadiusbymember">GEORADIUSBYMEMBER</a></li>
</ul>
</li>
<li><a href="#sample">Sample</a></li>
</ul>
</li>
</ul>
</div>
</div>
<script src="/assets/js/app.js" type="text/javascript"></script>
<script>
docsearch({
container: '#docsearch',
appId: 'QRN30RBW0S',
indexName: 'pegasus-apache',
apiKey: 'd3a3252fa344359766707a106c4ed88f',
debug: true
});
</script>
</body>
</html>