ãµã¤ãã¦ãºã®ã¯ã©ã¦ãé»ææããéç¨ãç¶ãã¦ããSolrãµã¼ãã¼ã Elasticsearchã«ç½®ãæããããã¸ã§ã¯ããå æ¥å®äºãã¾ããã
ããã¸ã§ã¯ãå®äºå ±åãããã¦ããã¸ã§ã¯ãã®ããã¾ããå ¬éãããã¨æãã¾ãã
ã¯ããã«
ãã®ããã¸ã§ã¯ãã®ä¸»è»¸ã¯ãéçªã¨åããã¬ã¬ã·ã¼æè¡ãã©ãæããï¼ãã«ãªãã¾ãã ãã®ããã¸ã§ã¯ãã®å ±åãããåã«ãããã¤ãã¨ã¯ã¹ãã¥ã¼ãºãããã¦ããã ãã¾ãã
- ã¯ã©ã¦ãé»ææãæ¯ãã¦ãããSolrã«ã¯çæ¬ã®å¿µã«è¿ãæè¬ããã£ã¦ãã¾ã
- ã¬ã¬ã·ã¼ãªæè¡ã«å¯¾ãã¦ãã¦ã³ãããã£ã¹ãªã¹ãã¯ãã®æå³ã¯ããã¾ãã
- éçªã«ãããããã¨ã«ãªã£ã¦ãã¾ã£ã人ã«å¯¾ãã¦è² ã®ææ ã¯ä¸åããã¾ãã
- ä»åã®æ¡ç¨ãã¦ããæ§æã¯Elasticsearchã®ããã¹ãã¢ã¼ããã¯ãã£ã§ã¯ããã¾ãã
- ä»å¾ãNeco ç°å¢ã¸ã®ç§»è¡ãéãã¦ç¶ç¶çã«æ¹åãã¦ããã¾ã
ãµã¤ãã¦ãºã§ã®Solrã®ä½¿ãæ¹ã¨ç¨èªèª¬æ
ãµã¤ãã¦ãºã®ã¯ã©ã¦ããµã¼ãã¹ã§ã¯ããµã¼ãã¹éå§å½åããé·å¹´ã«ãããå ¨ææ¤ç´¢ãµã¼ãã¼ã¨ãã¦Solrãæ¡ç¨ãã¦ãã¾ãããå¼ç¤¾ã§ã¯ã次ã®ããã«Solrã使ã£ã¦ãã¾ãã
- ã¢ããªã±ã¼ã·ã§ã³ãµã¼ãã¼ããã¼ã¿ãã¼ã¹ãªã©ããããã¯ããéç¨ããããã«å¿ è¦ãªã³ã³ãã¼ãã³ããã¨ã«VMãé ç½®ãã¦ãã¾ããSolrãµã¼ãã¼ãVMã«é ç½®ãã¦ãã¾ã
- ãµã¤ãã¦ãºã®ã¯ã©ã¦ããµã¼ãã¹ã¯ãã«ãããã³ãåã®ãµã¼ãã¹ã¨ãªã£ã¦ãã¾ããã客æ§ï¼ããã³ãï¼ãã¨ã«ç¬ç«ããç°å¢ãæä¾ãã¦ãã¾ãã1ãµã¼ãã¼ã§ãã¹ã¦ã®ããã³ããè³ãã®ã§ã¯ãªããä¸å®æ°ã®ããã³ããã¨ã«SolrãDBãµã¼ãã¼ãç¨æãã¦ãã¾ã
- ã客æ§å¥ã«ãã¼ã¿ãåé¢ããããããããã¯ããã¨ãããã³ããã¨ã«Solrã®ãã¤ã³ããã¯ã¹ããä½æãã¦ãã¾ããã¤ã¾ããåSolrãµã¼ãã¼ã«ã¯å¤æ°ã®ã¤ã³ããã¯ã¹ãæ ¼ç´ããã¦ãã¾ã
ããã§ãã¤ã³ããã¯ã¹ã¨ã¯ãSolrã®æ¤ç´¢ãã¼ã¿ããããç®±ãã®ãã¨ã§ããSolrã®ç¨èªã¨ãã¦ã¯ãã³ã¢ãã¨å¼ã¶ã¹ãç©ã§ãããä¸è¬ã«ã¤ã³ããã¯ã¹ã¨å¼ã°ãããã¨ãå¤ããã¨ãElasticsearchã®ç¨èªã§ãã¤ã³ããã¯ã¹ã¨å¼ã¶ãã¨ããããã®ææ¸ã§ã¯ä¸è²«ãã¦ã¤ã³ããã¯ã¹ã¨è¨è¼ãã¾ãã
ä»ã«ããã®æç« ã§ã¯æ¬¡ã®ããã«ç¨èªã使ãã¾ãã
- ã¦ã¼ã¶ã¼ã®ä½æãããã¼ã¿ãã¤ã³ããã¯ã¹ã«æ¤ç´¢ãã¼ã¿ã¨ãã¦ä¿åãããã¨ãã¤ã³ãã¯ã·ã³ã°ã¨è¨è¼ãã¾ã
- ãããããã°ã©ã ã§ã¤ã³ããã¯ã¹ãåä½æãããã¨ãåã¤ã³ãã¯ã·ã³ã°ã¨è¨è¼ãã¾ã
- å
¨ææ¤ç´¢ãµã¼ãã¹ãå©ç¨å¯è½ãªè£½åãæãã¦ãããã¯ãã¨è¨è¼ãã¾ã
- Solrãå©ç¨ãã¦ããã®ã¯kintoneãã¬ã«ã¼ã³ãã¡ã¼ã«ã¯ã¤ãºã®3ãããã¯ãã§ã
éçªã«åããã¾ã§ã®æ´å²
ããã§ã¯ãã©ã®ããã«å ¨ææ¤ç´¢ã·ã¹ãã ãéçªã¨åãã¦ãã£ãã®ããæ´å²ãç´è§£ãã¦ã¿ããã¨æãã¾ãã
éçªã«åããã¾ã§ã®æ´å²1 Solrã®ãã¼ã¸ã§ã³ã¢ãããã§ããªããªã
Solrã®ãã¼ã¸ã§ã³ã¢ããã«ä¼´ãã社å ã§å©ç¨ãã¦ãããã¼ã¯ãã¤ã¶ã®äºææ§ããªããªãåé¡ãçºçãã¾ããã
ãã¼ã¯ãã¤ã¶ã¨ã¯ãå ¨ææ¤ç´¢ãå®ç¾ããããã®æè¡è¦ç´ ã®ä¸ã¤ã§ãç´¢å¼ä»ããããããã«æç« ãã¼ã¿ãåèªåä½ãä¸å®é·ãªã©ã®æçã«åå²ããæ©æ§ã§ãã å ¨ææ¤ç´¢ã¨ã³ã¸ã³ã¯å ã®æç« ãæãIDã¨ãåå²ãããæç« ã®æçãç´ã¥ãã¦ç´¢å¼æ å ±ãä½æãã¦ãã¾ãã ããã¦ãæ¤ç´¢æã¯æ¤ç´¢ãã¼ã¯ã¼ãããã¼ã¯ãã¤ã¶ã§åå²ããåå²ãããèªå¥ãç´¢å¼æ å ±ã«ãããã調ã¹ã¦ãã¾ãã
ãã®ãã¼ã¯ãã¤ã¶ãã©ã®ããã«æç« ãåå²ãããã§æ¤ç´¢ã®ç²¾åº¦ãå¤ããã¾ãã ä¸è¬çã«ããã¼ã¯ãã¤ã¶ãæ´æ°ãããè³¢ããªããã¨ã¯æ¤ç´¢ç²¾åº¦åä¸ã«ã¤ãªãããå¬ãããã¨ãå¤ãã§ãã ããããªããããã¼ã¯ãã¤ã¶ã®äºææ§ã失ãããå ´åã¯ã¤ã³ããã¯ã¹ãã¼ã¿ã®åä½æãå¿ è¦ã«ãªãã åãæ¤ç´¢ãã¼ã¯ã¼ãã§ãæ¤ç´¢çµæãå¤ãã£ã¦ãã¾ããã¨ã«æ³¨æãå¿ è¦ã§ãã
å¼ç¤¾ãããã¯ãã®kintoneã§ã¯ãã¬ã³ã¼ãçµãè¾¼ã¿æ©è½ã®ä¸é¨ã«å ¨ææ¤ç´¢ã¨ã³ã¸ã³ã使ç¨ãã¦ãã¾ãã ãã®ããããã¼ã¯ãã¤ã¶ãå¤æ´ããã¨ãã¬ã³ã¼ãçµãè¾¼ã¿çµæã«å¤§ããå½±é¿ãåºããã¨ãåããã¾ããã
ãããè´å½çã§ãããå½æã¯ããã解決ããæ段ãæãã¤ãããä¸æçã«ãã¼ã¸ã§ã³ã¢ãããè¦éã対å¿ã¨ãã¾ããã
éçªã«åããã¾ã§ã®æ´å²2 ãã¼ã¿è¦æ¨¡ã®å·¨å¤§å
ããã¯åã°ãããã¨ã§ãããã¯ã©ã¦ããµã¼ãã¹ã®ãªãªã¼ã¹ããæ°å¹´ã§ãã¼ã¿ã®è¦æ¨¡ã大ãããªãããã¾ããã çµæããµã¼ãã¹éå§åæã«éçºãããåã¤ã³ãã¯ã·ã³ã°ç¨ãã¼ã«ã使ãç©ã«ãªããªããªãåé¡ã«ç´é¢ãã¦ãã¾ããã
å½æã¯å ¨ææ¤ç´¢ã®ç´¢å¼æ å ±ãåä½æããããã®ãã¼ã«ãã¤ã³ãã©ãã¼ã ãæã£ã¦ãã¾ããã ãã®ããããã¼ã¯ãã¤ã¶ã®äºææ§ã¯ç½®ãã¦ããã«ãã¦ãã ãã®ãã¼ã«ãå®è¡ããã°åã¤ã³ãã¯ã·ã³ã°ãã§ããã¯ãã§ããã
ãããå®éã«ã¯ããã¼ã¿è¦æ¨¡ã巨大ã«ãªãã«ã¤ãã¦éä¸ã§ã¨ã©ã¼ãèµ·ãããã ãªãã¬ã¼ã·ã§ã³ãã¹ã§åã¤ã³ãã¯ã·ã³ã°ãéä¸ã§åæ¢ããäºæ ãèµ·ããç¶æ ã«ãªã£ã¦ãã¾ãã¾ããã
ãã¼ã«ã®è¨è¨ä¸ãåã¤ã³ãã¯ã·ã³ã°ãåæ¢ããå ´åã¯æåããããç´ããå¿ è¦ã§ã é常ã«è¦çãã¨ããªããªãã¬ã¼ã·ã§ã³ã¨ãªã£ã¦ãã¾ããã ãã¼ã«ãæ¹ä¿®ãããã«ããåããã³ãã»ãããã¯ãã®åã¤ã³ãã¯ã·ã³ã°ã®å®æ½ç¶æ³ãé²æãªã©ã®ç¶æ 管çã ä¸æã«å¼ãåããé常ã«è¤éãªãã¼ã«ã¨ãªã£ã¦ãããæ¹ä¿®ãå°é£ã§ããã
ãããã¦ãåã¤ã³ãã¯ã·ã³ã°ã¯è§¦ãã¦ã¯ãããªããªãã¬ã¼ã·ã§ã³ã«ãªã£ã¦ããã¾ããã
éçªã«åããã¾ã§ã®æ´å²3 ç¢é¢ã«ç«ã£ã¦ããã¦ããã³ã¢ã¡ã³ãã¼ã®éè·
ãããããã¦ãããã¡ã«åã¤ã³ãã¯ã·ã³ã°ã®ãªãã¬ã¼ã·ã§ã³ãç¢é¢ã«ç«ã£ã¦ãã£ã¦ããã¦ããã³ã¢ã¡ã³ãã¼ã ç¸æ¬¡ãã§éè·ãã¦ãã¾ãã¾ããä»æ¯ãè¿ãã¨å½¼ãã®ææã®å¼·ãã«å¼·ãä¾åãã¦ãã¾ããã
å½¼ãã®éè·ã®ã¿ã¤ãã³ã°ãããããåã¤ã³ãã¯ã·ã³ã°ã話é¡ã«ä¸ãã£ããã¨ã¯ç§ã®è¨æ¶ã§ã¯ããã¾ããã å½¼ãããã®è¨äºãè¦ã¦ããããããã¾ããããç¢é¢ã«ç«ã£ã¦ä½æ¥ãã¦ããããã¨ã«æè¬ããããã¾ããã
å®å ¨ãªãéçªã«åãã
ãããã£ããã¨ãéãªãSolrã®é·æéã®å¡©æ¼¬ãã決å®çã«ãªãã¾ããã
ä¸æ¹ãæ¤ç´¢ãã¼ã¿ã¯æ¥ã è¥å¤§åããæ¯å¹´1TBå¢å ããããã³ããåå¨ãã¾ããã 大ããªããã³ãã§ã¯2018å¹´æ«ã®æç¹ã§1.8TBã«éãã¾ããã ã¤ã³ããã¯ã¹ãè¥å¤§åããã«ã¤ãã¦æ¤ç´¢ã¹ãã¼ãã¯å£åãã¦ããã¾ãã
ç¹ã«ã¬ã«ã¼ã³ã¯é¡èã«æ¤ç´¢ã¹ãã¼ããå£åãæ¤ç´¢ãªã¯ã¨ã¹ãã®ã¿ã¤ã ã¢ã¦ããé »çºããããã«ãªãã¾ãã ãã¾ãã¾ãªèª¿æ»ã試ã¿ã¾ãããã解決ã«ããããæéã ããéãã¦ããç¶æ ã§ããã
Elasticsearchç½®ãæãããã¸ã§ã¯ã æ«æç·¨
æãåãããã¦Elasticsearchãç»å ´ããæ¥æ¬å½å ã§ãæµè¡ã®å ããè¦ãã¦ãã¾ããã Elasticsearchã®é«åº¦ãªæ¤ç´¢æ©è½ãã¯ã©ã¹ã¿ãªã³ã°ãªã©é åçãªæ©è½ã¯å¤ãã£ãããããµã¤ãã¦ãºã§ãç½®ãæã調æ»ããã¦ãã¾ããã ããããåã¤ã³ãã¯ã·ã³ã°ã®åé¡ããã¼ã¯ãã¤ã¶ã®äºææ§åé¡ã¯æªè§£æ±ºã®ã¾ã¾ã§ããã
å½æ社å ã§æ§æ³ãã¦ããã¢ã¼ããã¯ãã£ã§ã¯ã¯ã©ã¹ã¿æ§æã®Elasticsearchãå¤æ°éç¨ããã®ã¯ã¤ã³ãã©ã®ç®¡çã«ã¼ãã®å¤æ´ãéç¨ã³ã¹ãçã«ãã³ããã£ãããã 巨大ã¯ã©ã¹ã¿ã«ãã¹ã¦ã®ããã³ãã®ã¤ã³ããã¯ã¹å ¥ãã¦éç¨ããæ§æ³ã§ããã
ãããã調æ»ãé²ãã¦ããã¨ãå¤æ°ã®ã¤ã³ããã¯ã¹ã®æ±ãã«é£ããããã¨ãå¤æãã¾ãã
Elasticsearch ã®å·¨å¤§ã¯ã©ã¹ã¿ãè¤æ°ç¨æãããã¹ã¦ã®ã¤ã³ããã¯ã¹ãéç¨ãããã¨ã¯ã¤ã³ãã©å´ã®å¤æ´ã大ããã ãã®æ§æã§ã¯æ§ç¯ã»éç¨ä¸å¯è½ã¨ããå¤æã«ãªãã調æ»ãã®ãã®ãçªç¶åæ¢ãããã¨ã«ãªãã¾ãã
æå¾ã«ããã£ãElasticsearchã¸ã®æã¿ãèèã®ç³¸ã®ããã«åãã¦ãã¾ã£ãã®ã§ããã
Elasticsearchç½®ãæãããã¸ã§ã¯ã ããã¼ã¯ç·¨
ããã«è¿½ãæã¡ããããããã«å©ç¨ãã¦ããSolrã®ãã¼ã¸ã§ã³ãEOLã«ãªããã¨ãåããã¾ããã
çéã§ããç¶æ³ã§ã¯ãªãã£ãã®ã§ãSolrã®ç½®ãæããå¼·è¡ããããã¸ã§ã¯ããèµ·æ¡ãã¾ãã ããã¸ã§ã¯ãåãã¢ã¦ããã¢ç¨èªã§ç·æ¥çãªã¨ã¹ã±ã¼ããæå³ãããããã¼ã¯ãã¨ãã¾ããã
ããã¸ã§ã¯ããæåãããããã®æè¡çãªå¶ç´ãæ確åããå¤ãSolrããã®è±å´ã«éä¸ãã¦ãã¾ãã
Solrããè±å´ãã¦Elasticsearchãæ¡ç¨ããçç±ã§ãã
- 次ä¸ä»£ã®kintoneã¢ã¼ããã¯ãã£æ§æ³ã«ã¦Elasticsearchãæ¡ç¨ããã¦ããããæè¡ã¹ã¿ãã¯ãåããã¾ãã
- Solrã¢ã¼ã«ã¤ãå½¢å¼ãå¤ãã£ããããå¼ç¤¾ã§ç¬èªã«ã¹ã¿ãã¤ãºãã¦ããå ¨ææ¤ç´¢ãµã¼ãã¼ãæ¹ä¿®ãã¦å¯¾å¿ãããã«ã¯æéãããã
- ç¬èªã«ã¹ã¿ãã¤ãºãããµã¼ãã¼ãã¡ã³ããã³ã¹ãç¶ãããããElasticsearchãéç¨ããæ¹ãç¶æã³ã¹ãã¯ä½ãã
Elasticsearchã«ç§»è¡ããããã«è§£æ±ºãã¹ãè¦ä»¶ã¯æ¬¡ã®3ç¹ã®ã¿ã«çµãã¾ããã
- Elasticsearchä¸å®å®ååé¡
- ãã¼ã¯ãã¤ã¶ã®äºææ§åé¡
- ã¤ã³ããã¯ã¹ã®åä½æåé¡
ãã®åé¡ã解決ããããã«ã¯ä¸é¨ãé¤ãã¦é£ããæè¡ã¯ã»ã¼ä½¿ã£ã¦ãã¾ããã
ã¿ã¤ãã«ãããµã£ãã¤ã®ãã ãããã¨ãã¦ããã®ã¯å ¨ä½ã¨ãã¦éæ³ã®ããã«ãã¾ããã£ã¦ããããã«è¦ãã¾ãã å·§å¦ã«å¶ç´ãåé¿ã»ãªã¹ã¯ã許容ç¯å²ã«åã¾ãããã«æãæã¡ãä»åã®ç§»è¡ã«ããã¤ãã¦ããããã§ãã
ãã®ããã¸ã§ã¯ãã®ããã¼ã¯ã¨ããååã«ãµãããããä»ã®ç¶æ³ãã¨ã«ãããã®ãåãããã«ç§»è¡è¨ç»ãæ§æ³ãã¦ãã¾ãã K.U.F.Uãæ¹éã¨ãã¦ãã¾ããããã¨æ®éã«ããã¨å·¥å¤«ã¨ãããã¤ã§ãã
ãµã£ãã¤ã®ãã ãã1 ã¤ã³ããã¯ã¹æ°ã®å¶éãåé¿ãã
å¤æ°ã®ã¤ã³ããã¯ã¹ä½ææã«Elasticsearchãä¸å®å®åããåé¡ã¯ãIssue ãªã©ã調æ»ããçµæããã¯ã©ã¹ã¿ã«æå±ããElasticsearchãã¼ãã®éä¿¡ãåå ã§ä¸å®å®åãããã¨ãåããã¾ããã ã¾ããã³ãã¥ããã£ã®Q&A ããã¤ã³ããã¯ã¹ã®ä½æã§é¡èã«æ§è½ãå£åãããã¤ã³ãã¯ã·ã³ã°ãæ¤ç´¢ã¯åé¡ãªãè¡ãããã¨ãããã£ã¦ãã¾ããã å®éã«ç¤¾å ã§å®é¨ããã¨ãããã·ã³ãã«ãªã¯ã©ã¹ã¿ã®éç¨ã§ããã°2000ç¨åº¦ã®ã¤ã³ããã¯ã¹ããã£ã¦ãååå®å®ç¨¼åããã¨ç¢ºèªã§ãã¾ããã
æ§è½æ¤è¨¼ã¨ãã¦ã·ã³ãã«ãªElasticsearchã¯ã©ã¹ã¿ãæ§ç¯ããã¬ã¬ã·ã¼Solrã§1.8TBã®ã¤ã³ããã¯ã¹ã«ãªã£ã¦ããç°å¢ã¨åãã¼ã¿ãæã¤ç°å¢ãåç¾ãã¦ãæ¤ç´¢æ¤è¨¼ãè¡ãã¾ããã 次ã®ãããªçµè«ãå¾ããã¾ããã
- ã¬ã«ã¼ã³ã¯10åç¨åº¦ã®æ§è½æ¹åãæå¾ ã§ãã
- kintoneãã¡ã¼ã«ã¯ã¤ãºã¯æ§è½å£åãçºçããªã
- ã¬ã¬ã·ã¼Solrã¨Elasticsearch 6ã¨ã®æ¯è¼ã§40%ã®ã¤ã³ããã¯ã¹å®¹éã®å§ç¸®å¹æãæå¾ ã§ãã
Solrã¨Elasticsearchã¯å é¨ã§ã¯ã©ã¡ããApache Lucene ã使ã£ã¦ããããã大ããªæ§è½ã®éãã¯çºçããªãã ããã¨ããæ¨æ¸¬ããã¦ãã¾ããã Luceneã®é²åã¯ç´ æ´ããããã®ããããæ¨æ¸¬ã¯ããæå³ã§è£åããããã¨ãæ¤è¨¼ãéãã¦ãããã¾ããã ã¬ã«ã¼ã³ã¯å ¨æãã¼ã¿ã®æ§é ãæ¹åãã¦ããããã«å¤§ããªæ¹åãå¾ããã¦ãã¾ãã
å è¿°ã®éãããµã¤ãã¦ãºã®ã¯ã©ã¦ããµã¼ãã¹ã§ã¯ä¸å®æ°ã®ããã³ããã¨ã«ç¬ç«ããSolrãµã¼ãã¼ãç«ã¦ãéç¨ããã¦ãã¾ãããã®Solrãµã¼ãã¼åæ§ã«Elasticsearchãå¤æ°éç¨ããå½¢ã§ããã°ã ã¤ã³ããã¯ã¹æ°ã®å¢å¤§ã§ä¸å®å®åããåé¡ãåé¿ã§ãã¾ãã
ããã«ãSolrãµã¼ãã¼ã®ãããã¤ã¨åãè¦é ã§Elasticsearchããããã¤ã§ããã®ã§ã 巨大ã¯ã©ã¹ã¿ãæ§ç¯ããã®ã«æ¯ã¹ã¤ã³ãã©å´ã®ä¿®æ£ãå°ãªããªãã çæéã§ã®åºç¤æ´æ°ã«åãã¦ãããã¨ãã ããã¼ã¯ã§ã¯ãã®æ§æãæ¡ç¨ãã¾ããã
ãµã£ãã¤ã®ãã ãã2 ãã¼ã¯ãã¤ã¶ã®äºææ§ã確ä¿ãã
Elasticsearchã§ã¯ãã¼ã¯ãã¤ã¶ãæãã¦ã¢ãã©ã¤ã¶(Analyzer)ã¨è¡¨è¨ãããã¨ãå¤ãã§ããããã®ããã¥ã¡ã³ãã§ã¯ä¾¿å®ä¸ãã®ã¾ã¾ãã¼ã¯ãã¤ã¶ã¨ãã¾ãã
Elasticsearchã調æ»ããã¨ããããã¼ã¯ãã¤ã¶ã¯ãã©ã°ã¤ã³æ©æ§ã§æ¡å¼µã§ãããã¨ãåããã¾ããã Elasticsearchãæä¾ãã¦ããã¢ã¸ã¢åã®è¨èªåãã®ãã¼ã¯ãã¤ã¶ã® icu-analysis-plugin ã®å®è£ ã調ã¹ãã¨ãããæ°ç¾è¡ã®ã·ã³ãã«ãªã³ã¼ãã§ããã
å ãã¦ããã©ã°ã¤ã³ã¯Elasticsearchã«ä»å±ããã³ãã³ãã©ã¤ã³ãã¼ã«ã§ç°¡åã«ã¤ã³ã¹ãã¼ã«ã§ããããã«ãªã£ã¦ãã¾ããã Elasticsearchã«ãããããã¦ã¦åãã«ãããä½æ¥ã¯è¦æ±ããã¾ããã
ããã§Solrã§å»æ¢ããããã¼ã¯ãã¤ã¶ã®ã½ã¼ã¹ã³ã¼ãã移æ¤ãã¦ãã©ã°ã¤ã³ã¨ãã¦åå®è£ ãããã¨ãæãã¤ãã¾ãã ãããã¿ã¤ãã®ä½æãéãã¦ããã©ã°ã¤ã³ã®ã¡ã³ããã³ã¹ãç¶ãã¦ãã³ã¹ãã¯è¨±å®¹ã§ããã¨èããããã«ãªãã¾ããã
ããã¦ãå¾æ¹äºææ§ã®ç ´å£ã«é¢ããè°è«ã§æéã溶ããããã¯ãã©ã°ã¤ã³ã¨ãã¦ç§»æ¤ããã»ãããã¼ã¿ã«ã³ã¹ãã¯å®ãä¸ããã¨ããçµè«ã«ãããã¾ããã
ãµã£ãã¤ã®ãã ãã3 ã¤ã³ããã¯ã¹ã®åä½æåé¡ããªãã¨ããã
ãã®ããã¸ã§ã¯ãã§ã®æè¡çé£æã¯ã¤ã³ããã¯ã¹ã®åä½æã§ãã éå»ã®ã¤ã³ãã©ãã¼ã ã®ãã¼ã«ã®åé¡ããµãããã£ã¦ãã«ãã»ã«åãä¸é©åãªçµæããããã¯ããæã¤ã¹ã責åãã¤ã³ãã©ãã¼ã ãéå°ã«èè² ã£ã¦ãã¾ã£ã¦ãããã¨è§£éãã¾ããã
ã¤ã³ãã©ãã¼ã ã®èè² ã£ã¦ããããã³ãã»ãããã¯ãå é¨ã®ç´°ããé²æç¶æ 管çã®è²¬åããããã¯ãã«ç§»ãã 詳細ã®å é¨å®è£ ããããã¯ãå ã«é è½ããã¢ããã¼ããåãã¾ããã 次ã®å³ã¯ãããã¯ããå é¨çã«é è½ãã¦ããç¶æ é·ç§»å³ã§ããã¤ã³ãã©ããã¯åãããã¯ããå ¬éããWeb APIãéã㦠åã¤ã³ãã¯ã·ã³ã°ã®éå§ã»åæ¢ãé²æã®ç¢ºèªãã§ãã¾ããããã®ç¶æ é·ç§»ãã¤ã³ãã©å´ã§ä¿æã»ç®¡çããå¿ è¦ããªããªãã¾ããã
çµæãã¤ã³ãã©ããã¯ã©ã®ããã³ãããã¤åã¤ã³ãã¯ã·ã³ã°ãããã ããå¶å¾¡ããã°ãããªãã¾ããã
åãããã¯ãã«ã¯ããã¼ã¿ãé 次èªã¿åãåã¤ã³ãã¯ã·ã³ã°ãããããå¦çããé²æç¶æ³ã®ç®¡çã å¢ãããã¨ã«ãªãã¾ããããããããã«ããããããã¯ãã®ãã¼ã¿ã®æã¡æ¹ã«åãããå¹çã®è¯ã åã¤ã³ãã¯ã·ã³ã°ãããããããªããªã©ããããã¯ããç¬èªã«åã¤ã³ãã¯ã·ã³ã°å¦çãå¤æ´ã»æ¹åãããããªãã¾ãã ã¾ããåãããã¯ãã¯ã¢ããªã±ã¼ã·ã§ã³ãµã¼ããåèµ·åãããã¨ãèæ ®ãã¦ãããå¦çã å®è£ ãããããå¿ ç¶çã«é²æç¶æ³ã¯ãã¼ã¿ãã¼ã¹ãµã¼ãã«ä¿åãããã¨ã«ãªãã¾ãããããæ´»ããã åã¤ã³ãã¯ã·ã³ã°ãä½ããã®åå ã§åæ¢ãã¦ããåå ã解æ¶å¾ã«åæ¢ããã¨ããããã®åéãå¯è½ã«ãªãã¾ããã
ãã®çµæãæ°ãæã«ããã¶åã¤ã³ãã¯ã·ã³ã°ãå¯è½ã«ãªãã¾ããã
ãµã£ãã¤ã®ãã ãã4 ã¹ãã©ã³ã°ã©ã¼ãã¿ã¼ã³
ã¹ãã©ã³ã°ã©ã¼ãã¿ã¼ã³ã¨ã¯ï¼
ã¹ãã©ã³ã°ã©ã¼ãã¿ã¼ã³ ã¯ã¬ã¬ã·ã¼ã«ãªã£ããµã¼ãã¹ãæ°ãããµã¼ãã¹ã«ç½®ãæããããã®ç§»è¡ãã¿ã¼ã³ã§ãã ã¬ã¬ã·ã¼ãªãµã¼ãã¹ã¨æ°ãµã¼ãã¹ãå¹³è¡éç¨ããªããã¬ã¬ã·ã¼ãªãµã¼ãã¹ã¸ã®ä¾åãå¾ã ã«æ¸ããã¦ããã¾ãã
ä¸å³ã¯ã¹ãã©ã³ã°ã©ã¼ãã¿ã¼ã³ã使ã£ã¦Solrã¸ã®ä¾åãæ¸ããã¦ããæ§åã示ãã¦ãã¾ãã
- Fig1. kintoneãElasticsearchåãæ¿ãå¾ã«Solrã¸ã®åãæ»ãã«åãã¦ã¤ã³ããã¯ã¹ãæ´æ°ãç¶ãã¦ãã¾ã
- Fig2. kintoneãElasticsearchã«ç§»è¡å®äºç¶æ
ã§ã
- ã¬ã«ã¼ã³ãElasticsearchåãæ¿ãå¾ã«Solrã¸ã®åãæ»ãã«åãã¦ã¤ã³ããã¯ã¹ãæ´æ°ãç¶ãã¦ãã¾ã
- Fig1ãFig2ã¨ãã«ã¡ã¼ã«ã¯ã¤ãºã¯Solrãå©ç¨ãç¶ãã¦ãã¾ã
ã«ããªã¢ãªãªã¼ã¹ã«è¿ãããã®ãããã¾ãããç¹å¾´ã®ä¸ã¤ã¨ãã¦å¹³è¡éç¨æéã¯æ°æ§ä¸¡æ¹ã®ãã¼ã¿ãæ´æ°ãç¶ãã¾ãã ãã°ãæ§è½åé¡ããã£ãå ´åã¯å¤ããµã¼ãã¹ã«åãæ»ãã¦ä¸æçã«åé¡ãåé¿ããªãã移è¡ãé²ãã¦ãããã¨ã«ãªãã¾ãã
ä»åã®ç§»è¡ããã¸ã§ã¯ãã§ã¯åã¤ã³ãã¯ã·ã³ã°ãè¡ãWeb APIã®å®è£ ãå®äºãããããã¯ãããåã¤ã³ãã¯ã·ã³ã°ãéå§ã åã¤ã³ãã¯ã·ã³ã°ãå®äºããããã³ã㯠Elasticsearchã«åãæ¿ãã¦ããã¾ããã Elasticsearchã®æ§è½ç¹æ§ãç解ã§ãã¦ããªããªã¹ã¯ãèæ ®ãã¦ããã¼ã¿éã®å°ãªãããã³ããã移è¡ãå®æ½ãã¦ããã¾ããã ä»æ§å·®ç°ãçºçããæ¤ç´¢å¦çã®åãæ¿ãã¯ãå®æã¡ã³ããã³ã¹ã«åããããã¨ã§äºåã®åç¥ä½æ¥ãªã©ã«ãé æ ®ãã¦ä½æ¥ãé²ãã¦ãã¾ãã
Elasticsearchã¸åãæ¿ãå¾ãä¸å ·åã«åãã¦Solrã¸ã®åãæ»ãããµãã¼ããã並è¡éç¨æéã2ãæéè¨ãã¾ããã ãããã¦ãå¾ã ã«éç¨ç°å¢ã§éå§ããå¾ã ã«å ¨ææ¤ç´¢ã®ããã¯ã¨ã³ããåãæ¿ãã¦Solrã¸ã®ä¾åãæ¸ããä½æ¥ãç¶ãã¦ããã¾ããã
ããã¦ã¤ãã«ç§»è¡å®äº
ããã¦ã2021å¹´6æã«ãã¹ã¦ã®Solrãµã¼ãã¼ã¸ã®åãæ¿ããµãã¼ãæéãçµäºãElasticsearch移è¡ãå®äºãã¾ããã
ã¡ãªã¿ã«ã2018å¹´æ«ã§Solrãµã¼ãã¼ã§1.8TBã®ã¤ã³ããã¯ã¹ããã£ãããã³ãã¯ãæçµçã«4TBã®ã¤ã³ããã¯ã¹ã¨ãªã£ã¦ãã¾ããã ãã®ããã³ãã¯Elasticsearchã¸ã®åã¤ã³ãã¯ã·ã³ã°ã«2ãæãã®æéãè¦ãã¾ããã
移è¡æ¯ãè¿ããã®1 æ§è½ã¯ã©ãã§ãããï¼
ã¬ã«ã¼ã³ã§ç¹ã«æ§è½å£åãé¡èã ã£ãããã³ãã§ã®æ¤ç´¢ã«ããã£ãæéã®ã°ã©ãã§ãã å è¿°ã®éãã¬ã«ã¼ã³ã¯å ¨æãã¼ã¿ã®æ§é ãæ¹åãã¦ãããããElasticsearchåãæ¿ãå¾ã¯æ¤ç´¢çµæãé«éåããã¦ãããã¨ããããã¾ãã
ã¤ã³ããã¯ã¹å®¹éã¯ã¬ã¬ã·ã¼ãªSolrã¨æ¯è¼ãã¦40%å§ç¸®ãããå¹æã¯æ¤è¨¼éãã®çµæãå¾ããã¾ããã
移è¡æ¯ãè¿ããã®2 ãã¼ã¯ãã¤ã¶ã©ãã§ãããï¼
æ¤ç´¢ã¨ã³ã¸ã³ãåãæ¿ãã£ã¦ãæ¤ç´¢ä»æ§ã¯ç¶æã§ãã¦ãããããä»æ§å¤æ´ã«æ°ä»ããããã¨ã¯ç¨ã§ããã ãç¨ãã¨ãã¦ããã®ã¯ãããã¯ãã«ãã£ã¦ã¯ç§»è¡ã®ã¿ã¤ãã³ã°ã§ç´°ããä»æ§å¤æ´ãèå¼±æ§æ¹ä¿®ãªã©ãè¡ã£ã¦ããããã§ãã å¾®å¦ã«ä»æ§å¤æ´ãçºçããã±ã¼ã¹ã«æ°ä»ãããåãåãããæ°ä»¶ããã¾ããã
ã³ãã¥ãã±ã¼ã·ã§ã³ã³ã¹ããã¡ã³ããã³ã¹ã³ã¹ãããªã¹ã¯é¢ã¸ã®é æ ®ãªã©ç·åããã¨ãã¤ãã¦ããã¨ããå¤æã§ãã
移è¡æ¯ãè¿ããã®3 ã¯ãã¼ã©ã¼APIã©ãã§ãããï¼
ãããã¯ãã»ã¤ã³ãã©ãã¼ã ã«æ°ããååæ¶ãèè² ããã¦ãã¾ãã®ã§ç½ªæªæã¯ããã¾ããã æ°ãæã«ããã¶åã¤ã³ãã¯ã·ã³ã°ãä¹ãè¶ãã¦Solrããä¹ãæãããã®ã§ã容赦ããã ããã...ã
移è¡æ¯ãè¿ããã®4 ã¹ãã©ã³ã°ã©ã¼ãã¿ã¼ã³ã©ãã§ãããï¼
ã¹ãã©ã³ã°ã©ã¼ãã¿ã¼ã³ãç¹ã«å½¹ã«ç«ã£ãä¾ã¨ãã¦ãElasticsearchå é¨ã®ãµã¼ããããã¬ã¤ã«ã¼ãçºåãã¦100%æ¤ç´¢ã失æããé害ãããã¾ããã é害çºçå¾ãåé¡ã®èµ·ããããã³ãã§ã¯Elasticsearchã§ã®éç¨ãçæçã«è«¦ãã¦Solrã¸ã®åãæ»ãAPIãå®è¡ãã¦ä¸æåãããã¦ãã¾ãã ãã®å¾ã調æ»ã»æ¹ä¿®ãè¡ãããµããã³Elasticsearchã¸ã®åãæ¿ãã¨å®å®ç¨¼åã«æåãã¦ãã¾ãã
ã¹ãã©ã³ã°ã©ã¼ãã¿ã¼ã³ã¯ãã°ãæ§è½åé¡ãè¦ã¤ãã£ãã¨ãã®å¯¾å¿ã¨ãã¦é常ã«å½¹ã«ç«ã¡ã¾ããã åé¡ãèµ·ãã¦ãçãè¬ãã¦ç²ã 対å¿ãç²ãå¼·ã移è¡ãæå¾ã¾ã§éè¡ã§ãã¾ããã
ç§ã®ç¥ãéãã§ã¯ç¤¾å ã§ã¯åæ¡ç¨ã®ãã¿ã¼ã³ã§ããããã®ãã¿ã¼ã³ã使ã£ãææ³ã¯ã ã¬ã¬ã·ã¼ã½ããã¦ã§ã¢ã¨æãåããã¤ããæ¹æ³ã¨ãã¦æç¨æ§ãé«ããå¼·åãªä¸æã¨ããææ³ã§ãã
ããã¦Necoã¸
ä»ã®ããã¸ã§ã¯ãã®ç¶æ³ã¨ãã¦ã¯å½ããããç·æ¥çãªã¨ã¹ã±ã¼ãããä¸æãã®ãã«æåãå°åº·ç¶æ ã«ããã¤ããç¶æ ã§ãã
ãã®æ§æã«é·æéã¨ã©ã¾ãç¶ããã®ã¯å±éºãªã®ã§ãå¼ãç¶ãæ¹åãã¦ããå¿ è¦ãããã¾ãã ç¾å¨ããµã¤ãã¦ãºã§ã¯Kubernetesã§æ§ç¯ãããæ°ã¤ã³ãã©ç°å¢ (Neco) ã¸ã®ç§»è¡ä½æ¥ãé²ãã¦ãã¾ããElasticsearchãNecoç°å¢ã¸ç§»è¡ããå¿ è¦ãããã®ã§ãä»ã¯ããã«åããã¦æé©ãªElasticsearchã®æ§æã«ããããã®æ¹åä½æ¥ã»ç§»è¡ã®æºåä¸ã§ãã
ä»åã®SolrããElasticsearchã¸ã®ç§»è¡ã§ã¯ã移è¡ã®èª¿æ»ã¨ç§»è¡è¨ç»ã®æ§æ³ãã»ã¼æåããå ¨ä½ã¨ãã¦é©ãã»ã©ãã¾ã移è¡ã§ãã¾ããã ããããªããã移è¡ã®ä¸ã§æ³å®å¤ã®ãã¨ãèæ ®ã足ããªãã£ãç¹ãããã¾ãããã®è¾ºãã®æ¹åç¹ã¯æ¬¡ã®Neco移è¡å®äºæã«ã話ã§ããã°ã¨æãã¾ãã
æå¾ã«
è²´éãªæéãå²ãã¦ããã¾ã§èªãã§ããã ããã¿ãªãã¾ã®æ°å転æã«ãããã§ããªãã°å¹¸ãã§ãã
Solræ代å«ãéçªã¨æ¦ãç¶ãã¦ããããã¹ã¦ã®äººã«æè¬ã®æã示ãã¾ããããã¦ãã®ããã¸ã§ã¯ãã«ç´æ¥çãéæ¥çã«ãããã£ãã¿ãªãã¾ã«æè¬ãã¾ãã
è¨äºå·çããã³ããã¸ã§ã¯ãæ§æ³ã¯@yokotaso ãæ å½ãã¾ããã ããã¸ã§ã¯ãã«ãããã£ã¦ãããã¡ã³ãã¼ã®ååãæå¾ã¾ã§èºèºããã¢ã¯ã»ã«ãè¸ã¿ç¶ããã¤ã³ãã©ãã¼ã 責任è ã®ç解ã ææ決å®ããã人ãã¡ã®ãªã¹ã¯ãå¤æããããã§ã®æ¿èªãªã©ãã©ãã²ã¨ã¤æ¬ ãã¦ããå ¨ææ¤ç´¢ããæä¾ã§ããªã£ã¦ããå¯è½æ§ãããã¾ãã
æå¾ã«æè¬ã®æã¨ãããã¸ã§ã¯ãã¡ã³ãã¼(èªåå«ã)ãå§åçæ給ãåã¡åããã¨ãé¡ãã¤ã¤ãã®ããã¸ã§ã¯ãã®å®äºå ±åã¨ãããã¨æãã¾ãã
ãã¤å£ãã¦ããããããªãç¶æ³ã§æå¾ã¾ã§åãç¶ãã¦ãããSolrã«ãããã¨ããããã¦ãããããªãã
åè
- ããã¸ã§ã¯ãæ§æ³æã«åèã«ããã¦ããã ãã: ãã¤ã¯ããµã¼ãã¹ã¢ã¼ããã¯ãã£
- ãã¤ã¯ããµã¼ãã¹ç§»è¡æ³ã«ã¤ãã¦ã¾ã¨ãããã¦ãã: ã¢ããªã¹ãããã¤ã¯ããµã¼ãã¹ã¸
- å½æã¯åºçããã¦ããªãã£ãããã¬ã¬ã·ã¼æè¡ã¨ã®å¯¾å³æ¹æ³ãããã¾ã¨ã¾ã£ã¦ãããä»ãªããã®æ¬ãå¼·ããå§ããã
- Elasticsearch 6ã§ã¤ã³ããã¯ã¹å®¹éãå§ç¸®ãããæè¡è¨äº: Space Saving Improvements in Elasticsearch 6.0
ä¿®æ£å±¥æ´
- 2021/6/21 ãããã«ããã»èª¤è§£ãæããã表ç¾ãä¿®æ£