一、安装部署
metriceat的安装部署参考章节: 监控组件>Metricbeat安装使用,这里不再赘述。
二、开启Redis监控模块
进入metricbeat安装目录
./metricbeat modules enable redis
三、编辑Redis配置文件
vim modules.d/redis.yml
# Module: redis # Docs: https://www.elastic.co/guide/en/beats/metricbeat/main/metricbeat-module-redis.html - module: redis metricsets: - info - keyspace - key key.patterns: - pattern: '*' period: 10s # Redis hosts hosts: ["127.0.0.1:6379"] # Network type to be used for redis connection. Default: tcp #network: tcp # Max number of concurrent connections. Default: 10 #maxconn: 10 # Redis AUTH username (Redis 6.0+). Empty by default. #username: user # Redis AUTH password. Empty by default. password: Redis@123456 # Optional SSL/TLS (Redis 6.0+). By default is false. #ssl.enabled: true # List of root certificates for SSL/TLS server verification #ssl.certificate_authorities: ["/etc/pki/root/ca.crt"] # Certificate for SSL/TLS client authentication #ssl.certificate: "/etc/pki/client/cert.crt" # Client certificate key file #ssl.key: "/etc/pki/client/cert.key"
四、启动Metricbeat
nohup ./metricbeat -e > ./metricbeat.log 2>&1 &
五、查看监控图表
登入kibana,进入dashboard,搜索 redis,即可看到相关图表。