Redis 中文文档 Redis 中文文档
指南
redis.io (opens new window)
指南
redis.io (opens new window)
  • 关于
    • Redis 开源治理
    • Redis 发布周期
    • Redis 赞助商
  • 入门
  • 数据类型
  • Redis Stack
  • 命令
  • 手册
Build Status

redismod - a Docker image with select Redis Labs modules


This simple container image bundles together the latest stable releases of Redis and select Redis modules from Redis Labs.

Quickstart


  1. ``` sh
  2. $ docker pull redislabs/redismod
  3. Using default tag: latest
  4. ...
  5. $ docker run -p 6379:6379 redislabs/redismod
  6. 1:C 24 Apr 2019 21:46:40.382 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
  7. ...
  8. 1:M 24 Apr 2019 21:46:40.474 * Module 'ai' loaded from /usr/lib/redis/modules/redisai.so
  9. 1:M 24 Apr 2019 21:46:40.474 * RediSearch version 1.4.7 (Git=)
  10. 1:M 24 Apr 2019 21:46:40.474 * concurrency: ON, gc: ON, prefix min length: 2, prefix max expansions: 200, query timeout (ms): 500, timeout policy: return, cursor read size: 1000, cursor max idle (ms): 300000, max doctable size: 1000000, search pool size: 20, index pool size: 8,
  11. 1:M 24 Apr 2019 21:46:40.475 * Initialized thread pool!
  12. 1:M 24 Apr 2019 21:46:40.475 * Module 'ft' loaded from /usr/lib/redis/modules/redisearch.so
  13. 1:M 24 Apr 2019 21:46:40.476 * Thread pool created, using 8 threads.
  14. 1:M 24 Apr 2019 21:46:40.476 * Module 'graph' loaded from /usr/lib/redis/modules/redisgraph.so
  15. loaded default MAX_SAMPLE_PER_CHUNK policy: 360
  16. 1:M 24 Apr 2019 21:46:40.476 * Module 'timeseries' loaded from /usr/lib/redis/modules/redistimeseries.so
  17. 1:M 24 Apr 2019 21:46:40.476 # <ReJSON> JSON data type for Redis v1.0.4 [encver 0]
  18. 1:M 24 Apr 2019 21:46:40.476 * Module 'ReJSON' loaded from /usr/lib/redis/modules/rejson.so
  19. 1:M 24 Apr 2019 21:46:40.476 * Module 'bf' loaded from /usr/lib/redis/modules/rebloom.so
  20. 1:M 24 Apr 2019 21:46:40.477 * RedisGears version 0.2.1, git_sha=fb97ad757eb7238259de47035bdd582735b5c81b
  21. 1:M 24 Apr 2019 21:46:40.477 * PythonHomeDir:/usr/lib/redis/modules/deps/cpython/
  22. 1:M 24 Apr 2019 21:46:40.477 * MaxExecutions:1000
  23. 1:M 24 Apr 2019 21:46:40.477 * RedisAI api loaded successfully.
  24. 1:M 24 Apr 2019 21:46:40.477 # <rg> RediSearch api loaded successfully.
  25. 1:M 24 Apr 2019 21:46:40.521 * Module 'rg' loaded from /usr/lib/redis/modules/redisgears.so
  26. 1:M 24 Apr 2019 21:46:40.521 * Ready to accept connections

  27. ```

Modules included in the container


RediSearch : a full-featured search engine
RedisGraph : a graph database
RedisTimeSeries : a timeseries database
RedisAI : a tensor and deep learning model server
RedisJSON : a native JSON data type
RedisBloom : native Bloom and Cuckoo Filter data types
RedisGears : a dynamic execution framework

Configuring the Redis server


This image is based on the official image of Redis from Docker. By default, the container starts with Redis' default configuration and all included modules loaded.

You can, of course, override the defaults. This can be done either by providing additional command line arguments to the docker command, or by providing your own Redis configuration file.

Running the container with command line arguments


You can provide Redis with configuration directives directly from the docker command. For example, the following will start the container, mount the host's /home/user/data volume to the container's /data, load the Rebloom module, and configure Redis' working directory to /data so that the data will actually be persisted there.

  1. ``` sh
  2. $ docker run \
  3.   -p 6379:6379 \
  4.   -v /home/user/data:/data \
  5.   redislabs/redismod \
  6.   --loadmodule /usr/lib/redis/modules/rebloom.so \
  7.   --dir /data

  8. ```

Running the container with a configuration file


Assuming that you have put together a configration file such as the following, and have stored it at /home/user/redis.conf :

  1. ``` sh
  2. requirepass foobared
  3. dir /data
  4. loadmodule /usr/lib/redis/modules/rebloom.so

  5. ```

And then execute something along these lines:

  1. ``` sh
  2. $ docker run \
  3.   -p 6379:6379 \
  4.   -v /home/user/data:/data \
  5.   -v /home/user/redis.conf:/usr/local/etc/redis/redis.conf \
  6.   redislabs/redismod \
  7.   /usr/local/etc/redis/redis.conf

  8. ```

Your dockerized Redis server will start and will be listening at the default Redis port (6379) of the host. In addition, the Redis server will require password authentication ("foobared"), will store the data to the container's /data (that is the host's volume /home/user/data ), and will have loaded only the Rebloom module.

License


This Docker image is licensed under the 3-Clause BSD License.

Redis is distributed under the 3-Clause BSD License. The Redis trademark and logos are owned by Redis Labs Ltd, please read the Redis trademark guidelines (https://redis.io/topics/trademark ) for our policy about the use of the Redis trademarks and logo.

The copyright of the Redis modules in this container belongs to Redis Labs, and the modules are distributed under the Redis Source Available License.
Last Updated: 2023-09-03 19:17:54