3

I'm using redislabs redisearch docker image locally for working with redisearch, but I would like the created indexes and documents still be there after restarting the redisearch container. I tried volume mapping - it didn't work. What did you do to make it persist?

3 Answers3

7

You have not set the persistence configuration directives, so no data is persisted.

You can either provide a configuration file, or provide them as command line arguments. For example, the following activates RDB snapshot per the defaults:

$ docker run -p 6379:6379 -v /tmp/data:/data redislabs/redisearch --loadmodule /usr/lib/redis/modules/redisearch.so --save 3600 1 300 100 60 10000

Regardless, you can verify that the mount has succeeded and manually save the RDB with a call to BGSAVE. You should be able to see the 'dump.rdb' at your host.

Itamar Haber
  • 47,336
  • 7
  • 91
  • 117
0

Apart from volume mapping you have to start with persistent storage enabled ( --appendonly yes ). View https://hub.docker.com/_/redis

docker run -d --net=host -v redisearch:/data redislabs/redisearch:latest --loadmodule /usr/lib/redis/modules/redisearch.so --appendonly yes

Fabio
  • 1
  • 1
0

I had the same issue with setting config on Redisearch. I solved this through env:

docker run -p 6379:6379 -e REDISEARCH_ARGS="TIMEOUT 5000" redis/redis-stack:latest

It set Timeout to 5000ms.

iman safari
  • 194
  • 1
  • 1
  • 8