2018å¹´12æç¾å¨ã«ããã Redash ã®ã¯ãããã
ãã®è¨äºã¯ Redash Advent Calendar 2018 1æ¥ç®ã®è¨äºã§ãã
Redash Meetup ã主å¬ãã¦ãããªãã§ãåå è ã¢ã³ã±ã¼ããåã£ã¦ããã®ã§ããããããã Redash ã®å°å ¥ãæ¤è¨ãã¦ãããã¨ãããããæ¯å2-3å²ç¨åº¦ããã£ãããã®ã§ãä»æ¥ç¾å¨ Redash ãã¯ãããã«ã¯ã©ã®ãããªã¹ããããè¸ãã¨ããã®ããã¨ããã®ãã主ã«ç°å¢æ§ç¯ã®è¦ç¹ã§ã¾ã¨ãã¦ã¿ã¾ãã
ã¾ãã¯æ軽ãªãã¢ãµã¤ãã«è§¦ãã¦ã¿ã
Redash ã«ã¯å ¬å¼ã«æä¾ããã¦ãããã¢ãµã¤ããããã¾ãã
å©ç¨ã§ãããã¼ã¿ã¯ BigQuery ã® Public datasets ãªã©ãããã®ã§ããã¼ã¿ãæºåããå¿ è¦ããªã試ãã¦ã¿ããã¨ãã§ããã®ã§ãæ°è»½ã« Redash ã®æ©è½ã確èªããããæ触ãã確ãããããããã¨ãã§ãã¾ãã
注æç¹ã¨ãã¦ã¯ããã¢ãµã¤ãã¨ãã¦å ¬éããã¦ãããããèªåãæ¸ãã SQL ãä»è ã«ãè¦ãã¦ãã¾ãã¾ãããã¯ã¨ãªã®ä½æè ã®ååã Google èªè¨¼ããåå¾ããããã®ã«ãªãã¨ãããã¨ãããã¾ãããããã«ã¤ãã¦äºæ¿ã§ããªãå ´åã¯ããã°ã¤ã³ãã¦ä»è ã®ã¯ã¨ãªãçºãã¦ã¿ãã ãã«ãã¦ããã®ãè¯ãããããã¾ããã
Redash ã®ãã³ãºãªã³è³æã«è§¦ãã¦ã¿ã
ãã¢ãµã¤ãã§ããç¨åº¦é°å²æ°ãæ´ãã ããRedash Meetup ã®ãã³ãºãªã³ã¤ãã³ãã§ãæ´»ç¨ããè³æã«æ²¿ã£ã¦ãRedash ã®æ©è½ãå¹ åºãä½é¨ãã¦ã¿ããã¨ããããããã¾ãã
ç°å¢æ§ç¯ãããããã« Git 㨠Docker ãå¿ è¦ã«ãªããããã¨ã³ã¸ãã¢ã§ãªãã¨ã¤ã¾ã¥ããã¨ãããããããã¾ããããGit ã Docker ãå¤ãã®æ¹ãå°å ¥æé ã®ããã°ãªã©ãæ¸ããã¦ããã®ã§ããããã®è¨äºãåèã«æºåãããã¨ã¯ãããã»ã©é£ãããªãã¨æãã¾ãã
ãã¢ãµã¤ãã¨éãèªåã ãã®ç°å¢ãªã®ã§ãã¯ã¨ãªãã°ã©ãã®è¿½å ã¯ãã¡ãããã¦ã¼ã¶ã¼ã追å ãªã©ã®ç®¡çæ©è½ã試ããã¨ãã§ããã®ã§ãå°å ¥åã«ã¦ã¼ã¶ã¼ã権éã®ç®¡çã¯ã©ããªã£ã¦ããã®ããã©ã®ãããªãã¼ã¿ã½ã¼ã¹ã«å¯¾å¿ãã¦ããã®ããªã©ã試ããµã³ãããã¯ã¹ç°å¢ã¨ãã¦ãå©ç¨ãããããªã£ã¦ãã¾ãã
Redash ã®ãªãã¸ããªã«ãã docker-compose.yml
ã使ããã«ãã®ãã³ãºãªã³è³æãããããããçç±ã¨ãã¦ã¯ãå©ç¨æ¹æ³ãåºç¯ãã¤å¹³æã«èª¬æããã¦ããã¨ããã®ã大ããã§ããããµã³ãã«ãã¼ã¿ã¨ã㦠MySQL ã® world ãã¼ã¿ãã¼ã¹ãããã«å©ç¨ã§ããç¶æ
ã«ãªã£ã¦ãããããRedash ã試ãããã«ãã¼ã¿ãæºåããã¨ããã¹ããããè¸ã¾ãªãã¦ããã¨ããã®ãã大ããªã¡ãªããã®ã²ã¨ã¤ã ã¨èãã¦ãã¾ãã
ã¾ããå©ç¨ããã¦ãã Redash ããã¼ã¸ã§ã³ã¢ããããã¦ãããããæ¬è¨äºã®å¯¾è±¡è ã¨ã¯å°ãç°ãªãã¾ãããå¤ããã¼ã¸ã§ã³ãã移è¡ãããä½ãå¤ããã®ãï¼ã¨ããã®ãæ¤è¨¼ããç°å¢ã¨ãã¦ããªããªã便å©ã«å©ç¨ã§ãã¾ãã
å°å ¥ã«ã¤ãã¦èãã
ãã¢ããã³ãºãªã³è³æã«è§¦ãã Redash ã®å°å ¥ã«ãªãããã®ã¡ãªãããããã¨æãããã¨ãããã°ãããã«ãã¦å°å ¥ãããã¨ãããã¨ãèãããã¨ã«ãªãã§ãããã
ã»ããã¢ããã®æé ã¯å ¬å¼ããã¥ã¡ã³ãã«è¨è¼ãããã®ã§å²æãã¾ãããå°å ¥ã®è¦ç¹ã«ã¤ãã¦è»½ãç´¹ä»ãã¾ãã
Redash å°å ¥ã®åã«ããã¼ã¿åºç¤ãæ´ãã
Redash ãå°å ¥ããæç¹ã§ãä½ããã¼ã¿ã½ã¼ã¹ã«ãããã¨ãããã¨ã«ã¯ããç¨åº¦æ³å®ãã¦ãããã®ãããã¨æãã¾ãããRedash ã¯èª°ã§ãç°¡åã«å©ç¨ãããã¨ãã§ããã¨ããå©ç¹ã®è£è¿ãã§ã誰ã§ãæå³ããéãã¯ã¨ãªãå®è¡ã§ãã¦ãã¾ããã¨ããããã¨ãããã¨ãç解ãã¦ããã¾ãããã
å ·ä½çã«ã¯ Redash ãæ´»ç¨ããå ´åããªã¼ãã¬ããªã«ã®ä½æããBigQuery ãªã©ã®ãã¼ã¿ã¦ã§ã¢ãã¦ã¹ã«å¯¾è±¡ã®ãã¼ã¿ãå ¥ãã¦ãããªã©ã®æºåãå¤ãã®å ´åã§å¿ è¦ã«ãªãã¾ãã
ãããRedash å°å ¥æç¹ã§ãããã£ãç°å¢ãç¨æã§ãã¦ããªãã®ã§ããã°ãç«ã¡æ¢ã¾ã£ã¦ Redash å°å ¥ã®åã«ãã¼ã¿åºç¤ãæ´ãããã¨ãå¼·ããããããã¾ãã
Docker ä¸ã§éç¨ãããã¨ãåæã«æºå
Redash ã¯2018å¹´12æ1æ¥ç¾å¨ãDocker ã§ä¾åããããã«ã¦ã§ã¢ã Python ã¢ã¸ã¥ã¼ã«ãªã©ãå°å
¥ã»ç®¡çããæ¹å¼ãæ¨å¥¨ããã¦ãããå
¬å¼ã«æä¾ããã¦ãã AMI ã Docker ã使ç¨ãããã®ã«ãªã£ã¦ãã¾ãããã®ãããDocker ã«ã¤ãã¦ã®åºæ¬çãªç¥èã docker
ãdocker-compose
ã³ãã³ãã®ä½¿ããããç¥ã£ã¦ããå¿
è¦ãããã¾ãã
Redash ã¯ç´°ããè¨å®ãéç¨ãããªãã¨ãå®å®ãã¦åä½ãã¾ãããã¯ã¼ã«ã¼ãè©°ã¾ã£ãå ´åãªã©åèµ·åãããã¨ãéç¨ã¨ãã¦ã¯ããããã®ã§ãAMI ãªã©ã§ãæ軽ã«å°å
¥ãããã®ã® docker-compose
ã³ãã³ãã¯ä½¿ã£ããã¨ããªãåèµ·åã®ããããããããªãã¨ãããããªç¶æ
ã¯é¿ããããã«ãã¾ãããã
ã¡ã¢ãªã¯æä½ 2GBãIO æ§è½ã¯ Redash éç¨ä¸éè¦
ãã·ã³ã®ã¹ããã¯ã«ã¤ãã¦ãå°ã触ãã¦ããã¾ãã
Redash ã¯å©ç¨è¦ä»¶ã«ãããã¾ãããã¡ã¢ãªã¯ 2GB ã»ã©ç¢ºä¿ã§ããã°å®å®ãã¦å©ç¨ãããã¨ãã§ãã¾ããAWS EC2 ã§è¨ãã° t2.small ãæä½è¦ä»¶ã«ãªãã¨èããã¨ããã§ãããããã¡ãã 2GB ããå¤ãå²ãå½ã¦ãããã®ã§ããã°ãããã«è¶ãããã¨ã¯ããã¾ããã
ã¹ãã¬ã¼ã¸ã«ã¤ãã¦ã¯å°ãæ°ã«ããå¿ è¦ãããã¾ããRedash ã¯ã¯ã¨ãªã®å®è¡çµæããã£ãã·ã¥ã¨ã㦠PostgreSQL ã®ãã¼ãã«ã«æ¸ãè¾¼ã¿ã¾ãã大éã®ãã¼ã¿ã Redash ã§æ±ãããå ´åã¯ãã£ãã·ã¥èªã¿æ¸ã㧠IO ãå¤ãçºçãããããSSD ãªã© IO æ§è½ã®ããã¹ãã¬ã¼ã¸ãå©ç¨ãããã¨ãããããã§ãã
ç¹ã« EC2 ã§å©ç¨ããå ´å EBS ã® gp2 ã¹ãã¬ã¼ã¸ãå©ç¨ããæ©ä¼ãå¤ãã¨æãã¾ãããå ã®ããã«å¤§éã®ãã¼ã¿ãæ±ãããå ´åã«ã¯ããã¼ã¹ãã¯ã¬ã¸ãããæ¶è²»ããã£ã¦ãã¾ãå ´åãããããããµã¤ã¸ã³ã°ã«ã¯æ³¨æãå¿ è¦ã§ãã
ç°å¢å¤æ°ãç¥ã£ã¦ãã
Redash ã¯ç°å¢å¤æ°ã§æ§ã ãªè¨å®ãå¤æ´ãããã¨ãã§ãã¾ãã
ç°å¢å¤æ°ã®ãªã¹ãã¯å ¬å¼ããã¥ã¡ã³ãã ã以ä¸ã®è¨äºãåèã«ãªãã¾ãã
éç¨å½åããç´°ããªãã¥ã¼ãã³ã°ãããå¿
è¦ã¯ããã¾ããããREDASH_DISABLED_QUERY_RUNNERS
ã§ä¸è¦ãªã¯ã¨ãªã©ã³ãã¼ãç¡å¹åãããã¨ã§ã¡ã¢ãªæ¶è²»ãæ¸ãããããQUERY_RESULTS_CLEANUP_MAX_AGE
ãé©åã«è¨å®ããè¥å¤§åãããã£ãã·ã¥ãããã©ã«ãããçãã¹ãã³ã§åé¤ã§ãããã¨ã¯è¦ãã¦ããã¨ããã§ãããã
ã¯ã¨ãªãè©°ã¾ã£ãæã®ãã§ãã¯ãã¤ã³ããç¥ã£ã¦ãã
Redash éç¨ã«ã¤ãã¦ãããèãå°ããã¨ã®ã²ã¨ã¤ã«ãã¯ã¨ãªã®å®è¡ãè©°ã¾ããã¨ããåé¡ãããã¾ãã
åå ã«ã¤ãã¦ã¯ç¶æ³ãæ§æã«ããã®ã§ä¸æ¦ã«ã¯è¨ãã¾ããããæåå³åãªãã以ä¸ã®ã¹ã©ã¤ãã®16ãã¼ã¸ãè¦ã¦ããã ãã¨ãè©°ã¾ã£ãæã«ã©ãã調æ»ããã¨è¯ãã®ãã¨ããã®ãã¤ã¡ã¼ã¸ãããããªãã¨æãã¾ãã
éç¨ã«å°ã£ãã
Redash ã®éç¨ã§ããå°ããã¨ããã£ãããRedash ã®ãã©ã¼ã©ã ãå©ç¨ãã¦ã¿ã¦ãã ããã
ã¾ã ã¾ã ãããã¯ã¯å°ãªãã§ãããæ¥æ¬èªã§ããåãã§ãã¾ãããéç¨ç¥è¦ã®ãããããã³ã¡ã³ããã¦ãã ãããã¨ãå¤ãã®ã§ãå°ã£ãæã«é ¼ã£ã¦ããã ããã¨ããããã§ãã
ã¾ã¨ã
Redash ã¯ãªã¼ãã³ã½ã¼ã¹ã§ãããããIaaS ãã³ãã¼ã«ãä¾åããå©ç¨è ããããã«ãã£ãç°å¢ã§å©ç¨ãããã¨ãã§ãã¾ãã
ãããã Redash ã®å°å ¥ãæ¤è¨ããããååã¯èãããã¨ããããã触ã£ããã¨ããªãã¨ããããã«ã¨ã£ã¦ããã®è¨äºãã¡ãã£ã¨ãããã£ããã«ãªã£ã¦ããããå¬ããã§ãã
Redash Advent Calendar 2018 2æ¥ç®ã¯ Redash ã®ã¡ã³ããã¼ã¨ãã¦ãä¸é¨ã¦ã¼ã¶ã¼ã«ããªãã¿ã® kyoshida ããã«ããè¨äºã§ããã楽ãã¿ã«ï¼