nanapi Ver5ããªãªã¼ã¹ããã¨ãã«ä½¿ã£ã社å ãªãªã¼ã¹ã®ä»çµã¿
ä¹
ã
ã®ã¨ã³ããªã¼ã§ããå
æ¥ã3å¨å¹´ã¨ãããã¨ã§nanapiããªãã¥ã¼ã¢ã«ãã¾ããï¼ä»åã¯ãã¡ãã£ã¢ãããã©ãããã©ã¼ã ã¸ããã³ã³ã»ããã¨ãã大å¹
ãªãªãã¥ã¼ã¢ã«ãå®æ½ãã¦ãã¾ãã
ãªãã¥ã¼ã¢ã«ã®ã³ã³ã»ããã¨ãã¯ã詳ããã¯ãã¡ãã«æ¸ãã¦ããã¾ãã
nanapiがVer5.0にバージョンアップしました : けんすう日記
社å ãªãªã¼ã¹ã®éè¦ã
UIããã¶ã¤ã³ãç´°ããæ©è½ãªã©å¶ä½å´ã¨ãã¦ã¯ãããä½ãè¾¼ãã§ããããã§ãããæ°é±é1ã¤ã®ããã¸ã§ã¯ãã«ã³ããããã¦ããã¨ãªããªã客観çã«è¦ããã¨ãã§ããªããªã£ã¦ãã¾ãã
ãããªæã¯å®¢è¦³çãªæè¦ããããããªããã®ã§ããããã®æè¦ã®ãããæ¹ããªããªãé£ããã
å¼ç¤¾ããµã¼ãã¹ãç«ã¡ä¸ãã¦ãã3å¹´ãçµéãã¦ããããã§ãå¾æ¥å¡æ°ããããªãã®äººæ°ã«ãªã£ã¦ãã¦ãã¾ããã¨ãªãã¨ãéçºç°å¢ãã¹ãã¼ã¸ã³ã°ç°å¢ãè¦ã¦ãããã«ãã¦ããé¢åãªæé ãã¡ãã£ã¨ã§ãããã¨ãªããªãé£ããã£ãããããã®ã§ãã
ããã§ãäºåã«ãµã¼ãã¹ãè¦ã¦ããããã¨ã§ç´°ãããã°ãæ½°ããã¨ãã§ããããæè¦ãåãå
¥ãããã¨ãã§ããã®ã§ãããéè¦ãªã¹ãããã§ãã
ãã®åé¡ã解決ããããã«ãä»åã®ãªãªã¼ã¹ã§ã¯ã¡ãã£ã¨ããä»çµã¿ãããã¦ã¿ã¾ããã
ãµã¼ãæ§æ
nanapiã§ã¯ä¸æ®µã«Loadbalancerãããã¦ãwebãµã¼ãã¸ãã©ã³ã·ã³ã°ãã¦ããã¨ããããä¸è¬çãªè² è·åæ£ã®ææ³ãã¨ã£ã¦ãã¾ãã
Loadbalancerã«ã¯ãapacheã®mod_proxy_balancerãå©ç¨ãã¦ãã¾ãã
ãã®éã®apacheã®è¨å®ãã¡ã¤ã«ã¯ä»¥ä¸ã®ããã«ãªãã¾ãã
<VirtualHost *:80> ServerName nanapi.jp ProxyRequests Off ProxyPass / balancer://balancer/ timeout=10 <Proxy balancer://balancer> BalancerMember http://serverA BalancerMember http://serverB BalancerMember http://serverC </Proxy> </VirtualHost>
社å ãªãªã¼ã¹ãµã¼ãã®æºå
ããã¦è¤æ°ããWEBãµã¼ãã®ãã¡ã1å°ã ããªãªã¼ã¹å¾ã®ã½ã¼ã¹ã³ã¼ããcommitãã¦ããbranchã«åãæ¿ãã¾ãã
ãã®éãServer Cã¯ãµã¼ãã¹ã¢ã¦ãããã¦ããã¾ããè¨å®ãã¡ã¤ã«ã§ã¯ãBalancer Memberããå¤ãã¦ããã ãã§OKã§ãã
<VirtualHost *:80> ServerName nanapi.jp ProxyRequests Off ProxyPass / balancer://balancer/ timeout=10 <Proxy balancer://balancer> BalancerMember http://serverA BalancerMember http://serverB # BalancerMember http://serverC </Proxy> </VirtualHost>
社å ãªãªã¼ã¹ãå®ç¾ãã
ãã¨ã¯ãã®ãµã¼ãã¹ã¢ã¦ããããµã¼ãã«ç¤¾å
ããã¢ã¯ã»ã¹ã§ããããã«ããã°ããããã§ããããããªãã/etc/hostsæ¸ãæããã¨ãProxyéãã¦ã¯é¢åãªæé ã§ããä½ãèããã«åãæ¿ãã£ã¦ããã¹ãã§ãã
IPã¢ãã¬ã¹ã§å¤å®ããããã«ããã°ã以ä¸ã®æ¹æ³ã§serverCã¸ã®ã¢ã¯ã»ã¹ãããããã¨ãã§ãã¾ãã
<VirtualHost *:80> ServerName nanapi.jp ProxyRequests Off RewriteEngine On RewriteCond %{REMOTE_HOST} <OFFICE_IP_ADDR> RewriteRule (.*) http://serverC$1 [P,L] ProxyPassReverse / http://serverC/ ProxyPass / balancer://balancer/ timeout=10 <Proxy balancer://balancer> BalancerMember http://serverA BalancerMember http://serverB # BalancerMember http://serverC </Proxy> </VirtualHost>
ãã£ã¦ãããã¨ã¯ã·ã³ãã«ã§ãRewriteã§IPã¢ãã¬ã¹ãå¤å®ããserverCã¸Proxyãã¦ãã¾ããããã ãã§ã«ã³ã¿ã³ã«å®ç¾ãããã¨ãã§ãã¾ãã
ç¾è¡ï¼ãªãã¥ã¼ã¢ã«åï¼ãè¦ããããã«ãããã¨ã
ã¨ã¯ããããªãã¥ã¼ã¢ã«å¾ãããããªãã¿ããã¨ãã§ããªãã®ãä¸ä¾¿ã§ããã¨ããããã§åãæ¿ãããããããªä»çµã¿ãããã¦ã¿ã¾ããã
cookieã§å¤å®ãã¦ãããã°ããã®ã§ããç°¡åã«ã§ãã¾ããapacheã¯ä»¥ä¸ã®ããã«è¨å®ããã¾ããã
<VirtualHost *:80> ServerName nanapi.jp ProxyRequests Off RewriteEngine On RewriteCond %{REMOTE_HOST} <OFFICE_IP_ADDR> RewriteCond %{HTTP_COOKIE} !viewmode=old RewriteRule (.*) http://serverC$1 [P,L] ProxyPassReverse / http://serverC/ ProxyPass / balancer://balancer/ timeout=10 <Proxy balancer://balancer> BalancerMember http://serverA BalancerMember http://serverB # BalancerMember http://serverC </Proxy> </VirtualHost>
ãã®ä¸ã§ãcookieããããã¦ãããç°¡åãªã¹ã¯ãªãããç¨æããã°ããã ãã§ãã
<?php if (isset($_GET['viewmode'])) { setcookie('viewmode', $_GET['viewmode'], time() + 60*60*24*30, '/'); }
ãããªã®ãåããã¡ã¤ã³ã®ãµã¼ãã«ããã¦ãviewmodeã¨ããååã§cookieãé£ããã¦ãããã°ããã ãã§ãã
ãããç¨æãã¦ããã ãã§ãç¾è¡ã®ã½ã¼ã¹ã³ã¼ããããã¦ãããµã¼ãã¨ããªãã¥ã¼ã¢ã«å¾ã®ã½ã¼ã¹ã³ã¼ããããã¦ãããµã¼ããç°¡åã«è¡ãæ¥ãããã¨ãã§ãã¾ãã
社å ãªãªã¼ã¹ç¨ã®ããã¥ã¡ã³ããç¨æãã
ä¸è¨ã®æºåãããä¸ã§ããªãªã¼ã¹å¾ã®æè¦ãåéããããã®ãã©ã¼ã ãç¨æãã¾ãããæå¾ã¯ãã¹ã¦BTS(å¼ç¤¾ã§ã¯backlogãå©ç¨ãã¦ãã¾ã)ã«éç´ããããã§ãããBTSã«å
¥ããã®ãé¢åã¨ããã ãã§å°ããæè¦ãæ¾ããªãã®ã¯å¿ä½ç¡ããã®ã§ãã
ãã®ããã«ãä»åã¯ãã©ã¼ã ãç¨æãã¦ç°¡åã«æè¦ãéãããã¨ãã§ããããã«ãã¾ããã
ãªããä»åã¤ãã£ã¦ãããã©ã¼ã ã¯nanapiã§ç¬èªéçºããã¢ã³ã±ã¼ããã©ãããã©ã¼ã ã·ã¹ãã ãæ´»ç¨ãã¦ãã¾ãã
æå¾ã«
ããã ãæºåããã¦ã1é±éã¡ãã£ã¨ç¤¾å ããæè¦ãããã£ãããã§ããåºã¦ããåºã¦ããã»ã»ã»ç¤¾å¡ã ãã§ãªãã¢ã«ãã¤ãã®ã¹ã¿ãããããæ°è»½ã«æè¦ãããããã®ã§ãªãªã¼ã¹ã¾ãã®èª¿æ´ãããã§ããã¨æã£ã¦ãã¾ãã
å¤§å¹ ãªDBã®ã¹ãã¼ãå¤æ´ãä¼´ãã¨ãã«ã¯ä½¿ãã¥ããæã§ããããã¶ã¤ã³ãUIå¤æ´ã®å ´åã¯æå¹ãªæ段ã ã¨æãã¾ãã®ã§ãä¼¼ããããªæ§æã§ãµã¼ãã¹ãçµãã§ãã人ã¯ãã²ãã©ã¤ãã¦ã¿ã¦ãã ããã
â»è¨å®ãã¡ã¤ã«ã¯Blogã§è¨è¿°ããããã«ããªãç°¡ç´ åãã¦ãããããæ¬çªéç¨ãã¦ããè¨å®ãã¡ã¤ã«ã¨ã¯ç°ãªãã¾ãã
ã¹ã¿ããåéä¸ï¼
nanapiã§ã¯ã¨ã³ã¸ãã¢ã大åéãã¦ãã¾ãï¼
nanapiではエンジニアを募集中!採用ページはこちらから