-
jsp集群基于nginx+tomcat实现高可用性和高性能
资源介绍
目的:搭建高可用、高性能的jsp集群
二、初始化系统
#init system
系统环境: CentOS 5.5(定制安装)
组件:
Base
Development Libraries
Development Tools
Editors
Text-based Internet
./init_system.sh #此脚本参见http://kerry.blog.51cto.com/172631/555535
三、LVS+keeplived
#关于LVS+keeplived的配置请参考我的另一篇博文《CentOS5.5环境下布署LVS+keepalived 》http://kerry.blog.51cto.com/172631/401253
四、nginx、tomcat整合
#config web_1、web_2
#download software
cd /opt
wget http://labs.renren.com/apache-mirror/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz
wget http://download.oracle.com/otn-pub/java/jdk/6u25-b06/jdk-6u25-linux-i586.bin
wget http://nginx.org/download/nginx-1.0.0.tar.gz
wget http://ftp.exim.llorien.org/pcre/pcre-8.12.tar.gz
wget http://apache.etoak.com//tomcat/tomcat-connectors/native/1.1.20/source/tomcat-native-1.1.20-src.tar.gz
wget http://archive.apache.org/dist/apr/apr-1.4.2.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.3.9.tar.gz
#================================ 1、安装tomcat、JDK =================================
mv apache-tomcat-6.0.32.tar.gz jdk-6u25-linux-i586.bin /usr/local/
tar -zxvf apache-tomcat-6.0.32.tar.gz
mv apache-tomcat-6.0.32 tomcat
chmod +x jdk-6u25-linux-i586.bin
./jdk-6u25-linux-i586.bin
#apr 与 tomcat-native 提供更好的伸缩性、性能和集成到本地服务器技术,如果没有apr技术,启动tomcat 时出现如下提示
#INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/local/jdk1.6.0_25/jre/lib/i386/client:/usr/local/jdk1.6.0_25/jre/lib/i386:/usr/local/jdk1.6.0_25/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
rpm -e --nodeps apr-1.2.7-11.el5_3.1
rpm -e --nodeps apr-1.2.7-11.el5_3.1