settings_redis.rst 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 SearXNG. 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. .. _Redis Developer Notes:
  20. Redis Developer Notes
  21. =====================
  22. To set up a local redis instance, first set the socket path of the Redis DB
  23. in your YAML setting:
  24. .. code:: yaml
  25. redis:
  26. url: unix:///usr/local/searxng-redis/run/redis.sock?db=0
  27. Then use the following commands to install the redis instance (:ref:`manage
  28. redis.help`):
  29. .. code:: sh
  30. $ ./manage redis.build
  31. $ sudo -H ./manage redis.install
  32. $ sudo -H ./manage redis.addgrp "${USER}"
  33. # don't forget to logout & login to get member of group