⾦蝶容器Apusic中重新部署war包
1 简介
由于当前的项⽬platform需要部署在192.168.1.92上,因此在添加了新的功能之后,需要重新为项⽬制作jar包和重新把项⽬部署在⾦蝶容器中,在此简要的把部署的过程总结如下。
注意:platform项⽬默认部署的在192.168.1.92上,并且端⼝为8080,由于项⽬基于SpringBoot,因此在默认情况下访问接⼝时是需要加⼊项⽬名称platform的,但为了之前接⼝的⼀致性,把platform制作成ROOT项⽬,默认访问的接⼝不需要添加
访问接⼝url类似如下:
2 制作war包
2.l
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="/POM/4.0.0"xsi="/2001/XMLSchema-instance"
schemaLocation="/POM/4.0.0 /xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath/><!-- lookup parent from repository -->
</parent>
<groupId&52</groupId>
<artifactId>platform</artifactId>
<version>V1.0</version>
<name>platform</name>
<packaging>war</packaging>
<description>Support project for 28</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
…
</dependencies>
<build>
**<finalName>platform</finalName>**
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
乐观的作文<source>1.8</source>
<target>1.8</target>
饱的英文<skip>true</skip>
<encoding>UTF-8</encoding>
<compilerArguments>
<extdirs>${project.badir}/src/main/resources/lib</extdirs>
<!--extdirs>lib</extdirs>-->
</compilerArguments>
</configuration>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<webResources>
<resource>
<directory>src/main/resources/lib/</directory>
<targetPath>WEB-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
<failOnMissingWebXml>fal</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
2.2 检测application.properties
当前application.properties配置⽂件如下:
怀孕牙龈肿痛怎么办#rver.port=9555
visitor.eventUploadUrl=192.168.1.92:10000/zhyqts/rvices/rest/monitor/visitorEvent isc.eventUploadUrl=192.168.1.92:10000/yqsjcj/rvices/rest/rest/get
isc.gatewayUrl=192.168.1.51:8080/JRYX/api/doorCaution
logging.file=mylog.log
tomcat.ip=192.168.1.92
tomcat.port=8080
tomcat.projectName=
#config for lieying rvice
lieying.ip=192.168.1.117礼物作文800字初中
lieying.address=${lieying.ip}:443
lieying.uploadAddress=192.168.1.92:10000
lieying.loginName=admin
lieying.passwd=hik12345
#config for lianpu rvice
lianpu.ip=192.168.1.112
lianpu.address=${lianpu.ip}:443
lianpu.uploadAddress=192.168.1.92:10000
lianpu.loginName=admin
lianpu.passwd=hik12345+
#config for iSecureCenter
iSecureCenter.host=192.168.1.111
iSecureCenter.appkey=20644300
iSecureCenter.appcret=uBvol0HInjIc8oOJoT3a
2.3 配置含义
3 步骤
3.1 前提
确保当前项⽬所在的域配置⽂件中开启的端⼝为8080,该配置⽂件路径如下:
/usr/local/yyzc/52-project/AAS-V9.0_2019-1-7/domains/mydomain/config/ f
在配置⽂件中f中,关注参数
<SERVICE
CLASS="Muxer"
>
<ATTRIBUTE NAME="Port"VALUE="8080"/>
广场景观设计
<ATTRIBUTE NAME="Backlog"VALUE="1024"/>
<ATTRIBUTE NAME="Timeout"VALUE="30"/>
<ATTRIBUTE NAME="LookAheadTimeout"VALUE="30"/>
<ATTRIBUTE NAME="MaxWaitingClients"VALUE="200"/>
<ATTRIBUTE NAME="WaitingClientTimeout"VALUE="5"/>
<ATTRIBUTE NAME="SSLEnabled"VALUE="Fal"/>
<ATTRIBUTE NAME="SecurePort"VALUE="6889"/>
<ATTRIBUTE NAME="KeyStore"VALUE="config/sslrver"/>海关监管
<ATTRIBUTE NAME="KeyStorePassword"VALUE="keypass"/>
<ATTRIBUTE NAME="KeyPassword"VALUE="keypass"/>
</SERVICE>
可以确定Port对应的值为8080,并且当前系统所在的ip与配置⽂件中application.properties中的tomcat.ip保持⼀致。
3.2 停⽌platform项⽬
3.2.1 切换⾄applications⽬录
⾸先要切换⽬录到当前项⽬所在的applications⽬录中。
[Unauthorized System] root@lccy-os:~# cd /usr/local/yyzc/52-project/AAS-V9.0_2019-1-7/domains/mydomain/applications
[Note] System unauthorized, Plea contact the system supplier.
[Unauthorized System] root@lccy-os:/usr/local/yyzc/52-project/AAS-V9.0_2019-1-7/domains/mydomain/applications#
3.2.2 stopapusic⽬录停⽌项⽬
使⽤相对路径执⾏命令停⽌当前项⽬所在:
[Unauthorized System] root@lccy-os:/usr/local/yyzc/52-project/AAS-V9.0_2019-1-7/domains/mydomain/applications# ../bin/stopapusic
需要注意的是,在⾦蝶容器中执⾏了上述的停⽌命令,虽然执⾏成功了,但程序其实并未执⾏成功,此时需要通过杀死进程的⽅式来解决该问题,可以使⽤
netstat –anop |grep 8080
的⽅式来查询进程PID
3.2.3 查询项⽬所在PID
3.2.3.1 netstat
[Unauthorized System] root@lccy-os:/usr/local/yyzc/52-project/AAS-V9.0_2019-1-
7/domains/mydomain/applications# netstat -ano | grep 8080
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 关闭(0.00/0/0)
[Note] System unauthorized, Plea contact the system supplier.
[Unauthorized System] root@lccy-os:/usr/local/yyzc/52-project/AAS-V9.0_2019-1-7/domains/mydomain/applications# netstat -anop | grep 8080
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 3745/java 关闭(0.00/0/0)
其中-p参数作⽤如下:
-p,--programs display PID/Program name for sockets
关于netstat命令的参数内容参见如下:
[Unauthorized System] root@lccy-os:/usr/local/yyzc/52-project/AAS-V9.0_2019-1-7/domains/mydomain/applications# netstat --help
usage: netstat [-vWeenNcCF][<Af>]-r netstat {-V|--version|-h|--help}
netstat [-vWnNcaeol][<Socket>...]
netstat {[-vWeenNac]-i |[-cWnNe]-M |-s }
-r,--route 显⽰路由表
-i,--interfaces display interface table
当幸福来临时
-g,--groups display multicast group memberships
-s,--statistics display networking statistics (like SNMP)
-M,--masquerade display masqueraded connections
-v,--verbo 显⽰详细信息
-W,--wide don't truncate IP address
-n, --numeric 不解析名称
--numeric-hosts 不解析主机名
--numeric-ports 忽略端⼝名称
--numeric-urs 忽略⽤户名
-N, --symbolic resolve hardware names
-
e, --extend 显⽰更多信息
-p, --programs display PID/Program name for sockets
-c, --continuous continuous listing
-l, --listening display listening rver sockets
-a, --all, --listening display all sockets (default: connected)
-o, --timers display timers
-F, --fib display Forwarding Information Ba (default)
-C, --cache display routing cache instead of FIB
<Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom
<AF>=U '-6|-4' or '-A <af>' or '--<af>';默认: inet
列出所有⽀持的协议:
inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
x25 (CCITT X.25)
3.2.3.2 lsof
也可以使⽤lsof命令来查看某个端⼝所对应的pid。lsof主要作⽤为list open files。
奇迹暖暖搭配竞技场攻略
An open file may be a regular file, a directory, a block special file, a character special file, an executing text reference, a library, a stream
or a network file (Internet socket,NFS file or UNIX domain socket.) A specific file or all the files in a file system may be lected by path.
Instead of a formatted display, lsof will produce output that can be pard by other programs. See the -F, option description,and the OUTPUT FOR OTHER PROGRAMS ction for more information.
In addition to producing a single output list, lsof will run in repeat mode. In repeat mode it will produc
e output, delay, then repeat the output operation until stopped with an interrupt or quit signal. See the +|-r [t[m<fmt>]] option description for more information.
3.2.4 使⽤kill杀死进程
对于如上的netstat输出,执⾏kill -9 3745即可保证项⽬停⽌成功
[Unauthorized System] root@lccy-os:/usr/local/yyzc/52-project/AAS-V9.0_2019-1-7/domains/mydomain/applications# kill -9 3745
3.3 拷贝运⾏项⽬
可以使⽤⼯具把制作好的platform.war包拷贝进⼊applications⽬录中。
[Unauthorized System] root@lccy-os:/usr/local/yyzc/52-project/AAS-V9.0_2019-1-7/domains/mydomain/applications# ls platform.war
此时使⽤jar⼯具把platform.war包解压到applications⽬录下。
[Unauthorized System] root@lccy-os:/usr/local/yyzc/52-project/AAS-V9.0_2019-1-7/domains/mydomain/applications# jar -xf platform.war
在外部制作好war包之后,使⽤解压缩⼯具打开war包,可以看到⽣成了platform⽂件夹,其中该⽂件夹内容如下:
注意:application.properties⽂件即为配置⽂件
3.4 重启项⽬
3.4.1 启动项⽬
在当前项⽬下执⾏startapusic命令启动项⽬
[Unauthorized System] root@lccy-os:/usr/local/yyzc/52-project/AAS-V9.0_2019-1-7/domains/mydomain/applications# nohup ../bin/startapusic 1> ../bin/n ohup.out 2>&1 &
[1]28330
[Note] System unauthorized, Plea contact the system supplier.