Set up Redis service
We support Redis versions 2.8, 3.0, and 5.0. Redis 3.0 supports up to 64 different databases per instance of the service, while 2.8 allows for only a single database. See Configure Redis.
You can use the following instructions for service setup on Magento Commerce Cloud Pro Integration environments and Starter environments, including
master branch. You must submit a support ticket to configure the service on Pro Production and Staging environments. See Services.
Add Redis in configuration files
To enable Redis, add your installed version and allocated disk space in MB to
1 2 myredis: type: redis:3.0
To provide your own Redis configuration, add a
core_config key in your
1 2 cache: type: redis:3.0
To configure relationships for an environment variable in your
1 2 3 4 5 6 runtime: extensions: - redis relationships: redis: "myredis:redis"
Merge and deploy the code to set the configurations for Redis. For information on how these changes affect your environments, see
Verify environment-related relationships
We use the Magento Commerce Cloud environment variable
$MAGENTO_CLOUD_RELATIONSHIPS, a JSON object, to retrieve environment-related relationships.
To verify information used for configurations and settings:
Use SSH to log in to the remote environment.
pretty-printof all relationships for services and configuration data for that environment.
php -r 'print_r(json_decode(base64_decode($_ENV["MAGENTO_CLOUD_RELATIONSHIPS"])));'
Using the Redis CLI
Assuming your Redis relationship is named
redis, you can access it using the
- Use SSH to connect to the Integration environment with RabbitMQ installed and configured.
Open an SSH tunnel to a host.
redis-cli -h redis.internal