1.增加环境变量.
vi /root/apache-tomcat-8.5.75/bin/setenv.sh
[root@app1 bin]# cat setenv.sh export CATALINA_OPTS="$CATALINA_OPTS -Xms1600m" export CATALINA_OPTS="$CATALINA_OPTS -Xmx1600m" export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=256m" [root@app1 bin]#
2.配置自启服务
cat /usr/lib/systemd/system/tomcat.servic
[Unit] Description=Apache Tomcat Web Application Container After=syslog.target network.target remote-fs.target nss-lookup.target [Service] Type=forking Environment='JAVA_HOME=/usr/local/jdk1.8.0_271' Environment='CATALINA_PID=/root/apache-tomcat-8.5.75/tomcat.pid' Environment='CATALINA_HOME=/root/apache-tomcat-8.5.75/' Environment='CATALINA_BASE=/root/apache-tomcat-8.5.75/' Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC' PIDFile=/root/apache-tomcat-8.5.75/tomcat.pid ExecStart=/root/apache-tomcat-8.5.75//bin/startup.sh ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target
3.设置自动启动
systemctl enable tomcat systemctl daemon-reload
systemctl start tomcat
4.查看进程
ps -ef|grep java
标签:CATALINA,8.5,tomcat,重启,默认,apache,root,OPTS From: https://www.cnblogs.com/miwaiwai/p/18445922