kryo-1.03.jar
kryo-1.03-sources.jar
minlog-1.2.jar
reflectasm-0.9.jar
memcached-session-manager-1.6.3.jar
memcached-session-manager-tc7-1.6.3.jar
msm-kryo-serializer-1.6.3.jar
msm-javolution-serializer-1.6.3.jar
msm-xstream-serializer-1.6.3.jar
msm-flexjson-serializer-1.6.3.jar
javolution-5.4.3.1.jar
spymemcached-2.8.4.jar
conf/context.xml
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context path="" docBase="ROOT">
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
<!-- Uncomment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) -->
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
-->
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
sticky = "false"
memcachedNodes="n1:10.10.55.135:11211"
requestUriIgnorePattern=".*\.(png|gif|jpg|css|js)$"
sessionBackupAsync="false"
sessionBackupTimeout="100"
transcoderFactoryClass="de.javakaffee.web.msm.serializer.javolution.JavolutionTranscoderFactory"
copyCollectionsForSerialization="false"
/>
</Context>
\conf\nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
upstream tomcats {
#ip_hash;
server 10.10.55.174:8080 weight=1;
server 10.10.55.135:8080 weight=10;
}
server {
listen 80;
server_name 127.0.0.1;
charset utf-8;
location / {
root html;
index index.html index.htm;
proxy_pass http://tomcats;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 100m;
}
location ~ ^/(WEB-INF)/ {
deny all;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
access_log logs/host.access.log combined;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
test.jsp
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<%=session.getId() %><br/>
<%=request.getServerName() %><br/>
<%=request.getServerPort() %><br/>
<%out.print("111111111111"); %><br/>
</body>
</html>
分享到:
相关推荐
基于nginx+tomcat+memcache的负载均衡架构
nginx,tomcat集群,session共享,基于memcache 包含nginx配置,tomcat配置,以及tomcat所需要的jar 不包含nginx,tomcat,jdk,memcache的安装
1 jdk安装及tomcat7解压缩安装配置 不用说明 2 下载nginx1 4 2 for win32 解压安装 3 下载memcached服务端for win32 解压安装 设成windows服务端 执行memcached exe d install 4 下载tomcat7对应的memcached所需jar...
Nginx+Tomcat7+Memcached集群Session共享 完整例子 主要是利用memcached-session-manager(下面简称msm)开源tomcat插件改变tomcat原始的session存储机制,将session的存储放到分布式缓存memcache中,从而实现对...
经过测试,此套jar包是为配置sesion共享所需要的memcache-session-manager有关jar包,其中memcache版本2.4.1,Nginx版本1.4.7
tomcat+nginx+memcache高可用
tomcat的lib内已经包括了相关的jar
memcache tomcat7依赖包,用于memcache+nginx+tomcat7 实现session共享
Nginx+Memcache+Tomcat集群(session共享),本人亲测成功!Nginx+Memcache+Tomcat集群(session共享),本人亲测成功!
tomcat+nginx+memcache+session 所需jar包,包括memcache等安装包
memcached-session-manager-1.9.5, kryo-3.0.3,asm-5.0.3等,我用的jdk是1.8,解决了tomcat7java.lang.NoSuchFieldError: attributes等 错误。
tomcat整合nginx负载均衡+memcache共享session全部程序包
Nginx+Memcache+Linux+Tomcat搭建的集群,大神勿喷
nginx+tomcat8.0+memcached1.5 session共享所需jar包,亲测可用,采用javolution解析
使用Nginx做的负载均衡,memcache做高速cache,tomcat7.0.22做web容器环境下的session共享及缓存。 能够做到重启tomcatsession不失效或多个tomcat应用下session共享。 该RAR包包含了配置所需要的全部jar文件。
Apache+Tomcat+Session+Memcache 高性能群集搭建 J2EE性能调优 Jboss的优化配置 Memcached分布式缓存 Nginx+Tomcat 动静分离 Nginx+tomcat集群Memcached+Session复制 高性能高并发服务器架构 基于nginx的tomcat负载...
nginx配置tomcat集群session共享的时候memcache所用的jar包,
tomcat+nginx+memcache 集群所需要的jar包
Nginx+Tomcat8.5.6 + Memcache集群 kryo-serializer方式序列化 实现session共享
nginx:1.4.4 apache:2.2.29、2.4.10 mysql:5.1.73、5.5.40、5.6.21 php:5.2.17、5.3.29、5.4.23、5.5.7 php扩展:memcache、Zend Engine/ OPcache jdk:1.7.0 tomcat:7.0.54 ftp:(yum/apt-get安装) phpwind...