ãfluentdãã¨ãStormãã®æ¯è¼ã«ã¤ãã¦
ã¾ãã両è
ã¯ããªãæ§è³ªã®ç°ãªããããã¯ããªã®ã§ã以ä¸ã®æ¯è¼ã¯çéãã
çéãã§ãããã¨ãåæã«ãã¹ããªã¼ã ãã¼ã¿å¦çãã©ãããã©ã¼ã ã¨ãã¦ã®ä¸¡è
ãæ¯ã¹ã¦ã¿ãã
åºæ¬æ å ±
fluentd
http://fluentd.org/
ä»ãã¨ããããã°ã³ã¬ã¯ã¿ã¼/ã¤ãã³ãã¢ã°ãªã²ã¼ã¿ã¼ãRubyã§å®è£
ããã¦ããã軽éé«éã
RPCåºç¤ã§ã¯ãªãããã®ä¸ã®ã¬ã¤ã¤ã¼ã«ä½ç½®ãããããã¯ãã
Storm
http://storm-project.net/
åæ£RPCåºç¤ãã¹ããªã¼ã ãã¼ã¿çMapReduce風ãã¬ã¼ã ã¯ã¼ã¯ãJava+Clojureã§å®è£
ããã¦ããã
æ¦è¦ã«ã¤ãã¦ã¯ãä¸è¨ã®ã¹ã©ã¤ããã¨ã¦ãããããããã£ãã
Twitterのリアルタイム分散処理システム「Storm」入門
ã¹ããªã¼ã ãã¼ã¿å¦çã§ä½ãããã®ãã«ã¤ãã¦
ã¹ããªã¼ã ãã¼ã¿å¦çã®ãã¼ãºã«ã¤ãã¦ãèªåãç解ãã¦ããç¯å²ã§ã®ç°¡åãªèª¬æã
å ¸åçãªWebã¢ããªã±ã¼ã·ã§ã³ã®ã¢ã¼ããã¯ãã£ãããªãã¡ã¢ããªã±ã¼ã·ã§ã³ãµã¼ãããã»ã¹ãã¹ãã¼ãã¬ã¹ã§ããããã¼ã¿ã®æ°¸ç¶åã¯DBã®ã¿ãæ ãã¿ã¤ãã®ã½ããã¦ã§ã¢ã«ãä¸æãããã¾ã£ã¦ãããªãã¿ã¤ãã®å¦çããããå ·ä½çã«ã¯ã
- ãªã¢ã«ã¿ã¤ã ã©ã³ãã³ã°
- ãªã¢ã«ã¿ã¤ã ãã¬ã³ãåæ
- ãªã¢ã«ã¿ã¤ã ä¸æ£ç£è¦
ã¨ãã£ããã®ã
ãã©ã³ãã³ã°ï¼Redisã§ãããããªããRedisãæ軽ã§ããã§ããããã ãç´è¿ã®60åéã対象ã«ããã¦ãã¼ã¯ã¢ã¯ã»ã¹ã©ã³ãã³ã°ãã¿ãããªãã¨ããããã¨ããã¨ãRedisã§ã¯é£ãããããããªã (æéçªãå¾ã
ã«ãããã¦ããå¿
è¦ãããã...)
(=> ãããªfluentdãã©ã°ã¤ã³ãæ¸ãã: http://d.hatena.ne.jp/kazuk_i/20130506)
ããã¬ã³ãåæãããã¯Twitterã®"Worldwide Trends"æ©è½ã¿ãããªãã®ã§ãä»ä¸çªããããªããã·ã¥ã¿ã°ããªã¢ã«ã¿ã¤ã ã§æãã¦ãããããããã®ãã¾ãããããRedisã§äºè¶³ãã... ãã ããã¬ã³ããå¤å®ããã¢ã«ã´ãªãºã ããRedisãæã¤ãã¼ã¿æ§é ã§è¡¨ç¾ã§ããã»ã©ã«ãåååç´ã§ããå¿ è¦ãããããï¼åä½æéãããã®ãããæ°ã§ã½ã¼ãããä¸ä½ã¢ã¤ãã ãã¨ãï¼ã
ãä¸æ£ç£è¦ããã¨ãã°ãã¹ã¯ã¼ãã®brute force ã¢ã¿ãã¯ãé²ãããã¨ããbotã«ãããµã¤ãã¯ãã¼ã«ãä¸å®ã®å¶éãè¨ãã¦é®æããããªã©ãéå»ã®ã®ã¢ã¯ã»ã¹ãã¿ã¼ã³ã¨ç´è¿ã®ã¢ã¯ã»ã¹ãçµã¿åããã¦ç·åçã«å¤æããå¿ è¦ãããããã¯Redisã¨ãã§ã¯ã¡ãã£ã¨é£ãããã
ã¤ã¾ããç¶æ å¤åãéå»ã®å ¥åã®è¤éãªéãåããã¨ãã¦å°ããããããªã¢ãã«ã¯ãRDBMSãå種KVSãRedisãªã©ã«è¼ããã®ãé£ãããç¡çã«è¼ããã¨ãã¢ãããã¼ãã®ãã³ã«å¤§éã®READã¯ã¨ãªãèµ°ããããã¨ã«ãªã£ã¦ãã¾ããç¾å®çãªããã©ã¼ãã³ã¹ãåºãªãã
ã§ã¯ã©ãããããå¿
è¦ãªãã¼ã¿ãã¢ããªã±ã¼ã·ã§ã³ããã»ã¹å
é¨ã«ãã¤ã³ã¡ã¢ãªã§ä¿æããã
ããã¨è¦ªåæ§ãé«ãããªã®ããã¹ããªã¼ã ãã¼ã¿å¦çã§ãããã¤ãã³ãããªãã³ãªã¢ã¼ããã¯ãã£ã§ããããã®ããã®ãã©ãããã©ã¼ã ã¨ãã¦ä¸ã«ç»å ´ããã®ããä¾ãã°Apache S4ã§ãã£ãããTwitter Stormã§ãã£ããããããã§ãä¸ã§ãStormãä¸çªã¢ãã¦ããå°è±¡ãããã
ã¹ããªã¼ã ãã¼ã¿ãé次å¦çããã¨ããææ³ã¯ãéèç³»ã®ã·ã¹ãã çã§ã¯éååããã馴æã¿ã®ã¢ããã¼ãã ã£ããããï¼ä¸æ£ç£è¦ã¨ãï¼ãWebæ¥çã§ã¯ãããï¼âï¼å¹´ã§ãã³ã¢ã¹ãµã¤ã(Twitterã¨ãFacebookã¨ã)ã¸ã®å°å
¥ãé²ã¿ãããã¦ãããï¼âï¼å¹´ã§ããããã£ããããã¯ã(Stormã¨ã)ããªã¼ãã³ã½ã¼ã¹åããã¦ãæã
ãæ°è»½ã«ä½¿ããããã«ãªã£ãã
Stormã®ã¹ã´ã¤ã¨ãã
ãã種ã®ï¼å¤§å¤æ°ã®ï¼ï¼å¦çããMapReduceã§ã»ã¼ç¡å°½èµã«ã¹ã±ã¼ã«ã¢ã¦ãããããã«ãªã£ãã®ã¨åæ§ã«ãStormã§ãSpout+Boltãçµã¿åããããã¨ã§ããã種ã®ã¹ããªã¼ã ãã¼ã¿å¦çãã©ãã¾ã§ãã¹ã±ã¼ã«ããããã¨ãã§ãããTwitterè¦æ¨¡ã®ãã©ãã£ãã¯ã§ããã¬ã³ãããã·ã¥ã¿ã°ã®ã©ã³ãã³ã°ããªã¢ã«ã¿ã¤ã ã«ç®åºãããªãã¦ç¨éã«ãã£ã¦ã¤ãã
Stormã®æ¬ ç¹
MapReduceã¯ã©ãã¾ã§ãã¹ã±ã¼ã«ãã代ããã«ãè¨ç®å¹çãç ç²ã«ãã¦ããé¢ããããããããåèªæ°ãã«ã¦ã³ããããµã³ãã«ãªããã¯ããã£ã¦ãå¦çå
容ã«æ¯ã¹ã¦ããã®ãªã¼ããããã極端ã«å¤§ããä¾ã ã¨æãï¼ã¾ãå®éã«ã¯ãããã¯ã¼ã¯ããã£ã¹ã¯IOãããã«ããã¯ãªã®ã§ãã¾ãåé¡ã§ã¯ãªãã®ãããããªããã©ï¼ãåãäºãSpout+Boltã¢ãã«ã«ãè¨ããã
ããã¯æ¬ ç¹ã¨ãããããã¹ã±ã¼ã©ããªãã£ã追æ±ããçµæã§ããå¿
ç¶ã
fluentdã®ããã¨ãã
fluentdã¯ããã¾ã§å管ãªã®ã§ãStormã®ããã«åæ£å¦çåºç¤ãæä¾ãã¦ãããããã§ã¯ãªãããããfluentdã«ã¯å
¥åºåãã©ã°ã¤ã³APIãç¨æããã¦ããã®ã§ããã©ã°ã¤ã³ãæ¸ããã¨ã§ããã¼ã¿ããã¼ã«å¯¾ãã¦ä»»æã®å¦çãè¡ããã¨ãã§ãããã¤ã¾ããã®æ°ã«ãªãã°ãfluentdã«è¤éãªã¹ããªã¼ã ãã¼ã¿å¦çãè¼ãã¦ãã¾ããã¨ãã§ããã
ä¸æ¹ã§ããã©ã³ã¶ã¯ã·ã§ã³ãã¸ã§ããã©ããã³ã°æ©è½ãå¿
è¦ã§ããå ´åããã¹ã¦èªåã§å®è£
ãããã¨ã«ãªãã
â»fluentdã¹ããªã¼ã ã«å¯¾ããã¢ãããã¯ã«ã¯ã¨ãªãç»é²ãã¦çµæãå¾ãã¨ããã¢ã¤ãã¢ãåå¨ãã :
fluentd+Esperで動的ストリー ムクエリ
@angostura11ããä½ã®Esperãããã¯ã¹ã´ã¤ï¼
èé害æ§ã«ã¤ãã¦
ããã¯ããé«å¯ç¨æ§ãã¨ãæ´åæ§ãã®ï¼ã¤ã«åãã¦èããå¿ è¦ãããã¨æãã
é«å¯ç¨æ§ã«ã¤ãã¦
- Storm
- é«å¯ç¨æ§ã¯Stormã®æ大ã®å£²ãã®ä¸ã¤ãHadoopåæ§ãMasterãã¼ããWorkerã«ã¿ã¹ã¯(SpoutãBolt)ãåçã«å²ãæ¯ããWorkerã«é害ãçºçããå ´åãã¿ã¹ã¯ã¯å¥ã®Workerã«èªåçã«å¼ãç¶ãããã
- fluentd
- 稼åãã©ã°ã¤ã³ãåçã«ãããã¤ãããããªä»çµã¿ã¯ç¨æããã¦ããªããé«å¯ç¨æ§ãå®ç¾ããã«ã¯ãåãè¨å®ã®Workerãè¤æ°ä¸¦ã¹ã¦ãHAæ§æã«ããå¿ è¦ãããï¼
æ´åæ§ã«ã¤ãã¦
- Storm
- ä¸ã§è¦ãããã«ãã¹ããªã¼ã ãã¼ã¿å¦çæ¹å¼ã®æ大ã®ã¡ãªããããã¢ããªã±ã¼ã·ã§ã³ããã»ã¹ããã¼ã¿ãã¤ã³ã¡ã¢ãªã«æããããããã¨ã§ããã¨ããã¨ããStormãæ¡ç¨ããã°èé害æ§ãæ ä¿ãããã®ã§ãæ´åæ§ãä¿ããããã¨èããã®ã¯å¦¥å½ãªã®ãï¼ä¾ãã°Stormã«æ¨æºã§ä»ãã¦ããワードカウントのサンプルプログラムãããã®å®è£ ãè¦ãã¨ãç´¯è¨ã«ã¦ã³ãå¤ã¯ãWorkerã¹ã¬ããå ã®ãéè¨æ å½Boltãä¿æãã¦ããHashMapインスタンスã«ä¿åããã¦ãããã¤ã¾ããä½ããã®é害ãçºçãããã®ã¤ã³ã¹ã¿ã³ã¹ããã¹ããããµã¼ããå¹ãé£ãã§ãã¾ãã°ãï¼ä»¥éã®å¦çã¯ä»ã®Workerãåãç¶ãã§ããããã®ã®ï¼å½ç¶æ°Boltããemitãããå¤ã¯ã¼ãã«ãªã»ãããããããããä½ã¨ãããã«ã¯ãä¸éãã¼ã¿ï¼ä¸è¨ä¾ã§ããã°ãç´¯è¨ã«ã¦ã³ãå¤ãªã©ï¼ããRedisã®ãããªå¤é¨DBã«memoizeããªããã°ãªããªãããããããã§ã¯ããã©ã¼ãã³ã¹ãåºãªãããããããã¹ããªã¼ã ãã¼ã¿ã¨ãã¦Stormã§å¦çããå¿ ç¶æ§ãç¡ãããã
- fluentd
- ä¸ã¨åãäºãfluentdã§ãè¨ãããå ãã¦ãfluentdã§ã¯ãã¼ã¿ãWorkerã§å¿ ãå¦çããããã¨ã®ä¿è¨¼ãç¡ãã
ä¸è¨ã®ãããªæ´åæ§ãªã¹ã¯ã«é¢ããèãæ¹ããã¹ããªã¼ã ãã¼ã¿å¦çãæãç¹å¾´ã¥ããã®ã§ã¯ãªããã¨ããæ°ããã¦ããã
èªåã¯ã©ãããã
å¼ç¤¾ï¼CareerLink Vietnamï¼ã¯æ¥åã®æ§è³ªä¸ãã¢ã¯ã»ã¹ãã¿ã¼ã³ã®å¯è¦åãã¦ã¼ã¶ä¸æ£è¡åç£è¦ãéè¦ãã²ã¨æã»ã©åãã段éçã«ãå種å¦çãã¹ããªã¼ã ãã¼ã¿å¦çã¨ãã¦å®è£
ããªããã¦ããã
ãããããã¡ã®ã¤ã³ãã©ã¯è¦æ¨¡ãããªãå°ããï¼ãµã¼ããï¼å°ãããªããï¼ãã¹ããªã¼ã ãã¼ã¿å¦çã®ããã«ä½å°ããã¼ããå²ãå½ã¦ããã¨ã¯ã§ããªããStormã®å¼·ã¿ãæ´»ãããç°å¢ã§ã¯ãªãããã°ããã¯Stormã諦ãã¦ãfluentdã§ããããã«ã¹ããªã¼ã ãã¼ã¿å¦çãããã¨æã£ã¦ããããªã«ããfluentdãªãRubyã§æ¸ããããï¼ãããä¸çªå¤§ããï¼
"fluentd as a Poor-man's Storm"ã ã©ãããªãã