YugabyteDB YEDIS is a key-value database that is compatible with the redis commands library.
Important: YEDIS is deprecated!
There are other limitations for YEDIS see the description in the YugabyteDB documentation.
The most important part of this blogpost is how to remove the YEDIS, see: 'YEDIS can be removed'.
YEDIS requires setup
With current versions of YugabyteDB, YEDIS cannot be used without preparation of the YugabyteDB cluster. This does not mean you cannot connect: that works, but the typical set
set command to store a key with a value will throw:
(error) ERR set: Could not open YBTable
If you must use YEDIS, the command to create the YBTable is:
yb-admin -init_master_addrs localhost:7100 setup_redis_table
This is an operating system level cluster administration utility command.
How to recognise a YugabyteDB cluster with YEDIS setup
Once the setup_redis_table
command is executed, a few additional "entities" are created. These can be seen with yb_stats --print_entities
:
% yb_stats --print-entities
...
Keyspace: yedis.system_redis id: fda8f8252cfe4ce4b69f604882dc8c20
Object: yedis.system_redis.redis, state: RUNNING, id: b495da531ed24edbbd6c777dac4a2b41
Tablet: yedis.system_redis.redis.24b8acf6c2b341aaa186917b47ac2467 state: RUNNING
( VOTER,yb-3.local:9100,FOLLOWER VOTER,yb-2.local:9100,LEADER VOTER,yb-1.local:9100,FOLLOWER )
Tablet: yedis.system_redis.redis.2bcbda4e8bea4ea0ba810ab003d7264e state: RUNNING
( VOTER,yb-3.local:9100,LEADER VOTER,yb-2.local:9100,FOLLOWER VOTER,yb-1.local:9100,FOLLOWER )
Tablet: yedis.system_redis.redis.2da0cfc6220f47a8896c2f7593500819 state: RUNNING
( VOTER,yb-3.local:9100,FOLLOWER VOTER,yb-2.local:9100,FOLLOWER VOTER,yb-1.local:9100,LEADER )
The YEDIS setup creates:
- A keyspace named 'system_redis' of the type 'yedis'.
- An object (table) named 'redis'.
- The tablets that represent the 'shards' for the 'redis' table.
- For each tablet the replicas. With RF3, you get 3 replicas.
YEDIS can be removed
If YEDIS was setup, and is not in use anymore, then the redis table that holds the key-value pairs can be removed with the following operating system cluster command:
yb-admin -init_master_addrs localhost:7100 drop_redis_table
Warning:
- This will drop the redis table, even if it (still) contains key-value pairs.
- This will leave the
yedis.system_redis
keyspace.
Top comments (0)