三、手动发布与测试
后端:
修改application-prod.yml文件,根据自己的发布机器的相关参数进行修改,再进行编译,处出来nbcio-boot\nbcio-boot-module-system\target下的nbcio-boot-module-system-3.0.jar 这个运行jar包,上传到服务器的指定目录,并修改成nbcio-boot.jar。
先测试进行运行
java -Xms128m -Xmx256m -Duser.timezone=Asia/Shanghai -jar nbcio-boot.jar --env=prod
在./logs目录里tail -100f nbcioboot-2022-07-29.0.log进行后端运行的日志,检查是否成功与相关错误信息。
2022-07-29 23:18:08.019 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: queryByIdUsingGET_8 2022-07-29 23:18:08.031 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: queryPageListUsingGET_8 2022-07-29 23:18:08.045 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: addUsingPOST_9 2022-07-29 23:18:08.052 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: deleteUsingDELETE_12 2022-07-29 23:18:08.054 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: deleteBatchUsingDELETE_9 2022-07-29 23:18:08.055 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: editUsingPUT_9 2022-07-29 23:18:08.066 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: getInfoUsingGET_1 2022-07-29 23:18:08.068 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: queryByIdUsingGET_9 2022-07-29 23:18:08.077 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: queryPageListUsingGET_9 2022-07-29 23:18:08.135 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: addUsingPOST_10 2022-07-29 23:18:08.158 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: deleteUsingDELETE_13 2022-07-29 23:18:08.160 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: deleteBatchUsingDELETE_10 2022-07-29 23:18:08.167 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: editUsingPUT_10 2022-07-29 23:18:08.169 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: queryByIdUsingGET_10 2022-07-29 23:18:08.187 [main] INFO s.d.s.w.r.operation.CachingOperationNameGenerator:41 - Generating unique operation named: queryPageListUsingGET_10 2022-07-29 23:18:09.592 [main] INFO o.s.scheduling.quartz.SchedulerFactoryBean:727 - Starting Quartz Scheduler now 2022-07-29 23:18:10.007 [main] INFO o.s.scheduling.quartz.LocalDataSourceJobStore:3644 - ClusterManager: detected 1 failed or restarted instances. 2022-07-29 23:18:10.007 [main] INFO o.s.scheduling.quartz.LocalDataSourceJobStore:3503 - ClusterManager: Scanning for instance "localhost.localdomain1659103761789"'s failed in-progress jobs. 2022-07-29 23:18:10.065 [main] INFO org.quartz.core.QuartzScheduler:547 - Scheduler MyScheduler_$_localhost.localdomain1659107857811 started. 2022-07-29 23:18:10.131 [main] INFO org.jeecg.NbcioSystemApplication:61 - Started NbcioSystemApplication in 80.092 seconds (JVM running for 82.797) 2022-07-29 23:18:10.171 [main] INFO org.jeecg.NbcioSystemApplication:40 -
----------------------------------------------------------
Application Nbcio-Boot is running! Access URLs:
Local: http://localhost:9080/nbcio-boot/
External: http://127.0.0.1:9080/nbcio-boot/
Swagger文档: http://127.0.0.1:9080/nbcio-boot/doc.html
----------------------------------------------------------
前端:
根据自己的服务器修改.env.production里的参数,编译yarn run build ,在dist出来编译好的前端代码。
准备好tomcat8或9,可以mv成比如tomcat-jeecg-9888这样的目录
同时根据生产需要进行tomcat的server.xml参数修改,比如修改成如下
<Connector port="9888" protocol="HTTP/1.1" connectionTimeout="60000" maxTreads="500" minSpareThreads="100" maxSpareThreads="500" acceptCount="200" maxProcessors="100" minProcessors="30" redirectPort="18443" executor="tomcatThreadPool" enableLookups="false" useSendfile="false" compression="on" compressionMinSize="512" noCompressionUserAgents="gozilla, traviata" compressableMimeType="text/html,text/xml,text/javascript,application/javascript,text/css,text/plain,text/json,application/x-font-woff,image/jpg,image/png,image/gif,audio/x-wav" />
前端编译好后的代码复制到ROOT下面,在bin目录下运行./catalina.sh start 启动tomcat
能出来正常的登录界面就算正常了