çµæ§ãããã¾ããããã
ãã£ãããªã®ã§ãåãåãã®æµãã追ã£ã¦è§£èª¬ãã¾ã·ã
Apache2.2.10ã¨Tomcat6.10.16ãRedHatã§ã®ã話
mod_proxy_ajpã¢ã¸ã¥ã¼ã«ã¯ãã³ã³ãã¤ã«æã«çµã¿è¾¼ãã§ããã
ã¾ãããããªæãã®ã¨ã©ã¼ãã§ãã
[æ¥ä»] [error] (70007)The timeout specified has
expired: ajp_ilink_receive() can't receive header
[æ¥ä»] [error] ajp_read_header: ajp_ilink_receive failed
[æ¥ä»] [error] (120006)APR does not understand
this error code: proxy: read response failed from ï¼localhostï¼
ã¨ãããããApacheã¨Tomcatéã®é£æºã«ä½¿ç¨ãã¦ããã
mod_proxy_ajpãæªãããããªããããã¨ããã¨ãããã
æ
å ±åéãå§ãã¦ã¿ãã
ãï¼ï¼webã§åæ§ã®äºè±¡ãæç´¢ã
ãï¼ï¼è²ã ãã°ãè¦ã¦ã¿ãã
ãï¼ï¼äºè±¡ãåç¾ãã¦ã¿ããï¼ãã®æã®ãã°ãè¦ãã
ã¨ãããããããå¹³è¡ãã¦ã¢ããã¼ãã
ã¨ããããï¼ããã
ãµããµãã
ã©ãããmod_proxy_ajpã¯tooBuggyãããã
åå ã¯ã¨ããããæ ¹æ¬å¯¾å¿ã®æ¹æ³ã¨ãã¦ã¯ï¼ã¤ã ã
ï¼ã¤ç®ã¯ã調æ»æ¥ã®æ°æ¥åã«ãªãªã¼ã¹ãããApache2.2.11ãå°å
¥ããæ¹æ³ã
ï¼ã¤ç®ã¯ãæãã使ããã¦ãã¦å®å®ãã¦ãããã
mod_proxyã®ç»å ´ã«ããéæ¨å¥¨ã¨ãªã£ããmod_jkã«ä¹ãæããæ¹æ³
ãããã£ã½ããã¨ãåãã£ãã
ãªãã»ã©ããææªããã«ãããã
ãã®å ´åã¯ããã°ã§ãããã¨ã証æããå¿
è¦ããããªãã»ã»ã»
ã¨ãããã¨ã¯é ã«ããã¦ããã
ãã®ä»ãå®ç¸¾ã®ãããããããã©ã¡ã¼ã¿ãããããæ¹æ³ãããã¤ããã£ãã®ã§
ããã試ãã¦ã¿ããã¨ã«ãããã
次ã«ï¼ãã°ã
éå§æç¹ã§æ å ±æºã¨ãªããã°ã¯ä»¥ä¸ã
ãApache
ããã»error.log
ããã»access.log
ãTomcat
ããã»ã¢ããªã®ãã°
ããã»catalina.out
ãã»error.log
ããåé ã«è¨è¼ããajpã«é¢ããã¨ã©ã¼ãåºåããã¦ããã
ãã
ãã»access.log
ãã503 Service Unableã¨ã©ã¼ãã¯ã©ã¤ã¢ã³ãã«è¿ãããåºåãããã
ããerror.logã¨åæå»ã®åºåã ã
ãã»ã¢ããªã®ãã°
ããerror.logãaccess.logã¨åæå»ã«ã
ããã¢ããªã®å¦çãè¡ããã¦ãããã¨ãåããã
ããApacheã¸ã®ã¢ã¯ã»ã¹ã¯ãTomcatã¾ã§mod_proxy_ajpãéãã¦
ããä¼éãã¦ãããTomcatã¯ãããæ£å¸¸ã«å¦çãã¦ããããã«è¦ããã
ããããã¦ããä¸ã¤ã»ã»ã»
ããé常å¦çã®ã¡ããã©15åå¾ã«ãSQL_Exceptionã大éã®åºåããã¦ããã
ããã¹ã¿ãã¯ãã¬ã¼ã¹ãè¦ãã«ãã¢ããªã®å¦çãããªã¬ã¼ã¨ããããã
ãããã¬ã¼ã ã¯ã¼ã¯å´ã§ã®å¦çã«ãããã®ã«è¦ãããã»ã»ã»
ãããªãã ããï¼ï¼
ãã»catalina.out
ããã¢ããªã®ãã°åæ§ãTomcatã¯æ£å¸¸ã«å¦çãã¦ããããã«è¦ããã
ãããã¡ãã«ãããä¸ã¤ã»ã»ã»
ããé常å¦çã®15åå¾ã«ã以ä¸ã®ã¨ã©ã¼ãçºçãã¦ããã
ããæ¥åä¸å
¨é¨ã¯è¦ãããªããã©ããããªæãã
ãæ¥ä» [TP-Processor??] WARN
ãorg.apache.jk.core.MsgContext - Error sending end packet
ãjava.net.SocketException: Broken pipe
ããããã¡ãã£ã¨調査ãã¦ã¿ãã¨ãããã¯éä¿¡çµè·¯ï¼pipeï¼ãåæãããï¼Brokenï¼
ããã¨ãããã¨ãããã
ãã
ããçµè·¯ï¼ã©ãã®ï¼ãApacheâTomcatï¼
ããã§ãããã¯ãã¢ããªãã°ãcatalina.outããè¦ãã«ãã©ããéä¿¡ã§ãã¦ãããããã»ã»ã»
ããã¨ããã¨ãTomcatâApacheã®æ»ãå´ãåæãã¦ãã®ããªãã»ã»ã»
ããã¦ï¼ãå¹³è¡ãã¦è¡ãã
ã¨ãããããï¼ãè¡ãæºåãããªããåéã§ï¼ï¼ï¼ãå¦çã
ã¨ããç¶æ
ãæ£ç¢ºãªã¨ããã
åç¾ã®ããã«ãã¾ãç¶æ³ã®æ´çãè¡ãã
ã3-1.è² è·ã«ãããçºçããã
ã3-2.åèµ·åæã®åã¢ã¯ã»ã¹ã§ã¯çºçããªãï¼ããã®ãè¦ããã¨ã¯ãªãï¼ã
ã3-3.30åãããæ¾ç½®ããã¨çºçããã
ã3-4.å®æçã«ã¢ã¯ã»ã¹ããã¨ãçºçããªãã
ã3-5.ã¨ã©ã¼ã¯503ãerror.logã®å 容ãåºå®ã
ã±ã£ã¨è¦ã3-3ã¨3-4ãã¯ãµã¤Î¾ããã
ããã辺ãèã«ãªãããã ã
ç´æçã«ã¯ã
ãmod_proxy_ajpã«é¢é£ããè¨å®ã®ä¸ã«ãããã©ã«ãã§
ã1800ç§ã§ã¿ã¤ã ã¢ã¦ãããä½ããããã®ã§ã¯ãªããï¼
ã¨ããæãã§ããã
ã§ã¯ã§ã¯ãç°å¢ãæ´ãã¦åç¾ãã¦ã¿ã¾ãã
ã»ã»ã»
ç°¡åã«åç¾ãã¾ããããã
ä½ãã¨ä½ãã®ã¿ã¤ãã³ã°ãåãã¨ãã¨ããå¯è½æ§ãèããªããã¯ã
ï¼ã®æ¤è¨¼çµæãããã¦ã®æ¨æ¸¬ããã
Tomcatããã®æ»ãã®éä¿¡ã確èªãããï¼éä¿¡ã確èªããããã§ã¯ãªããã©ããã
ãã®ããã«ãTomcatã§ã®ã¢ã¯ã»ã¹ãã°åºåãè¨å®ããã
ãâè¨å®ã¯å²æ
Tomcatã®acccess.logã確èªãã¦ã¿ãã
ã»ã»ã»
ä½ãåºåããã¦ãªãï¼
ã¨ãããã¨ã¯ãã©ãããå¦çãããå
容ã¯
TomcatããApacheã¸è¿ããã¦ããªãããã ã
ãããã
Tomcatãçµæãæ»ãã¦ããªããã
æ»ããªãçç±ãããã£ã¦ãã¨ããªããã¨ããèãã«ã
netstatã§ãã¼ãã確èªããã
APå´ãDBå´ã¨ãã«ããESTABLISHEDãã¨ãã¦ç¢ºç«ããã¦ããããã ã
ä»ã«æãå½ãããªãã®ã§ã
ã¨ããããå®ç¸¾ã®ãã£ãè¨å®å¤å¤æ´ãè¡ã£ã¦ã¿ãã
Apacheã®ãMaxClientsãã¨Tomcatå´ã®ãMaxThreadsããã¨ã¦ã大ããªå¤ã«å¤ãã¦ã¿ãã
両æ¹ã¨ããã¨ãããã足ããªããã¨ã¯ç¡ãã ããã
ï¼ï¼ï¼ï¼ã¨ãã«ãã¦ã¿ã¾ããã
çµæãæå³ãªãã
ã¨ããã®ãã¾ãã
ã3-1.è² è·ã«ãããçºçããã
ã¨ããæç¹ã§æå³ãªãã®ã¯ããããã§ãããã®ãä¸å¿ã
ãã¼ãã¨ããããä¼æ©ãλ...
ããã§ããããã¨ã«æ°ã¥ããã
è²ã
è¨å®ããªã«ããå¤æ´ãã¦ãApacheãTomcatã«åèµ·åãããã¦ããã
ãã®åèµ·åã¾ã§ã®æä½ã15åãè¶
ããªãã¨ããpipeBrokenã®ã¨ã©ã¼ã¯çºçããªãã
åèµ·åããã¦ããã ãããããããã ããã£ã¦æããããããªãã
ããããåèµ·åå¾ãç¾å¨èª¿æ»ä¸ã®ã¨ã©ã¼æä½ãè¡ããªãå ´åã
æ¾ç½®ãã¦ãã°pipeBrokenãçºçããã®ãï¼ã¨ããã¨ã
ããªãã
ã¨ãããã¨ã¯ã
ã¨ã©ã¼ã®èµ·ããæä½ãã
pipeBrokençºçã®åå ã«ãªã£ã¦ãããã¨ã¯ééããªãã
ããä¸åº¦è¦ç´ãã¦ã¿ããã
ãã¨ã©ã¼æä½ãã15åå¾ã«ä»¥ä¸ãçºçã
ãã»å¤§éã®SQLException
ãã»pipeBrokenï¼éä¿¡çµè·¯ã®åæï¼
æ³åããã«ã
Tomcatã®catalina.outã«åºåããã¦ããæ£å¸¸å¦çã ã£ãã¨ãããã°ã¯
ããã¾ã§ã¢ããªãå®è¡ããã¨ãã«æ¸ããããã®ã§ã
ãæ£å¸¸ãªæ»ãå¤ã ã£ããã¨ããä¿è¨¼ãããã®ã§ã¯ãªãã
ã¨ãããã¨ã§ãã£ããã»ã»ã»
Tomcatã®access.logã«ä½ãåºåããã¦ããªãã®ã¯ã
ã¢ããªãSQLãæããæç¹ã§ã¬ã¹ãã³ã¹ãè¿ã£ã¦ããªããªã£ãããã
Apacheã¯Timeoutãã503ã§ã¨ã©ã¼ãè¿ãã
15åå¾ãDBã«ã¢ã¯ã»ã¹ã§ããªãã£ããã¨ãã大éã®SQL Exceptionã¨
pipeBrokenã§éç¥ããã
ãããããï¼
ããããAPã¨DBã®éã«ãããã®ãAPã¨DBã®éä¿¡ãé®æãã¦ããï¼
ããã§ããã
netstatã§ã¿ãã¨ããã¨ã©ã¼å¾ã®APã¨DBã®æ¥ç¶ã¯ãESTABLISHEDããªãã ããã
ã¨ã¯è¨ãããã®ä»®èª¬ã«ã¯å¯è½æ§ãããã¨æã£ãã®ã§ã
ã¡ãã£ã¨èãã¦ã¿ãã
APã¨DBã®ãããã®ãããã¯ããã¼ããã©ã³ãµï¼LBï¼ã¨ãã¡ã¤ã¢ã¦ã©ã¼ã«ï¼FWï¼ã
ã©ã¡ããã¦ãã§è¨å®ãããã®ã§ã¯ãªãã®ã§ã
SQLã®ãã¼ãã¨ã1800ç§ã¨ãããã¼ã¯ã¼ãã§å¿å½ããã¯ç¡ããèãã¦ã¿ãã
ã»ã»ã»
ãã³ã´ãã¾ããããã
ã¢ã¯ã»ã¹ãç¡ãå ´åã1800ç§ã§ã³ãã¯ã·ã§ã³ãåæããè¨å®ã
FWã«ãã¦ããã¾ããã
ãããä»æ§ã§ãã³ãã¯ã·ã§ã³ãåæãããã¨ã¯
å©ç¨å´ï¼ãã®å ´åAPãDBï¼ã«ã¯åæãããã¨ãéç¥ããªããããã
ã¦ãã¨ã§ããESTABLISHEDãã ã¨æã£ã¦ããAPå´ã¯ã
ãµã¤ã¼ã«ã¢ã¯ã»ã¹ãã¦å¸°ãã¬äººã¨ãªããã¨ã»ã»ã»ã
ãããã¨ããããç¡å¶éã«ãã¦ããã£ã¦è©¦ãã¨ã
ããã¨ã©ã¼ã¯èµ·ããã¾ããã§ããã
ã¨ãããã¨ã§ã
ç§ã®ç°å¢ã§èµ·ãã£ãä¸è¨ã¨ã©ã¼
[æ¥ä»] [error] (70007)The timeout specified has
expired: ajp_ilink_receive() can't receive header
[æ¥ä»] [error] ajp_read_header: ajp_ilink_receive failed
[æ¥ä»] [error] (120006)APR does not understand
this error code: proxy: read response failed from ï¼localhostï¼
ã®åå ã¯ã
FWã®ã³ãã¯ã·ã§ã³åæè¨å®ãåå ã§ãã£ã
ã¨ãããã¨ã§ããã
ã¨ã©ã¼ããããããããªãããã»ã»ã»Â´Ïï½