zoukankan      html  css  js  c++  java
  • tomcat 多实例搭建

    yum install -y --downloaddir=./root java 

    mkdir /server && cd /server

    http://mirror.bit.edu.cn/apache/tomcat/   找现在的版本

    wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-9/v9.0.31/bin/apache-tomcat-9.0.31.tar.gz

    tar -xf apache-tomcat-9.0.31.tar.gz  

    cd apache-tomcat-9.0.31

    mkdir /server &&mv /server/tomcat

    mkdir /server/tomcat/instance{1..3}
    cp -r /server/tomcat/{conf,logs,temp,work} /server/tomcat/instance1/
    cp -r /server/tomcat/{conf,logs,temp,work} /server/tomcat/instance2/
    cp -r /server/tomcat/{conf,logs,temp,work} /server/tomcat/instance3/
    vim /server/tomcat/instance1/conf/server.xml
    中三个站点里面改下面数据
    Connector port="8081/8082/8083" protocol="HTTP/1.1
    Server port="8091/8092/8093" shutdown="SHUTDOWN"
    appBase="/webapps"

    ------------------------------------
    #!/bin/bash
    #instance1
    . /etc/init.d/functions
    export CATALINA_BASE="/server/tomcat/instance1/2/3"

    case "$1" in
    start)
    $CATALINA_HOME/bin/startup.sh
    ;;
    stop)
    $CATALINA_HOME/bin/shutdown.sh
    ;;
    restart)
    $CATALINA_HOME/bin/shutdown.sh
    sleep 5
    $CATALINA_HOME/bin/startup.sh
    ;;
    esac
    export JAVA_OPTS='-Xms64m -Xmx128m'
    ------------------------------------------------------
    chmod +x /usr/local/tomcat/instance12】【3】/ins12】【3】.sh
    cp -r /usr/local/tomcat/webapps/ROOT/ /webapps/
    /usr/local/tomcat/instance1[2][3]/ins1[2][3].sh start/stop/restart
    netstat -lntup|egrep '8081|8082|8083|8091|8092|8093'
    http://ip:8081/[2]/[3]

  • 相关阅读:
    Jenkins发布.net core程序
    CentOS7部署Jenkins
    ASP.NET Core 中的响应缓存中间件
    浏览器缓存
    WEB缓存
    Jmeter常用插件——梯度加压、响应时间、TPS
    Jmeter压测报错:Non HTTP response code: java.net.ConnectExceptionexception的解决办法
    Linux如何安装rpm文件
    Prometheu---配置文件修改
    Grafana介绍---prometheus系列
  • 原文地址:https://www.cnblogs.com/Leaders543/p/12510674.html
Copyright © 2011-2022 走看看