[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[],[],null,["# Monitoring Redis\n\nThis guide helps you configure Monitoring to monitor Redis.\n\nRedis is an open source advanced key-value store. It is often referred to as a\ndata structure server since values can contain strings, hashes, lists, sets and\nsorted sets. For more information, visit [redis.io](http://redis.io/).\n\nThis functionality is only available for agents running on Linux. It is\nnot available on Windows.\n| **Note:** You can now collect metrics from your Redis instance using the [Ops Agent](/stackdriver/docs/solutions/agents/ops-agent), the primary and preferred agent for collecting telemetry from your Compute Engine instances. For details, see [configuring the Ops Agent for\n| Redis](/stackdriver/docs/solutions/agents/ops-agent/third-party/redis).\n\nDiscovery\n---------\n\nMonitoring discovers Redis services running in your Cloud Platform\nproject if you have the following:\n\n- VM instances with **redis** in their names.\n- Firewall rules that open port **6379**.\n\nTo see the metrics for Redis, do the following:\n\n1. In the Google Cloud console, go to the **Dashboards** page:\n\n [Go to **Dashboards**](https://console.cloud.google.com/monitoring/dashboards)\n\n \u003cbr /\u003e\n\n If you use the search bar to find this page, then select the result whose subheading is\n **Monitoring**.\n2. Select the **Redis** dashboard from the list.\n\nConfiguring Redis monitoring\n----------------------------\n\nThe Monitoring agent uses the\n[**hiredis** client library](https://github.com/redis/hiredis)\nto monitor Redis. After installing Redis, install `hiredis` by running the\nfollowing commands:\n\n- RHEL and CentOS\n\n sudo yum install epel-release\n sudo yum install hiredis\n\n- Ubuntu 18.04 LTS, 16.04 LTS, and Debian 9\n\n sudo apt-get install libhiredis0.13\n\n- SLES\n\n sudo zypper install libhiredis0_13\n\nConfiguring Monitoring\n----------------------\n\nTo monitor Redis, perform the following actions on your VM instance after\n[installing the monitoring agent](/monitoring/agent/monitoring/installation):\n\n1. **Install the Redis configuration file** ,\n [redis.conf](https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/collectd.d/redis.conf),\n by running the following command:\n\n (cd /etc/stackdriver/collectd.d/ && sudo curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/collectd.d/redis.conf)\n\n2. If your Redis instance is password-protected, or if you are using a\n nonstandard host or port for Redis, as **root** , edit `redis.conf` by\n following the instructions at the top of the file.\n\n3. **Restart the monitoring agent** by running the following command:\n\n sudo service stackdriver-agent restart\n\nFor more information on the `collectd` `redis` plugin, see\n[Plugin:Redis](https://collectd.org/wiki/index.php/Plugin:Redis).\n\nRedis metrics\n-------------\n\nThe full list of metrics the Redis plugin monitors is at\n[Agent metrics: redis](/monitoring/api/metrics_agent#agent-redis).\nThe actual metrics collected, and the metrics available in the\nMonitoring menus, can vary."]]