开机自动启动tomcat+memcached+nginx

编辑 /etc/rc.d/rc.local

如下:

export JAVA_HOME=/usr/java/jdk1.7.0_71
export CLASSPATH=.:/usr/java/jdk1.7.0_71/lib/dt.jar:/usr/java/jdk1.7.0_71/lib/tools.jar
export PATH=/usr/java/jdk1.7.0_71/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
export CATALINA_HOME_1=/usr/local/tomcat_1_18001
export CATALINA_HOME_2=/usr/local/tomcat_2_18002
export CATALINA_HOME_3=/usr/local/tomcat_3_18003
export CATALINA_HOME_4=/usr/local/tomcat_4_18004
/usr/local/tomcat_1_18001/bin/startup.sh
/usr/local/tomcat_2_18002/bin/startup.sh
/usr/local/tomcat_3_18003/bin/startup.sh
/usr/local/tomcat_4_18004/bin/startup.sh
/usr/local/nginx/sbin/nginx
/usr/local/memcached-1.4.24/memcached -u root -p 11211


保存后重启机器

reboot


四个tomcat+memcached+nginx 集群负载均衡+session共享

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。