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?
-
Please include the full details of how you ran the container with mapping - it should work afaik. – Itamar Haber Apr 29 '19 at 15:45
-
@Itamar Haber i'm pulling the image and running it with: docker run -p 6379:6379 -v /home/user/Documents/data:/data redislabs/redisearch – Gervasius Twinklewinkleson May 01 '19 at 09:16
3 Answers
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.

- 47,336
- 7
- 91
- 117
-
thanks @Itamar Haber, that did it. but, what does this do: --save 3600 1 300 100 60 10000 ? – Gervasius Twinklewinkleson May 04 '19 at 15:33
-
1This configures automatic snapshotting with the default values - you can read the description for the `save` directive in the redis.conf file. – Itamar Haber May 05 '19 at 10:39
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

- 1
- 1
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
.

- 194
- 1
- 1
- 8