Case Analysis of redis-exporter Monitoring redis
This article introduces the relevant knowledge of "case Analysis of redis-exporter Monitoring redis". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Version: 0.x.x startup step
0.x.x version uses an exporter to monitor redis multi-instance startup method
1. Start redis_exporter
Nohup. / redis_exporter-redis.addr=redis://localhost:6379,redis://localhost:6380-web.listen-address: 50003 &
two。 Add prometheus configuration (can also be added to the autodiscovery file)
-job_name: 'redis_exporter' static_configs:-targets:-127.0.0.1 targets 9121
3. Reload prometheus configuration
Curl-X POST http://localhost:9090/-/reloadversion 1.x.x considerations
1.x version monitors that the startup mode of multiple instances of redis has changed. For more information, please see pr in github.
Be careful to add-redis.addr, otherwise you will try to connect to the local port 6379
Start step
1. Start redis_exporter
[root@test-125 redis_exporter-v1.3.4.linux-amd64] # nohup. / redis_exporter- redis.addr=-web.listen-address: 50003 &
two。 Create a new json file
Vim / etc/targets-redis-instances.json [{"targets": ["redis://127.0.0.1:6381", "redis://127.0.0.1:6378"], "labels": {"redis_env": "TEST"}}]
3. Add prometheus configuration
Scrape_configs:-job_name: 'redis_exporter_targets' file_sd_configs:-files:-targets-redis-instances.json metrics_path: / scrape relabel_configs:-source_labels: [_ address__] target_label: _ _ param_target-source_labels: [_ _ param_target] target_label: instance-target_label: _ _ address__ replacement: 127.0.0.1 redis_exporter' static_configs 9121-job_name: 'redis_exporter' static_configs:-targets:-127.0.0.1 redis_exporter' static_configs 9121
4. Reload prometheus configuration
This is the end of the case analysis of curl-X POST http://localhost:9090/-/reload"redis-exporter Monitoring redis. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!