Fluentd+Elasticsearch+Kibana+Norikra+Zabbixã使ã£ã¦OpenStackã®ãã°è§£æãã¦ã¿ã
OpenStackã®åºåãã大éã®ãã°ãNorikraã®SQLã¹ããªã¼ãã³ã°è§£æã«ããããã¨ã§ãåã ã®ãã°ã¡ãã»ã¼ã¸ããã§ã¯ãªãããã°éã®å¾åããæ»æãé害ãæ éã®æ¤åºãã§ããããã«ãªãã¾ããã
ãã¯ããã¸ã¼ã³ã©ã
- 2015å¹´07æ14æ¥å
Ž
1. ã¯ããã«
OpenStack ®ãéç¨ãã¦ããã¨å¤§éã®ãã°ãåºåããã¾ããæ£å¸¸æã§ãERRORã®ãã°ãåºåãããããERRORã®ãã°ãåºããéç¥ããããããªè¨å®ããã¦ããã¨ãã¢ã©ã¼ãã®åµã«ãªã£ã¦ãã¾ãã¾ãããã®ããããã°ã¯é害çºçå¾ã®åå åæã主ãªä½¿ããæ¹ã§ããã
OpenStackã®åºåãã大éã®ãã°ãNorikraã®SQLã¹ããªã¼ãã³ã°è§£æã«ããããã¨ã§ãåã ã®ãã°ã¡ãã»ã¼ã¸ããã§ã¯ãªãããã°éã®å¾åããæ»æãé害ãæ éã®æ¤åºãã§ããããã£ã¦ã¿ã¾ããã
OpenStackã®ãã°ã解æããã®ã«Fluentd + Elasticsearch + Kibana + Norikra + Zabbixãçµã¿åããã¦æ¬¡ã®é ç®ã確ããã¦ã¿ã¾ããã
(1) OpenStackã®ãã°ãåéãã¦ã°ã©ãåããã
(2) OpenStack keystoneã®ã¢ã¯ã»ã¹ãã°ãNorikraã§è§£æãã¦Keystoneã¸ã®æ»æãæ¤åºããã
(3) ãã°ã®è§£æããç°å¸¸æ¤åºãã¢ã©ã¼ãã¾ã§ãèªååããã
2. ã·ã¹ãã æ§æ
2.1. 使ç¨ãã¼ã«ä¸è¦§
æ©è½ |
ãã¼ã«å |
æ¦è¦ |
ãã°åé |
Fluentd |
ãã°ã®åéãä¸ç¶ãã¼ã« ElasticsearchãNorikraã¸ãã¼ã¿ã転éããã |
ãã°è§£æ |
Norikra |
SQLã¹ããªã¼ãã³ã°ã解æãã |
ç£è¦ |
Zabbix |
ç£è¦ãã¼ã« |
ãã°æ¤ç´¢ |
Elasticsearch |
å ¨æ解æã¨ã³ã¸ã³ |
ãã°å¯è¦å |
Kibana |
Elasticsearchã¸æ ¼ç´ããããã¼ã¿ãå¯è¦åãã |
OpenStack |
Devstack |
Kilo-stableç all-in-oneæ§æ |
OpenStackã®èªè¨¼ |
Keystone |
OpenStackã®èªè¨¼ç¨ã³ã³ãã¼ãã³ã |
2.2. ã·ã¹ãã å¦çã¤ã¡ã¼ã¸
ãã°ã解æããä»çµã¿ã¨ãã¦ããããªããã¼ãèãã¦ã¿ã¾ããã
(1) OpenStackãåºåãããã°ãããã°ä¸ç¶ãµã¼ãã¼ã¸éç´ããã
(2) éç´ãããã°ãElasticsearchã¨Norikraã¸éä¿¡ããã
(3) Norikraã¸éããããã°ããSQLã¹ããªã¼ãã³ã°è§£æã«ãããã
(4) 解æã®çµæã¯åé¡ã®æç¡ã«é¢ãããElasticsearchã¸æ ¼ç´ããç°å¸¸ãæ¤åºãããå ´åã¯Zabbixã¸éç¥ããã
(5) é常ã®ãµã¼ãã¼ç£è¦ã¯Zabbixãè¡ãã
(6) (2)ã(4)ã§Elasticsearchã¸éããããã¼ã¿ã¯Kibanaã使ç¨ãã¦å¯è¦åããã
å³ 1ãã·ã¹ãã å¦çã¤ã¡ã¼ã¸
3. ãã°ãåéãã¦ã°ã©ãåãã¦ã¿ãã
ã¾ãã¯ãOpenStackã®åã³ã³ãã¼ãã³ããåºåãããã°éã®æ¨ç§»ã¨ãAPIå®è¡æ°ã®æ¨ç§»ã®ã°ã©ãåãã¦ã¿ã¾ããããã°ã¡ãã»ã¼ã¸ã®å 容ããå¤æããã®ã§ã¯ãªãããã°ã®åºåå¾åããé害ãæ éã®æ¤åºãã§ãããã試ãã¦ã¿ã¾ããã
å®éã«åããã¦ã¿ãã¨ãOpenStackã«åãããã£ãæé帯ã¯ããã°éãAPIå®è¡æ°ã®ã°ã©ãã«å¤åãè¦ããã¾ããã(å³ 2ãå³ 3)
å³ 2 ãã°éã®æ¨ç§»
å³ 3 APIå®è¡æ°ã®æ¨ç§»
ããã ãã§ã¯ãã°ã©ãåãã¦ããªãã¬ã¼ã¿ãç®è¦ã§ç¢ºèªããªãã¨ãããªãã®ã§ã¤ãã¤ãã§ããã
4. OpenStackã®ãã°è§£æ
4.1. ãã°è§£æã¯BigDataã
ãã°ã®è§£æã¯å¤§éã®ãã¼ã¿ã解æãããã¨ã«ãªãã®ã§ãBigData解æææ³ã使ããã¨ãã§ãã¾ãã
BigData解æææ³ã¨ãã¦ã¯ããã¨ãã°ããªã¢ã«ã¿ã¤ã 解æã¨ã³ã¸ã³ã®CEP (Complex Event Processing)ãæ©æ¢°å¦ç¿ã®Jubatusãããã¾ãã
ä»åã¯ãã®CEPã使ã£ã¦ããNorikraã使ã£ã¦ããã°è§£æããã¾ããã
Norikraã¨CEPã®è©³ç´°ã¯ãã¡ãï¼http://dev.classmethod.jp/etc/norikra-esper-epl/
Norikraã¸ã¯Fluentdã®fluent-plugin-norikraã使ç¨ãã¦ãã¼ã¿ãéãã¾ãã
4.2. Keystoneã¸ã®DOSæ»ææ¤ç¥
4.2.1. ããã¿
Keystoneã®ã¢ã¯ã»ã¹ãã°ãFluentdã§Norikraã«éãã¾ããåä½æéãããã®ã¢ã¯ã»ã¹å IPã¢ãã¬ã¹ãéè¨ãã¦ãåãIPã¢ãã¬ã¹ããç°å¸¸ãªã¢ã¯ã»ã¹éããã£ãå ´åã«ã¯Zabbixã§éç¥ãã¾ãã
ä¾ï¼ã¢ã¯ã»ã¹æ°ã1åéã«90å以ä¸
4.3.å®éã«æ»æãã¦ã¿ã
keystoneå®ã«å¤§éã®å½tokenåå¾APIãé£ç¶ã§å®è¡ãã¦æ¤ç¥ãã§ãããã試ãã¦ã¿ã¾ããã
curl -i -X POST http://127.0.0.1:5000/v3/auth/tokens -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'User-Agent: python-keystoneclient' -d '{"auth": {"identity": {"methods": ["password"],"password": {"user": { "id": "<åå¨ããªãID>", "password": "<é©å½ãªæåå>"}}}}}' |
4.3.1. ã°ã©ãåãä¸è¦§å
ã¾ãã¯ããã°ã®è§£æãããã«ãåéãããã°ãã°ã©ãåãã¾ããã
ã¢ã¯ã»ã¹ä»¶æ°ã®æ¨ç§»ãã°ã©ãåãããã¨ã§ãæ®æ®µã¨éã使ããæ¹ãããã¦ããå ´åã¯ãã°ã©ãã®å½¢ãå¤ããã®ã§ãªãã¬ã¼ã¿ã確èªãæãã§ãã(å³ 5)
å³ 5ãã°ã©ãå
ã¢ã¯ã»ã¹å ã®å¤ãé ã«ã½ã¼ããã¦ä¸è¦§è¡¨ç¤º(å³ 6)
éå°ãªã¢ã¯ã»ã¹ãããã°ã¢ã¯ã»ã¹æ°ã¨å ±ã«è¡¨ç¤ºãããã®ã§ããã¡ãããªãã¬ã¼ã¿ãæ»æå IPã¢ãã¬ã¹ãç¹å®ãæãã§ãã
ã¾ã ã¾ã ãªãã¬ã¼ã¿ãå¼µãä»ãã¦ããªããã°ãããªãã®ã§ã¤ãã¤ãã§ããã
å³ 6 ä¸è¦§å
4.3.2. Norikraã®è¨å®
ããããã¯Norikraã使ã£ã¦ãã°ã®è§£æãããã¦ã¿ã¾ããã
Norikraã®Queriesã«ä¸è¨ã®ããã«è¨å®ãã¾ãããSQLæã§è§£ææ¡ä»¶ãè¨è¿°ã§ããã®ã§ãSQLãå¾æãªäººã§ããã°ã©ããªã«ã¼ã«ã§ãæ¸ãã¾ãã
ãã®è§£æã®æ¡ä»¶ã«ãããããããZabbixã«ã¢ã©ã¼ãããããããã«ãã¾ãã
SELECT host, COUNT(*) as requests FROM norikra_openstack_keystone_access.win:time_batch(1 min) GROUP BY host HAVING COUNT(*) >= 90 |
ãã¹ãåãã¨ã«ã¢ã¯ã»ã¹æ°ãéè¨ã1åéã®SQLã¹ããªã¼ãã³ã°è§£æã§90件以ä¸ãã°ãåºåããã¦ãããç°å¸¸ã¨å¤æãã¾ãã
å³ 4 Norikra
5. Zabbixã§éç¥
Norikraã§ãã°ã解æããã ãã§ã¯ãKibanaã§ã®å¯è¦åã¨åæ§ã«ãªãã¬ã¼ã¿ãç®è¦ã§ç¢ºèªãç¶ããå¿ è¦ãããã¾ããç£è¦ã®éç¥ã®ããã«Zabbixã¨ãé£æºããã¦ãæ éãæ¤åºã解æãéç¥ã¾ã§ã®æµããèªååãã¾ããã
5.1. Zabbix Norikraé£æº
Norikraããã°ã解æããçµæãç°å¸¸ã ã¨å¤æããå ´åã¯ãFluentdã®fluent-plugin-zabbixã使ç¨ãã¦ãZabbixã«ã¨ã©ã¼ã®éç¥ãä¸ãããã¨ã§ããªãã¬ã¼ã¿ã¸ã®éç¥ãã§ãã¾ãã(å³ 7 Zabbixæ¤ç¥)
ããã§ãªãã¬ã¼ã¿ã常ã«å¼µãä»ãã¦ããå¿ è¦ããªããªãã¾ããã
å³ 7 Zabbixæ¤ç¥
6. ã¾ã¨ã
ä»ã¾ã§é害解æã«ãã使ããã¦ããªãã£ããã°ã解æãããã¨ã§ãé害æ¤ç¥ã«æ´»ç¨ã§ãã¾ãããä»åã¯Keystoneã¸ã®æ»ææ¤ç¥ã§ããããNorikraã®SQLãä½ãããã°ãè¤æ°ã®ãã°ãã¡ã¤ã«ã«åãããå¦çãæ¤åºã§ãããã§ãã
Zabbixã¨é£æºããããã¨ã§ãæ¤åºã解æãéç¥ã¾ã§ã®ä¸é£ã®æµããèªååã§ãã¾ããã
ä»å¾ã¯ãZabbixã®ã¢ã¯ã·ã§ã³ã¨ãã¦ãæ»æå ã®NWé®æçã®é害ãæ¤åºããå¾ã®åä½ãèªååããããã§ãã
ã¾ããNorikraã®è§£æçµæãç°å¸¸ã ã¨å¤æããIPã¢ãã¬ã¹ãããGeoIPã使ã£ã¦å½ãé½å¸ãç¹å®ãã¦ãKibanaã§å°å³ä¸ã«ãããããããã¨ãã§ãã¾ããã©ãããã®æ»æãç¹å®ããæãããªãã®æ©è½ã試ãã¦ã¿ããã§ãã
OpenStack®ã¯OpenStack, LLCã®ç»é²åæ¨åã¯åæ¨ã§ãã
7. åèæç®
Fluentdã¨Kibanaã§SSHã¢ã¯ã»ã¹å ããã
http://qiita.com/hiconyan/items/e847793a291760a7ac1d
OpenStackã®æ§ç¯ãéç¨ã«ãæ©ã¿ã®ãã
NTTãã¯ãã¯ãã¹ã§ã¯ãOpenStackã使ã£ããã©ã¤ãã¼ãã¯ã©ã¦ãã®ç°å¢æ§ç¯æ¯æ´ãã
é éä¿å®/ç£è¦ã½ãªã¥ã¼ã·ã§ã³ãæä¾ãã¦ãã¾ãã
OpenStackã®å°å ¥ãæ¤è¨ãã¦ããæ¹ãéç¨ã«ãå°ãã®ããã¯ããã²ãåãåãããã ããã
OpenStackã¯ã©ã¦ãã«é¢ããå®é¡å¶ãµãã¼ããã±ããï¼