zoukankan      html  css  js  c++  java
  • Tomcat多实例部署

    1.下载安装jdk

    wget 地址https://down.oracle.com  
    tar -xvzf jdk-8u131-linux-x64.tar.gz -C /opt/;mv /opt/jdk* /opt/jdk

    2.下载安装Tomcat

    wget 地址https://mirror.bit.edu.cn   
    
    tar -xvzf apache-tomcat-7.0.78.tar.gz -C /opt/;mv /opt/apache* /opt/tomcat8080
    cp -a /opt/tomcat8080 /opt/tomcat8081
    cp -a /opt/tomcat8080 /opt/tomcat8082
    cp -a /opt/tomcat8080 /opt/tomcat8083
    cp -a /opt/tomcat8080 /opt/tomcat8084


    3.修改tomcat配置文件server.xml[修改监听端口]

    sed -i 's/8080/8081/g;s/8005/8105/g;s/8009/8109/g;s/8443/8441/g' /opt/tomcat8081/conf/server.xml
    sed -i 's/8080/8082/g;s/8005/8205/g;s/8009/8209/g;s/8443/8442/g' /opt/tomcat8082/conf/server.xml
    sed -i 's/8080/8083/g;s/8005/8305/g;s/8009/8309/g;s/8443/8440/g' /opt/tomcat8083/conf/server.xml
    sed -i 's/8080/8084/g;s/8005/8405/g;s/8009/8409/g;s/8443/8444/g' /opt/tomcat8084/conf/server.xml

    4.配置启动文件:

    sed -i '107a export JAVA_HOME=/opt/jdk' /opt/tomcat8080/bin/catalina.sh
    sed -i '108a export PATH=${JAVA_HOME}/bin:$PATH' /opt/tomcat8080/bin/catalina.sh
    sed -i '107a export JAVA_HOME=/opt/jdk' /opt/tomcat8081/bin/catalina.sh
    sed -i '108a export PATH=${JAVA_HOME}/bin:$PATH' /opt/tomcat8081/bin/catalina.sh
    sed -i '107a export JAVA_HOME=/opt/jdk' /opt/tomcat8082/bin/catalina.sh
    sed -i '108a export PATH=${JAVA_HOME}/bin:$PATH' /opt/tomcat8082/bin/catalina.sh
    sed -i '107a export JAVA_HOME=/opt/jdk' /opt/tomcat8083/bin/catalina.sh
    sed -i '108a export PATH=${JAVA_HOME}/bin:$PATH' /opt/tomcat8083/bin/catalina.sh
    sed -i '107a export JAVA_HOME=/opt/jdk' /opt/tomcat8080/bin/catalina.sh
    sed -i '108a export PATH=${JAVA_HOME}/bin:$PATH' /opt/tomcat8080/bin/catalina.sh


    5.多实例启动

    for i in `seq 8080 8083`;do /opt/tomcat${i}/bin/shutdown.sh ;done
    for i in `seq 8080 8083`;do /opt/tomcat${i}/bin/startup.sh ;done
    for i in `seq 8080 8083` ;do curl 192.168.0.214:${i} -I ;done

    6.多实例curl检查

    ss -lntp|grep 8
    for i in `seq 8080 8089` ;do curl 192.168.0.215:${i} -I ;done
    for i in `seq 8080 8089` ;do curl 192.168.0.215:${i} -I|head -1;done |wc -l

    参考博文:http://www.cnblogs.com/milton/p/4505670.html

  • 相关阅读:
    模板实现一个通用栈
    服务器开发
    objectc获取文件各项属性方法
    Visual C++ MFC 中常用宏的含义
    symbian获取中文的拼音
    sip协议的功能及其应用
    【转】MySQL分区的简单实例,用于解决大数据表的问题
    Symbian c++ 在3版中实现并动态配置开机自启动
    (转)如果你也喜欢用goto
    C++实现查找汉字拼音首字母
  • 原文地址:https://www.cnblogs.com/wylhome/p/9112441.html
Copyright © 2011-2022 走看看