ã¯ããã«
elasticsearch
ã¯ã©ã¹ã¿ãEC2
ä¸ã«æ§ç¯ãã¦ã¿ã¦ã¯ã©ã¹ã¿æ§ç¯ã®æé ã«ã¤ãã¦æ´çãã- æ¢ã«ç¨¼åãã¦ããã¯ã©ã¹ã¿ã«ãã¼ãã追å ããæé ã«ã¤ãã¦ãæ´çãã
åè
ã¯ã©ã¹ã¿æ§ç¯ã®æé
ãã¼ãéã§ã¯ã©ã¹ã¿åããããã
elasticsearch
ã¯åºæ¬çã«ãã¼ãéã§ã¯ã©ã¹ã¿åãåãååã«ãã¦ããã¨åæã«ã¯ã©ã¹ã¿æ§æãçµãã§ãããã
cluster.name: mycluster-test
ã©ããã£ã¦ä»²éãè¦ã¤ãããï¼
ã¯ã©ã¹ã¿å
ã®ä»²éãè¦ã¤ããå ´åãelasticsearch.yml
ã«ä»¥ä¸ã®ããã«æ¸ããã¦ããããã©ã«ãã§ã¯ Multicast
ã使ã£ã¦ä»²éãè¦ã¤ããã
Discovery infrastructure ensures nodes can be found within a cluster and master node is elected. Multicast discovery is the default.
ã¾ãã仲éã®æ¢ç´¢ã«ã¯ zen discovery ã使ããã¦ããã¨ã®ãã¨ã
EC2 ã®å ´åã¯ã¡ãã£ã¨äºæ ãéã
EC2
ä¸ã§ elasticsearch
ã¯ã©ã¹ã¿ãæ§ç¯ããå ´åã«ã¯ã¡ãã£ã¨ããäºæ
ãä»å¨ãã¦ã¤ã³ã¹ãã¼ã«ãã¦å³ã¯ã©ã¹ã¿æ§æã¨ã¯ãããªãããã®å¤§äººã®äºæ
*1ã¨ã¯ EC2
ã§ã¯ãã«ããã£ã¹ããå©ç¨åºæ¥ãªãã¨ã®ãã¨ãã¨ãããã¨ã§ã以ä¸ã®ããã«ã¦ããã£ã¹ãã§ä»²éãè¦ã¤ããè¨å®ãè¡ãã
--- elasticsearch.yml.original 2014-01-18 23:33:35.981570864 +0900 +++ elasticsearch.yml 2014-01-19 00:23:13.686020271 +0900 @@ -316,12 +316,12 @@ # # 1. Disable multicast discovery (enabled by default): # -# discovery.zen.ping.multicast.enabled: false +discovery.zen.ping.multicast.enabled: false # # 2. Configure an initial list of master nodes in the cluster # to perform discovery when new nodes (master or data) are started: # -# discovery.zen.ping.unicast.hosts: ["host1", "host2:port"] +discovery.zen.ping.unicast.hosts: ["xxx.xxx.xxx.1", "xxx.xxx.xxx.2"] # EC2 discovery allows to use AWS EC2 API in order to perform discovery.
ä¸è¨ã®ããã« discovery.zen.ping.multicast.enabled: false
ãæå¹ã«*2ãã¦ä»²éã¨ãªã IP
ã¢ãã¬ã¹ãããããæå®ãã¦ãããããã®è¨å®ã¯ä»²éã¨ãªãå
¨ã¦ã®ãã¼ãã§è¨å®ããï¼ããï¼ãè¨å®å¾ãelasticsearch
ãåèµ·åããã¨ã¯ã©ã¹ã¿ãæ§æãããããã®ã¯ã©ã¹ã¿ãè¦ãç®ãé®®ããã«ç®¡çãããå ´åã«ã¯ elasticsearch-head ã ElasticHQ ã使ãã¨è¯ãã¨æãã以ä¸ãelasticsearch-head ã§ã¤ã³ããã¯ã¹å
ã®ã·ã£ã¼ãã®ç¶æ
ã確èªããå³ã
ã¾ãã以ä¸ã¯åãã¯ã©ã¹ã¿ã ElasticHQ ã§ç¢ºèªããå³ã
è¦ãç®ã¯ ElasticHQ ãç¾ããã elasticsearch-head ã®æ¹ãã·ã£ã¼ãé ç½®ç¶æ³ãããã¨è¦ãã¦å¬ãããããã¨ãããã¨ã§ãå®éã®ãå©ç¨ã¯ã好ã¿ã§ã
ã¯ã©ã¹ã¿ãè²ã ã¨ã¤ã¸ã
ä»å㯠fluent-plugin-twitter ã§åéãããã¤ã¼ãã elasticsearch
ã¯ã©ã¹ã¿ã«çªã£è¾¼ãã§è²ã
ã¨ã¤ã¸ã£ã¦ã¿ãã
æ¢ã«ç¨¼åãã¦ããã¯ã©ã¹ã¿ã«ãã¼ãã追å ãã¦ã¿ã
æ¢ã« 2 å°ã®ãã¼ãã§ç¨¼åãã¦ããã¯ã©ã¹ã¿ã«æ°ãã«ãã¼ãã追å ããããã¹ã¦ã®ãã¼ãã«æ°ãã仲éã discovery.zen.ping.unicast.hosts
ã«è¿½å ããã
discovery.zen.ping.unicast.hosts: ["xxx.xxx.xxx.1", "xxx.xxx.xxx.2", "xxx.xxx.xxx.3"]
åã ã®ãã¼ããåèµ·åããã¨ä»¥ä¸ã®ããã« 3 ãã¼ãæ§æã®ã¯ã©ã¹ã¿ãåºæ¥ä¸ããã
ãâ
ããã¼ã¯ã master node
ã®è¨¼ããã®ã¤ã³ããã¯ã¹ã¯ 5 ã¤ã®ã·ã£ã¼ãã« 1 ã¤ã®ã¬ããªã«ï¼è¤è£½ï¼ãªã®ã§ãã¼ã¿ã« 10 ã·ã£ã¼ãã 3 ãã¼ãã«åå²ãã¦ããç¶æ
ã
é害çºçï¼ï¼1ï¼ï¼worker node ãåæ¢ããï¼ï¼
worker node
ã® elasticsearch
ãåæ¢ããå ´å...
ã·ã£ã¼ãã®åé
ç½®ãçºçã㦠10 ã·ã£ã¼ãã 2 ãã¼ãã§ä»²è¯ãåãæã¤ãã¨ã«ãªãããã¼ã¿éãå°ãªãçºãåé
ç½®ãä¸ç¬ãå度ãelasticsearch
ãèµ·åããã¨...
å¥ã®ååï¼åæ¢å㯠N'Garai
ï¼ã§åããã¥ã¼ãããã·ã£ã¼ãã®åé
ç½®ãè¡ãããã
é害çºçï¼ï¼2ï¼ï¼master node ãåæ¢ããï¼ï¼
ã¤ãã¤ãmaster node
ãåæ¢ããï¼ï¼ãï¼ä»¥ä¸ã®ããã«åçç¡ç¨ã« worker node
ã®ä¸å°ã master node
ã«ææ ¼ãã¦ã·ã£ã¼ãã®åé
ç½®ãè¡ãããã
æ¹ãã¦å
master node
ã® elasticsearch
ãèµ·åãããã¨...
å
ã»ã©ã® worker node
ã®æã¨åæ§ã«å¥ã®ååã§åããã¥ã¼ãä½ããmaster node
ã«æ»ããã¨ã¯ãªãããã¾ã§ã worker node
ã¨ãã¦åããã¥ã¼ããããã ãã©ã®ãã¼ãããã¹ã¿ã¼ãã¼ãã«ãªãã®ãã«ã¤ãã¦ããå°ãçªã£è¾¼ãã§èª¿ã¹ã¦ã¿ããã
è£è¶³
æ¤è¨¼ãã¦ãã¦æ°ã¥ããç¹çã
t1.micro
ã§æ¤è¨¼ãè¡ã£ããswap
é åãç¡ãã¨elasticsearch
ãèµ·åããªããã¨ããã£ã- ãã ã
swap
é åç¡ãã¦ãèµ·åããããããã¨ããã£ã
次åã¯...
EC2
ã§AWS API
ãå©ç¨ãã¦èªåçã«ã¯ã©ã¹ã¿ãæ§æåºæ¥ã AWS Cloud Plugin for Elasticsearch ã試ãã¦ã¿ã- ã©ã¼ãã£ã¦ãã¹ã¿ã¼ã決ã¾ãã®ãã確èªãã
- ã¯ã©ã¹ã¿ã¸ã®ãã¼ã¿ç»é²ã£ã¦ããããã©ãããã®ãï¼ï¼fluent-plugin-elasticsearchçã§ãã¹ã¿ã¼ãã¼ãã® IP ããæå®ãã¦ããªãå ´åã¨ã...ï¼