settings_redis.rst 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. .. _settings redis:
  2. ==========
  3. ``redis:``
  4. ==========
  5. .. _Redis.from_url(url): https://redis-py.readthedocs.io/en/stable/connections.html#redis.client.Redis.from_url
  6. A redis DB can be connected by an URL, in :py:obj:`searx.redisdb` you
  7. will find a description to test your redis connection in SerXNG. When using
  8. sockets, don't forget to check the access rights on the socket::
  9. ls -la /usr/local/searxng-redis/run/redis.sock
  10. srwxrwx--- 1 searxng-redis searxng-redis ... /usr/local/searxng-redis/run/redis.sock
  11. In this example read/write access is given to the *searxng-redis* group. To get
  12. access rights to redis instance (the socket), your SearXNG (or even your
  13. developer) account needs to be added to the *searxng-redis* group.
  14. ``url`` : ``$SEARXNG_REDIS_URL``
  15. URL to connect redis database, see `Redis.from_url(url)`_ & :ref:`redis db`::
  16. redis://[[username]:[password]]@localhost:6379/0
  17. rediss://[[username]:[password]]@localhost:6379/0
  18. unix://[[username]:[password]]@/path/to/socket.sock?db=0
  19. .. admonition:: Tip for developers
  20. To set up a local redis instance, first set the socket path of the Redis DB
  21. in your YAML setting:
  22. .. code:: yaml
  23. redis:
  24. url: unix:///usr/local/searxng-redis/run/redis.sock?db=0
  25. Then use the following commands to install the redis instance ::
  26. $ ./manage redis.build
  27. $ sudo -H ./manage redis.install
  28. $ sudo -H ./manage redis.addgrp "${USER}"
  29. # don't forget to logout & login to get member of group