1 、 80% 的物理内存
/home/tomcat/bin/catalina.sh 中添加
JAVA_OPTS='-Xms256m -Xmx512m'
管理机:
JAVA_OPTS='-Xms256m -Xmx1024m'
支撑机:
JAVA_OPTS='-Xms256m -Xmx768m'
测试机:
export LD_ASSUME_KERNEL = 2.4.1
2 、 Tomcat 自启动设置:
/etc/rc.local 文件
sshd
touch /var/lock/subsys/local
/etc/init.d/mysql start
export JAVA_HOME=/home/j2sdk
cd /home/tomcat/bin
。/startup.sh
3 、 MySQL 自启动设置:
/etc/rc.local 文件
/etc/init.d/mysql start
3 、设置虚拟路径:
/home/tomcat/conf/server.xml 文件:
</Context>
<Context path="/backup" docBase="/home/backup" reloadable="false" />
<Context path="/arbitration" docBase="/home/arbitration" reloadable="true" />
<Context path="/netbar" docBase="/home/netbar" reloadable="true" />
<Context path="/beijing" docBase="/home/beijing" reloadable="true" />
</Host>
</Engine>
</Service>
</Server>
4 、连接数配置:
/home/tomcat/conf/server.xml 文件:
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8080" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="100" debug="0" connectionTimeout="20000"
useURIValidationHack="false" disableUploadTimeout="true" URIEncoding="UTF-8"/>
<!—— Note : To disable connection timeouts, set connectionTimeout value
to 0 ——>
<!—— Define a SSL Coyote HTTP/1.1 Connector on port 8443 ——>
<!——
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8443" minProcessors="5" maxProcessors="75"
enableLookups="true"
acceptCount="100" debug="0" scheme="https" secure="true"
useURIValidationHack="false" disableUploadTimeout="true">
<Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
clientAuth="false" protocol="TLS" />
</Connector>
5 、管理机 root.xml 配置
/home/tomcat/bin/root.xml
<?xml version="1.0" encoding="UTF-8"?>
<JWCFK>
<db>
<driverName>com.mysql.jdbc.Driver</driverName>
<connectionURL>jdbc:mysql://192.168.16.20/netbar</connectionURL>
<connectionParam>useUnicode=true</connectionParam>
<connectionParam>characterEncoding=gbk</connectionParam>
<connectionParam>maxRows=10000</connectionParam>
<user>root</user>
<password>gtigstarcenter</password>
<maxConnection>10</maxConnection>
</db>
</JWCFK>