Download the PHP package flownative/redis-sentinel without Composer
On this page you can find all versions of the php package flownative/redis-sentinel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download flownative/redis-sentinel
More information about flownative/redis-sentinel
Files in flownative/redis-sentinel
Package redis-sentinel
Short Description Flow Redis cache backend with Sentinel support
License MIT
Informations about the package redis-sentinel
Flow Redis Cache Backend with Sentinel Support
This package provides a Redis cache backend with Sentinel support.
Installation
The package is installed as a regular Flow package via Composer. For your
existing project, simply include flownative/redis-sentinel
into the
dependencies of your Flow or Neos distribution:
Usage
The RedisBackend
contained in this package can be used as a
drop-in-replacement for the Redis backend provided by the neos/cache package.
For regular use with a standalone Redis server, provide configuration in your
Caches.yaml
like so:
Of course you can also set concrete values instead of using environment variables.
Note that you can set two different timeouts:
- "timeout" (default: 5) specifies the time in seconds to wait while connecting to Redis
- "readWriteTimeout" (default: 1) specifies the time to wait during a read or write operation
You can specify float numbers as timeout values. For example, use 0.5
for
setting the timeout to half a second.
When Redis is running in a high availability setup with Sentinel servers, you need to configure the Redis Backend to access the Sentinel servers instead of the actual Redis nodes.
Depending on your setup, this may look like the following:
Note that "service" is the name of your Redis cluster (which is "mymaster" in most default configurations).
This package will use the same password for all connections, there is currently no support for specifying different passwords for Sentinel and client servers.
Logging
This cache backend will log errors, such as connection timeouts or other problems while communicating with the Redis servers.
If a connection error occurs during a request, it is likely, that more errors of the same type will happen. Therefore, those messages will, by default, be de-duplicated: If the messages of an error is identical with one which already has been logged during the current CLI / web request, it will not be logged another time.
You can disable de-duplication logged errors for debugging purposes by setting the respective backend option to false:
If you don't want errors being logged – for example, because you log errors via the MultiBackend – you can turn off logging for this cache backend:
Command Line Tool
This package provides CLI commands which can help debugging configuration or connectivity issues.
redissentinel:list
Displays configuration of Redis Sentinel cache backends, including those backends which are defined as a sub-backend of a Multi Backend.
redissentinel:connect
Tries to connect with the specified cache. If the cache is using a Multi Backend, this command will skip the Multi Backend behavior and instantiate the Redis Sentinel Backend directly. Errors are display and explained, if possible.
Tests
You can adjust the host, port and password used in the functional tests
using the environment variables REDIS_HOST
, REDIS_PORT
and REDIS_PASSWORD
.
Credits
This cache backend was developed by Robert Lemke of Flownative, based on the Neos Flow Redis Backend, originally created by Christopher Hlubek and later improved by the Neos core team.
All versions of redis-sentinel with dependencies
neos/cache Version ^7.0 || ^8.0 || ^9.0
ext-zlib Version *
predis/predis Version ^2.0
php Version 8.1.* || 8.2.* || 8.3.*