Tomcat take forever to start on centos

Thanhpv

New Member
30/3/18
27
6
3
Chào các bạn

Mình gần như mới toanh với centos và cả tomcat.
Mình chạy trên máy windows của mình ko gặp vấn đề gì nhưng khi chạy trên centos 7 thì nó ko hoàn thành khởi động và cũng chẳng thèm báo lỗi gì.

Mình đã kiểm tra Ram (2G) và còn spare gần 1G.

Mình hoàn toàn bó chiếu! Ai biết đc nó bị sao chỉ mình với


Code:
# ./catalina.sh run
Using CATALINA_BASE:   /opt/tomcat1/
Using CATALINA_HOME:   /opt/tomcat1/
Using CATALINA_TMPDIR: /opt/tomcat1//temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /opt/tomcat1//bin/bootstrap.jar:/opt/tomcat1//bin/tomcat-juli.jar
09-May-2020 15:35:17.204 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/9.0.34
09-May-2020 15:35:17.206 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Apr 3 2020 12:02:52 UTC
09-May-2020 15:35:17.206 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.34.0
09-May-2020 15:35:17.206 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
09-May-2020 15:35:17.206 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            3.10.0-1127.el7.x86_64
09-May-2020 15:35:17.206 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
09-May-2020 15:35:17.206 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre
09-May-2020 15:35:17.206 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_252-b09
09-May-2020 15:35:17.207 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
09-May-2020 15:35:17.207 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /opt/tomcat1
09-May-2020 15:35:17.207 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /opt/tomcat1
09-May-2020 15:35:17.208 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat1//conf/logging.properties
09-May-2020 15:35:17.208 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
09-May-2020 15:35:17.208 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
09-May-2020 15:35:17.209 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
09-May-2020 15:35:17.209 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.security.egd=file:/dev/./urandom
09-May-2020 15:35:17.209 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
09-May-2020 15:35:17.224 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx512m
09-May-2020 15:35:17.225 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
09-May-2020 15:35:17.225 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
09-May-2020 15:35:17.225 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat1/
09-May-2020 15:35:17.225 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat1/
09-May-2020 15:35:17.225 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat1//temp
09-May-2020 15:35:17.225 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.23] using APR version [1.4.8].
09-May-2020 15:35:17.225 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
09-May-2020 15:35:17.225 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
09-May-2020 15:35:17.228 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.0.2k-fips  26 Jan 2017]
09-May-2020 15:35:17.774 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-80"]
09-May-2020 15:35:17.840 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [979] milliseconds
09-May-2020 15:35:17.903 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
09-May-2020 15:35:17.904 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.34]
09-May-2020 15:35:17.915 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat1/webapps/ROOT]
09-May-2020 15:35:18.433 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat1/webapps/ROOT] has finished in [517] ms
09-May-2020 15:35:18.433 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat1/webapps/docs]
09-May-2020 15:35:18.460 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat1/webapps/docs] has finished in [27] ms
09-May-2020 15:35:18.460 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat1/webapps/examples]
09-May-2020 15:35:18.951 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat1/webapps/examples] has finished in [491] ms
09-May-2020 15:35:18.952 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat1/webapps/host-manager]
09-May-2020 15:35:18.999 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat1/webapps/host-manager] has finished in [47] ms
09-May-2020 15:35:18.999 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat1/webapps/manager]
09-May-2020 15:35:19.045 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat1/webapps/manager] has finished in [45] ms
09-May-2020 15:35:19.063 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-80"]
09-May-2020 15:35:19.113 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [1,272] milliseconds
 

Joe

Thành viên VIP
21/1/13
2,936
1,304
113
When you post a problem related to a certain product that runs on a certain OS you ought to give the readers more detailed information about e.g. Tomcat version or what JDK so that the readers don't need to scan the log for such details. Click HERE to learn how to work around the repetitive problem.
BTW, my personal opinion: too much dependencies on too many DIFFERENT 3rd products usually lead to weird problems that even Jesus or Buddha had to capitulate.
 
Sửa lần cuối:

Thanhpv

New Member
30/3/18
27
6
3
When you post a problem related to a certain product that runs on a certain OS you ought to give the readers more detailed information about e.g. Tomcat version or what JDK so that the readers don't need to scan the log for such details. Click HERE to learn how to work around the repetitive problem.
BTW, my personal opinion: too much dependencies on too many DIFFERENT 3rd products usually lead to weird problems that even Jesus or Buddha had to capitulate.
I have tried on tomcat 9 on both jdk 8 and jdk11. Neither of them work.

I have tried his solution . You can see the args here

09-May-2020 15:35:17.209 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.security.egd=file:/dev/./urandom

It is not many, only very famous tomcat.


It is really horrible showing no errors but also not working. :((
 

Joe

Thành viên VIP
21/1/13
2,936
1,304
113
Thanh, you know. LINUX with all its derivatives is a horror in itself. Linux is neither UNIX (like SunOS or MacOS) nor WINDOWS. It looks like UNIX, works like UNIX but the porting (Red Hat, Ubuntu, CentOS, etc.) makes LINUX irregular to UNIX. If you are keen with IT you should firstly choose one System (or two) and start slowly with one installation, Step by step. And then you should make sure that the installation is complete and works before you begin the next step with the next installation.

Your problems need to be investigated in the starting shell script, then the JAVA classpath (JAVAHOME), Tomcat path (configuration), the LINUX access rights. All that needs a LINUX man who is familiar with CentOS to check the mentioned issues. Sorry, it's impossible to make a remote diagnostics from afar.
 
Sửa lần cuối:

Thanhpv

New Member
30/3/18
27
6
3
Windows works, Mac works. But Centos 7 does not work.

It seems that the problems is about the OS. not Tomcat nor my application

F88k my VPS
 
Sửa lần cuối:
  • Like
Reactions: Joe

Thanhpv

New Member
30/3/18
27
6
3
Your problems need to be investigated in the starting shell script, then the JAVA classpath (JAVAHOME), Tomcat path (configuration), the LINUX access rights. All that needs a LINUX man who is familiar with CentOS to check the mentioned issues. Sorry, it's impossible to make a remote diagnostics from afar.
However next time please add Firewall to your "check list" :x

Works now and the caption is misleading.

Thanks
 
Sửa lần cuối: