Set up Valkey service
is an optional, backend cache solution that replaces the Zend Framework Zend_Cache_Backend_File
, which 51黑料不打烊 Commerce uses by default.
See Configure Valkey {target=鈥淿blank鈥潁 in the Configuration guide.
Use the following instructions for service setup on Pro Integration environments and Starter environments, including the master
branch.
To enable Valkey:
-
Add the required name and type to the
.magento/services.yaml
file.code language-yaml cache: type: valkey:<version>
To provide your own Valkey configuration, add a
core_config
key in your.magento/services.yaml
file:code language-yaml cache: type: valkey:8.0
-
Configure the relationships in the
.magento.app.yaml
file.code language-yaml relationships: valkey: "cache:valkey"
-
Add, commit, and push your code changes.
code language-bash git add .magento/services.yaml .magento.app.yaml && git commit -m "Enable valkey service" && git push origin <branch-name>
services.yaml
and .magento.app.yaml
configuration files. See Change service version for guidance on upgrading or downgrading a service.Using the Valkey CLI
Assuming your Valkey relationship is named valkey
, you can access it using the valkey-cli
tool.
-
Use SSH to connect to the integration environment with Valkey installed and configured.
-
Open an SSH tunnel to a host.
code language-bash valkey-cli -h valkeycache.internal
Get installed Valkey version
Use the following command to get the Valkey version installed on an integration environment:
valkey-cli -h valkeycache.internal info | grep version
Response:
valkey_version:8.0.1
gcc_version:12.2.0
Valkey on Pro staging and production
To get the Valkey version installed on a Staging or Production environment, use the valkey-server
command:
valkey-server -v
Valkey server v=8.0.1 ...
Use the following command to get the Valkey configuration installed on a Pro Staging or Production environment:
echo $MAGENTO_CLOUD_RELATIONSHIPS | base64 -d | json_pp
Response:
"valkey" : [
{
"cluster" : "project-master-abc0003",
"epoch" : 0,
"fragment" : null,
"host" : "valkeycache.internal",
"host_mapped" : false,
"hostname" : "oblahblahblahblahe.cache.service._.magentosite.cloud",
"instance_ips" : [
"123.456.789.012"
],
"ip" : "123.456.789.012",
"password" : null,
"path" : null,
"port" : 6379,
"public" : false,
"query" : {},
"rel" : "valkey",
"scheme" : "valkey",
"service" : "cache",
"type" : "valkey:8.0",
"username" : null
}
]