Redis on OpenBSD

Page content

let’s play a bit with Redis. A In-Memory Data Store for Caching, Streaming, Message Broker

Install

doas rcctl add redis
doas rcctl enable redis
doas rcclt restart redis

Package Summary

what did we got installed ?

doas pkg_info -L redis
$ doas pkg_info -L redis
Information for inst:redis-6.2.7
Files:
/etc/rc.d/redis
/usr/local/bin/redis-benchmark
/usr/local/bin/redis-check-aof
/usr/local/bin/redis-check-rdb
/usr/local/bin/redis-cli
/usr/local/bin/redis-sentinel
/usr/local/bin/redis-server
/usr/local/share/examples/redis/redis.conf
/usr/local/share/examples/redis/sentinel.conf

A Server, a Client, a configuration File, …

Keep Alive

send a ping …

$ redis-cli ping
PONG

Redis Client

Let’s connect with the Client and find help …

$ redis-cli  
127.0.0.1:6379> help @generic

  COPY source destination [DB destination-db] [REPLACE]
  summary: Copy a key
  since: 6.2.0

  DEL key [key ...]
  summary: Delete a key
  since: 1.0.0

First Steps

Write and Read to Redis

$ redis-cli  
127.0.0.1:6379> set name hans
OK
127.0.0.1:6379> get name
"hans"
127.0.0.1:6379>
127.0.0.1:6379> HSET key vorname franz
(integer) 1
127.0.0.1:6379> HSET key nachname meier
(integer) 1
127.0.0.1:6379> HGET key vorname
"franz"
127.0.0.1:6379> HGETALL key
1) "vorname"
2) "franz"
3) "nachname"
4) "meier"

to be continued ;)

sha256: db83111f8844fe0de9939ba92bb9b0dcc01a7ba8ae0ca22c4791bc79ca288907