LoginSignup
1

More than 5 years have passed since last update.

memcached_exporter導入メモ

Last updated at Posted at 2019-01-09

image.png

Prometheusのmemcacheノード側エージェント、「memcached_exporter」を導入したのでメモ

memcached_exporter

  • prometheusでmemcachedの様子を見ることができる
  • githubからmemcached_exporterをwgetでダウンロード
  • 面倒なので/homeにダウンロードして配置
  • ちゃんとしたい場合は/usr/local/binなどに配置したりシンボリックリンクしたり
  • memcached_exporterは9150をLISTENするよう
  • ファイアウォールも9150を空けておく

memcached_exporter側

$ wget https://github.com/prometheus/memcached_exporter/releases/download/v0.5.0/memcached_exporter-0.5.0.linux-amd64.tar.gz
$ tar xvfz memcached_exporter-*.tar.gz
$ mv memcached_exporter-0.5.0.linux-amd64 memcached_exporter
$ rm -f memcached_exporter-0.5.0.linux-amd64.tar.gz
$ cd memcached_exporter
$ ./memcached_exporter &
$ sudo lsof -i:9150
COMMAND     PID    USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
memcached 16494 appuser    3u  IPv6 3077568297      0t0  TCP *:9150 (LISTEN)

prometheus側

  • prometheusの設定は終わっているものとする
$ cd prometheus
$ vi prometheus.yml
          :
  - job_name: 'prd-smem-001'
    static_configs:
      - targets: ['10.45.12.152:9100']
      - targets: ['10.45.12.152:9150'] <---追加
          :
$ killall prometheus
$ ./prometheus --config.file=./prometheus.yml

grafana側

  • Queryに「mem…」と入力されると補完されるので入力
  • 個別でQueryを書くなら「memcached_current_connections{instance="ipaddress:9150",job="hostname"}」など

image.png

以上!

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1