nginx tomcat glassfish session 复制配置
1、nginx配置
[root@www1-nlb1 ~]# cat /usr/local/nginx/conf/nginx.conf | grep -v ^$ | grep -v ^#
user www www;
worker_processes auto;
error_log /home/wwwlogs/nginx_error.log notice;
pid /usr/local/nginx/logs/nginx.pid;
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
multi_accept on;
}
http
{
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.";
#limit_conn_zone $binary_remote_addr zone=perip:10m;
##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.
server_tokens off;
#log format
log_format access '$http_clientip -- [$time_local]'
' -- $request^A$status -- $body_bytes_sent -- $connection_requests'
' -- $remote_addr -- $http_referer -- $http_user_agent'
' -- $request_body -- $request_time -- $msec';
upstream phpsite
{
server 10.10.130.237:9000;
server 10.10.130.238:9000;
}
upstream test.wych.com{
server 10.10.12.162:8005;
server 10.10.12.182:8005;
}
upstream tomcat_pool{
server 10.10.12.167:8001;
server 10.10.12.187:8001;
}
upstream glassfish_pool{
server 10.10.12.65:28082;
server 10.10.12.85:28082;
}
ssi on;
ssi_silent_errors on;
ssi_types text/shtml;
server {
listen 80;
listen 443 ssl;
server_name test.wych.com;
ssl_certificate /usr/local/nginx/ssl/server.crt;
ssl_certificate_key /usr/local/nginx/ssl/server.key;
access_log logs/test.wych.com.log access;
location /cluster/ {
proxy_set_header ServerName $server_name;
proxy_pass http://test.wych.com/cluster/;
}
location /status {
stub_status on;
access_log off;
}
}
server {
listen 80;
listen 443 ssl;
server_name su.wych.com;
ssl_certificate /usr/local/nginx/ssl/server.crt;
ssl_certificate_key /usr/local/nginx/ssl/server.key;
access_log logs/su.wych.com.log access;
location /cluster/ {
proxy_set_header ServerName $server_name;
}
location / {
proxy_set_header ServerName $server_name;
}
location /status {
stub_status on;
access_log off;
}
}
server {
listen 80;
server_name 10.10.130.237;
location / {
proxy_pass http://glassfish_pool;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
}
include vhost/*.conf;
}
二、tomcat改动
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1">
-->
<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
channelSendOptions="6">
<Manager className="org.apache.catalina.ha.session.BackupManager"
expireSessionsOnShutdown="false"
notifyListenersOnReplication="true"
mapSendOptions="6"/>
<!--
<Manager className="org.apache.catalina.ha.session.DeltaManager"
expireSessionsOnShutdown="false"
notifyListenersOnReplication="true"/>
-->
<Channel className="org.apache.catalina.tribes.group.GroupChannel">
<Membership className="org.apache.catalina.tribes.membership.McastService"
address="228.0.0.4"
port="45564"
frequency="500"
dropTime="3000"/>
<Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
address="auto"
port="4000"
selectorTimeout="100"
maxThreads="6"/>
<Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
<Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
</Sender>
<Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
<Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
<Interceptor className="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor"/>
</Channel>
<Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
filter=".*\.gif|.*\.js|.*\.jpeg|.*\.jpg|.*\.png|.*\.htm|.*\.html|.*\.css|.*\.txt"/>
<Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="/tmp/war-deploy/"
watchDir="/tmp/war-listen/"
watchEnabled="false"/>
<ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
</Cluster>
三、glassfish
<java-config debug-options="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009" system-classpath="" classpath-suffix="">
<jvm-options>-Djava.awt.headless=true</jvm-options>
<jvm-options>-Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy</jvm-options>
<jvm-options>-Dfelix.fileinstall.disableConfigSave=false</jvm-options>
<jvm-options>-Dosgi.shell.telnet.maxconn=1</jvm-options>
<jvm-options>-XX:NewRatio=2</jvm-options>
<jvm-options>-Dfelix.fileinstall.poll=5000</jvm-options>
<jvm-options>-Djava.endorsed.dirs=${com.sun.aas.installRoot}/modules/endorsed${path.separator}${com.sun.aas.installRoot}/lib/endorsed</jvm-options>
<jvm-options>-Dosgi.shell.telnet.port=6666</jvm-options>
<jvm-options>-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory</jv
m-options>
<jvm-options>-Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot}/jre/lib/ext${path.separator}${com.sun.aas.instan
ceRoot}/lib/ext</jvm-options>
<jvm-options>-XX:PermSize=64m</jvm-options>
<jvm-options>-Dgosh.args=--nointeractive</jvm-options>
<jvm-options>-Djavax.management.builder.initial=com.sun.enterprise.v3.admin.AppServerMBeanServerBuilder</jvm-options>
<jvm-options>-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as</jvm-options>
<jvm-options>-XX:MaxPermSize=192m</jvm-options>
<jvm-options>-XX:+UnlockDiagnosticVMOptions</jvm-options>
<jvm-options>-Dfelix.fileinstall.bundles.startTransient=true</jvm-options>
<jvm-options>-Dfelix.fileinstall.bundles.new.start=true</jvm-options>
<jvm-options>-Dfelix.fileinstall.dir=${com.sun.aas.installRoot}/modules/autostart/</jvm-options>
<jvm-options>-Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/login.conf</jvm-options>
<jvm-options>-Dfelix.fileinstall.log.level=2</jvm-options>
<jvm-options>-Dosgi.shell.telnet.ip=127.0.0.1</jvm-options>
<jvm-options>-DjvmRoute=${AJP_INSTANCE_NAME}</jvm-options>
<jvm-options>-client</jvm-options>
<jvm-options>-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks</jvm-options>
<jvm-options>-Xmx512m</jvm-options>
<jvm-options>-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver</jvm-options>
<jvm-options>-Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/cacerts.jks</jvm-options>
<jvm-options>-DANTLR_USE_DIRECT_CLASS_LOADING=true</jvm-options>
</java-config>
nginx tomcat glassfish session 复制配置的更多相关文章
- Nginx+Tomcat关于Session的管理
前言 Nginx+Tomcat对Session的管理一直有了解,但是一直没有实际操作一遍,本文从最简单的安装启动开始,通过实例的方式循序渐进的介绍了几种管理session的方式. nginx安装配置 ...
- Tomcat实现Session复制
Tomcat实现Session复制 需要三台虚拟机一台Nginx两台Tomcat 关闭相关的安全机制 systemctl stop firewalldiptables -Fsetenforce 0 首 ...
- Nginx+Tomcat的服务器端环境配置详解
这篇文章主要介绍了Nginx+Tomcat的服务器端环境配置详解,包括Nginx与Tomcat的监控开启方法,需要的朋友可以参考下 Nginx+tomcat是目前主流的Javaweb架构,如何让ngi ...
- Nginx+Tomcat+MemCached 集群配置手册
系统实施文档 Nginx+Tomcat+MemCached 集群配置手册 目 录 第1章 概述 1.1 目标 互联网的快速发展带来了互联网系统的高负载和高可用性, 这要求我们在设计系统架 ...
- HappyAA服务器部署笔记1(nginx+tomcat的安装与配置)
这是本人的服务器部署笔记.文章名称叫"部署笔记1"的原因是之后我对这个进行了改进之后,会有"部署笔记2","部署笔记3"...循序渐进,估计 ...
- nginx+tomcat网页动静分离配置
1.环境描述 nginx server (Proxy):192.168.1.135(作为代理服务器)WEB server1: 192.168.1.138(使用tomcat作为web容器)WEB ser ...
- Nginx+tomcat+ssl免费证书配置
0.说明 本文说描写叙述的方式是用nginx的443重定向到tomcat的8443,nginx的80port重定到tomcat的8080: 乱入:个人标记:caicongyang 1.nginx安装 ...
- 云服务器 nginx + tomcat 部署集群 配置
nginx.conf #user nobody; worker_processes ; #error_log logs/error.log; #error_log logs/error.log not ...
- nginx+tomcat集群负载均衡(实现session复制)
转自:http://talangniao.iteye.com/blog/341512 架构描述 前端一台nginx服务器做负载均衡器,后端放N台tomcat组成集群处理服务,通过nginx转发到后面( ...
随机推荐
- 胜利大逃亡(续)(bfs)
http://acm.hdu.edu.cn/showproblem.php?pid=1429 #include <stdio.h> #include <queue> #incl ...
- 搭建go开发环境
一.go下载安装 进入该网站 https://golang.google.cn/dl/ 选择相应的操作系统下载安装包 Linux/Mac OS X 安装 1.下载 go1.10.3.linux-am ...
- go的常量与变量
一.常量 1.1 定义 常量使用关键字const 定义,用于存储不会变化的数据 定义方法 const identifier [type] = value package main // 常量定义 co ...
- xml转换成数组array
直接上代码,成功转换 if($data){ //返回来的是xml格式需要转换成数组再提取值,用来做更新 $startnum = strpos($data,"<xml>" ...
- 【BZOJ1306】match循环赛
预先警告:我的做法代码量比较大 看完题目后看到数据n<=8, 不难想到这题可以写深搜来做 分析 比如说以数据: 3 3 3 3 为例子, 进行了三场比赛:AB AC BC: 我们只要搜索每场比赛 ...
- B - Eleven
Problem description Eleven wants to choose a new name for herself. As a bunch of geeks, her friends ...
- JAVA可能问的几个面试题问题及问题的标准答案
问题一:你希望工作环境是怎样的? 标准答案:我对环境没有苛求,我会努力适应环境的. 注:此问题是在测试你的求职心态,是以自己为中心还是以工作为中心. 问题二:你觉得自己有哪些缺点? 标准答案:说一些对 ...
- (转)C#开发微信门户及应用(5)--用户分组信息管理
http://www.cnblogs.com/wuhuacong/p/3695351.html 在上个月的对C#开发微信门户及应用做了介绍,写过了几篇的随笔进行分享,由于时间关系,间隔了一段时间没有继 ...
- nginx_安装测试
首先安装环境: [root@local nginx-1.9.14]# yum install gcc-c++ pcre pcre-devel zlib zlib-devel openssl op ...
- java操作Excel的poi 遍历一个工作簿
遍历一个工作簿 package com.java.poi; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.h ...