LoginSignup
0
0

More than 5 years have passed since last update.

[blackbird-aerospike] blackbird で Aerospike をモニタリングする

Posted at

blackbird aerospike plugin

この plugin では aerospike の様々な情報を取得し、backend にデータを送信します

aerospike1.png

aerospike2.png

取得してくる項目

基本的には asinfo で取れる項目を取得します

  • asinfo -v latency
  • asinfo -v namespace/<ns>
  • asinfo -v sets/<set>
  • asinfo -v get-config
  • などなど

namespace 及び set の情報は Low Level Discovery で自動的に拾うようにしています

Install

blackbird 本体

こちらを参考に install してください

Install aerospike plugin

setup.py で入れる方法と rpm で入れる方法があります

setup.py で install

git clone https://github.com/Vagrants/blackbird-aerospike.git
cd blackbird-aerospike
python setup.py install

rpm で install

yum install blackbird-aerospike --enablerepo=blackbird

この plugin を使う前に

citrusleaf.py

この blackbird-aerospike の module は citrusleaf という python の module が必要になります
citrusleaf ですが aerospike-tools のパッケージに入っていますので blackbird を起動させるサーバーに install しておくか、パッケージから cistrusleaf.py を抜き出して sys.path のどこかに置いて下さい

daemon.py を排除する

aerospike-tools を install した場合、/opt/aerospike/lib/pythonsys.path に追加されます
実は /opt/aerospike/lib/python/daemon.py が曲者で、python-daemon と conflict して blackbird が起動しなくなります(Aerospike 3.4.0 現在)
ですので /opt/aerospike/lib/python/daemon.py は rename してください

この /opt/aerospike/lib/python/daemon.py ですが asgraphite から import されてますので、asgraphite を使う場合は asgraphite 内の import の部分を rename 後の名前にしてください

plugin の設定をする

config は /etc/blackbird/conf.d/aerospike.cfg にあります

/etc/blackbird/conf.d/aerospike.cfg
[aerospike]
module = aerospike

# Aerospike server setting
#
#ashost = 127.0.0.1
#asport = 3000

# If aerospike cluster is set enable-security true, 
# please set asuser and aspass
#
#asuser = admin
#aspass = admin

cluster の設定で enable-securitytrue の場合は認証情報が必要になります
適宜 asuser 等を設定してください

監視の間隔は 60 秒がデフォルトですが、変更したい場合は

/etc/blackbird/conf.d/aerospike.cfg
interval = 30

のように指定してください

設定が終わったら blackbird を再起動させます

sudo /etc/init.d/blackbird restart

Zabbix 上でデータが入ってきているか確認する

Zabbix の Template は github の repositoryにあります
Zabbix に import して対象のサーバーに適用させて下さい

Zabbix 上の host 名と blackbird が起動しているサーバーの host 名が違う場合は /etc/blackbird/conf.d/aerospike.cfg 上で hostname を設定してあげる必要があります
Zabbix 上と合わせてください

/etc/blackbird/conf.d/aerospike.cfg
hostname = your_static_hostname

その他

  • この module は Aerospike 3.3.26 と 3.4.0 で動作確認してます
  • Aerospike 3.4.0 の場合、asinfo (citrusleaf で取れる値)の一部の format が崩れている不具合があるので取得できない item があります
0
0
0

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
0
0