Archive

Posts Tagged ‘Tomcat’

Tomcat进程无法正常stop问题

September 20th, 2017 No comments

CentOS使用Catalina.sh 来管理Tomcat运行时,Catalina.sh run 之后产生的tomcat进程会无法使用 Catalina.sh stop -force关闭。如果Catalina.sh的默认内容来配置tomcat服务,/etc/init.d/tomcat stop 也将会失效

查看Catalina.sh文件后找到以下代码,原来需要stop的话,需要CATALINA_PID文件配合。
Catalina.sh 468行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  if [ ! -z "$CATALINA_PID" ]; then
    if [ -f "$CATALINA_PID" ]; then
      if [ -s "$CATALINA_PID" ]; then
        kill -0 `cat "$CATALINA_PID"` >/dev/null 2>&1
        if [ $? -gt 0 ]; then
          echo "PID file found but no matching process was found. Stop aborted."
          exit 1
        fi
      else
        echo "PID file is empty and has been ignored."
      fi
    else
      echo "\$CATALINA_PID was set but the specified file does not exist. Is Tomcat running? Stop aborted."
      exit 1
    fi
  fi

Read more…

[CentOS] JDK+tomcat集群+nginx一键安装脚本

August 22nd, 2017 No comments

[CentOS] JDK+tomcat集群+nginx一键安装脚本
整理了一下在CentOS下JDK+tomcat集群+nginx的安装脚本. 支持CentOS6.x/7.x

1.安装前准备

1
2
3
4
5
# is root user
if [ "$(whoami)" != 'root' ]; then
echo "install need root user"
exit
fi

Read more…

Categories: 系统管理 Tags: , ,