When the Cluster Environment of Java products is deployed in Linux, the following exception is reported in the background. The system reports that the host named "qatest242" cannot be found:
Error-Get local host name failed-Com. TRS. infra. Cluster. clusterconfig. getmemberhost (clusterconfig. Java: 293)
Java.net. unknownhostexception: qatest242: qatest242 At java.net. inetaddress. getlocalhost (inetaddress. Java: 1353)
At xxxxxxx product exception information
At org. Apache. Catalina. Core. standardwrapper. loadservlet (standardwrapper. Java: 1029)
At org. Apache. Catalina. Core. standardwrapper. Load (standardwrapper. Java: 862)
At org. Apache. Catalina. Core. standardcontext. loadonstartup (standardcontext. Java: 4013)
At org. Apache. Catalina. Core. standardcontext. Start (standardcontext. Java: 4357)
At org. Apache. Catalina. Core. containerbase. addchildinternal (containerbase. Java: 823)
At org. Apache. Catalina. Core. containerbase. addchild (containerbase. Java: 807)
At org. Apache. Catalina. Core. standardhost. addchild (standardhost. Java: 595)
At org. Apache. Catalina. Core. standardhostdeployer. Install (standardhostdeployer. Java: 277)
At org. Apache. Catalina. Core. standardhost. Install (standardhost. Java: 832)
At org. Apache. Catalina. startup. hostconfig. deploydirectories (hostconfig. Java: 701)
At org. Apache. Catalina. startup. hostconfig. deployapps (hostconfig. Java: 432)
At org. Apache. Catalina. startup. hostconfig. Start (hostconfig. Java: 983)
At org. Apache. Catalina. startup. hostconfig. lifecycleevent (hostconfig. Java: 349)
At org. Apache. Catalina. util. lifecyclesupport. firelifecycleevent (lifecyclesupport. Java: 119)
At org. Apache. Catalina. Core. containerbase. Start (containerbase. Java: 1091)
At org. Apache. Catalina. Core. standardhost. Start (standardhost. Java: 789)
At org. Apache. Catalina. Core. containerbase. Start (containerbase. Java: 1083)
At org. Apache. Catalina. Core. standardengine. Start (standardengine. Java: 478)
At org. Apache. Catalina. Core. standardservice. Start (standardservice. Java: 480)
At org. Apache. Catalina. Core. standardserver. Start (standardserver. Java: 2313)
At org. Apache. Catalina. startup. Catalina. Start (Catalina. Java: 556)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 597)
At org. Apache. Catalina. startup. Bootstrap. Start (Bootstrap. Java: 287)
At org. Apache. Catalina. startup. Bootstrap. Main (Bootstrap. Java: 425) |
Error JavaCode:
| Inetaddress localhost = inetaddress. getlocalhost (); |
Solution:
Open the ETC/hosts file on the Linux machine, add the following sentence at the end of the file, and restart the ekp application.
| 192.9.100.242 cluster242.domain qatest242 |
192.9.100.242: IP Address
Cluster242.domain: Second-digit Domain Name
Qatest242: Host Name