服务器主机重启后,server无法启动或访问
先检查下server进程在不在,如下30281就是server在linux运行的进程,如果没有server进程,那么server就没有启动起来
[root@VM-4-11-centos ~]# ps -ef | grep wgcloud-server root 551 451 0 14:52 pts/1 00:00:00 grep --color=auto wgcloud-server root 30281 1 0 Dec22 ? 00:03:08 java -server -Xms256m -Xmx512m -jar wgcloud-server-release.jar
如果server在windows部署的话,输出以下内容的运行窗口才是server进程,windows窗口中文可能会显示乱码,不过没有影响
2023-12-23 15:10:53.966 [main] INFO com.wgcloud.WgcloudServiceApplication - Starting WgcloudServiceApplication vrelease using Java 1.8.0_152 on DESKTOP-O4IMB60 with PID 17496 (D:\wgcloud测试\wgcloud-v3.4.9\server\wgcloud-server-release.jar started by wgcloud in D:\wgcloud测试\wgcloud-v3.4.9\server) 2023-12-23 15:10:53.973 [main] INFO com.wgcloud.WgcloudServiceApplication - No active profile set, falling back to 1 default profile: "default" 2023-12-23 15:10:56.278 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 9999 (http) 2023-12-23 15:10:56.291 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat] 2023-12-23 15:10:56.292 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.75] 2023-12-23 15:10:56.510 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext 2023-12-23 15:10:56.511 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 2443 ms 2023-12-23 15:10:57.031 [main] WARN com.zaxxer.hikari.HikariConfig - HikariPool-1 - idleTimeout has been set but has no effect because the pool is operating as a fixed size pool. 2023-12-23 15:10:57.033 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting... 2023-12-23 15:10:57.037 [main] WARN com.zaxxer.hikari.util.DriverDataSource - Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation. 2023-12-23 15:10:57.247 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed. 2023-12-23 15:10:59.339 [main] INFO com.wgcloud.util.IdGeneratorSnowflake - 当前机器的workerId: 0 2023-12-23 15:10:59.755 [main] INFO o.s.b.a.web.servlet.WelcomePageHandlerMapping - Adding welcome page template: index 2023-12-23 15:11:00.295 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 9999 (http) with context path '' 2023-12-23 15:11:00.323 [main] INFO com.wgcloud.WgcloudServiceApplication - Started WgcloudServiceApplication in 7.168 seconds (JVM running for 8.166) 2023-12-23 15:11:00.344 [main] INFO com.wgcloud.common.ApplicationStartListener - NettyServer服务启动,端口:9998 2023-12-23 15:11:05.328 [taskScheduler-1] INFO com.wgcloud.task.ScheduledTask - validateLicense------------2023-12-23 15:11:05 2023-12-23 15:11:05.444 [taskScheduler-1] INFO com.wgcloud.util.license.LicenseUtil - 未检测到授权文件---------------- 2023-12-23 15:11:05.444 [taskScheduler-1] INFO com.wgcloud.util.license.LicenseUtil - 没有检测到授权文件/server/license.txt,当前版本重置为个人版。个人版免费,不需要授权文件,请放心使用。如果您需要专业版或技术支持,请联系我们 www.wgstart.com 2023-12-23 15:11:09.323 [taskScheduler-2] INFO com.wgcloud.task.DataScheduledTask - 批量提交监控数据任务开始----------2023-12-23 15:11:09 2023-12-23 15:11:09.326 [taskScheduler-2] INFO com.wgcloud.task.DataScheduledTask - 批量提交监控数据任务结束----------2023-12-23 15:11:09 2023-12-23 15:11:15.325 [taskScheduler-3] INFO com.wgcloud.task.ScheduledTask - sumDiskSizeCacheTask------------2023-12-23 15:11:15 2023-12-23 15:11:18.324 [taskScheduler-4] INFO com.wgcloud.task.DataScheduledTask - 批量提交监控数据任务开始----------2023-12-23 15:11:18 2023-12-23 15:11:18.331 [taskScheduler-4] INFO com.wgcloud.task.DataScheduledTask - 批量提交监控数据任务结束----------2023-12-23 15:11:18 2023-12-23 15:11:20.323 [taskScheduler-5] INFO com.wgcloud.task.ScheduledTask - initTask------------2023-12-23 15:11:20 2023-12-23 15:11:27.318 [taskScheduler-6] INFO com.wgcloud.task.DataScheduledTask - 批量提交监控数据任务开始----------2023-12-23 15:11:27 2023-12-23 15:11:27.324 [taskScheduler-6] INFO com.wgcloud.task.DataScheduledTask - 批量提交监控数据任务结束----------2023-12-23 15:11:27
如果server进程已经启动,那么可能是防火墙没有放行server的端口(默认是9999),所以访问不到页面,检查一下
以下是server进程不存在,server没有启动的原因排查
1、原因可能是数据库服务没有启动,所以server没有启动成功,我们先启动数据库(比如MySQL),然后再启动server
2、server/config/applicaiton.yml格式问题,一般是
配置项的冒号后没有保留一个空格导致的
,我们检查下刚改过的配置,正确格式应该是如下这样
#守护进程访问url,server服务使用,agent不使用(一般保持默认即可) daemonUrl: http://localhost:9997
3、最后,若还无法启动成功,可以看server/log/下的日志文件有什么错误信息,一般错误信息都能网上搜到答案
4. 检查下是不是server的web端口(默认为9999),是不是已经被其他程序占用了,如果是的话,可以把server端口9999改成其他的
5、如果没有日志文件生成,在server/目录下使用如下指令来测试下有无错误信息
[root@VM-4-17-centos server]#
java -jar wgcloud-server-release.jar
6、还有可能是数据库连接失败导致的,参考
问题说明7
7、是server主机的JDK环境变量没有设置好(参考
Linux安装JDK请点击
,
Windows安装JDK请点击
)