1

Hi all, hoping someone can assist me with some queries/configuration for the use of the Geode Redis Adapter. I'm having some difficulty ascertaining how/whether I can configure a number of Redis servers within my Geode cluster to function in a high availability setup.

I'm very new to Geode, but understand that in a traditional Geode application, the client interacts with a locator process to access data from the cluster and balance load. Given that the aim of this adapter is to function as a drop-in replacement for Redis (i.e. no change required on the client) I imagine it functions somewhat differently.

Here is what I have tried so far:

I have built from source according to this link and successfully got the gfsh cli up on 2 CentOS 7 VMs:

  • 192.168.0.10: host1
  • 192.168.0.15: host2

On host1, I run the following commands:

gfsh>start locator --name=locator1 --bind-address=192.168.0.10 --port=10334
gfsh>start server --name=redis --redis-bind-address=192.168.0.10 --redis-port=11211 --J=-Dgemfireredis.regiontype=PARTITION_REDUNDANT

On host2, I run the following command:

gfsh>start server --name=redis2 --redis-bind-address=192.168.0.15 --redis-port=11211 --J=-Dgemfireredis.regiontype=PARTITION_REDUNDANT --locators=192.168.0.10[10334]

On host1, I examine the current configuration:

gfsh>list members
  Name   | Id
-------- | -------------------------------------------------
locator1 | 192.168.0.10(locator1:16629:locator)<ec><v0>:1024
redis2   | 192.168.0.15(redis2:6022)<ec><v2>:1024
redis    | 192.168.0.10(redis:16720)<ec><v1>:1025

gfsh>list regions
List of regions
-----------------
__HlL
__ReDiS_MeTa_DaTa
__StRiNgS

For each of the regions, I can see both server redis & redis2 as Hosting Members - e.g.

gfsh>describe region --name=__StRiNgS
..........................................................
Name            : __StRiNgS
Data Policy     : normal
Hosting Members : redis2
                  redis

Non-Default Attributes Shared By Hosting Members

 Type  | Name  | Value
------ | ----- | -----
Region | size  | 0
       | scope | local

At this point, I turned to the redis-cli for some testing. Given the previous output, my expectation was that if I set a key on one server, I should be able to read it back from the other server:

192.168.0.10:11211> set foo 'bar'
192.168.0.10:11211> get foo
"bar"

192.168.0.15:11211> get foo
(nil)

gfsh>describe region --name=__StRiNgS
..........................................................
Name            : __StRiNgS
Data Policy     : normal
Hosting Members : redis2
                  redis

Non-Default Attributes Shared By Hosting Members

 Type  | Name  | Value
------ | ----- | -----
Region | scope | local

Non-Default Attributes Specific To The Hosting Members

Member |  Type  | Name | Value
------ | ------ | ---- | -----
redis2 | Region | size | 0
redis  | Region | size | 1

As you can see, a query against host2 for the key added on host1 returned (nil). I'd greatly appreciate any help here. Is it possible achieve what I'm aiming for here or does the Redis adapter only allow you to scale out a single server?

DasSuper
  • 19
  • 3

3 Answers3

1

This may not be an answer, but it is probably too long for a comment.

I am not familiar with the specific Geode Redis Adapter you are talking about here. But from my experience with Gemfire/Geode, there are things you may want to check:

  1. You started the first host without locators param, I am not sure whether this will cause any problem with cluster formation. There are two ways in Gemfire to form a cluster: by specifying mcast port or by specifying locators.

  2. Scope of the region you are inspecting looks wrong. "local" will not replicate any updates. When you set it up correctly, it should show up as DISTRIBUTED_NO_ACK / DISTRIBUTED_ACK / GLOBAL I suppose.

Hope this helps

Xiawei Zhang
  • 1,690
  • 1
  • 11
  • 24
0

Xiawei is correct, a scope "local" regions will not replicate the entry on other members. The workaround for this could have been to just create a region named __StRiNgS from gfsh, but since region names starting with two underscores are for internal use only, that's not possible.

I have filed this issue https://issues.apache.org/jira/browse/GEODE-1921 to fix the problem. I also attached a patch for this issue. With the patch applied I see that the __StRiNgS region now is PARTITION.

gfsh>start locator --name=locator1
gfsh>start server --name=redis --redis-port=11211
gfsh>list regions
List of regions
-----------------
HlL
StRiNgS
__ReDiS_MeTa_DaTa

gfsh>describe region --name=/StRiNgS
..........................................................
Name            : StRiNgS
Data Policy     : partition
Hosting Members : redis

Non-Default Attributes Shared By Hosting Members

Type  |    Name     | Value
------ | ----------- | ---------
Region | size        | 0
       | data-policy | PARTITION
Swapnil
  • 1,191
  • 7
  • 8
  • Just curious on my first point: is my statement not true? Or when you start server on the same host as locator, it has some mechanism to detect the locator directly? any pointer to the documentation will be highly appreciated, and I will edit my post if it is misleading. – Xiawei Zhang Sep 22 '16 at 03:10
  • 1
    As a ease of use, when you start a locator and server in the same `gfsh` session, the locator information is automatically provided to the server. When you start a server a `-Dgemfire.default.locators` system property is added for you. – Swapnil Sep 22 '16 at 23:19
0

On host1:

start locator --name=locator1 --bind-address=192.168.0.10 --port=10334
start server --name=redis --redis-bind-address=192.168.0.10 --redis-port=11211 --J=-Dgemfireredis.regiontype=REPLICATE

NOTE: Yoy have to use regiontype as "REPLICATE" if you wish the data to be replicated from one region to another.

On host2:

start server --name=redis2 --redis-bind-address=192.168.0.15 --redis-port=11211 --J=-Dgemfireredis.regiontype=REPLICATE --locators=192.168.0.10[10334]

https://geode.apache.org/docs/guide/11/developing/region_options/region_types.html

Shivam Mitra
  • 1,040
  • 3
  • 17
  • 33