`
yangzb
  • 浏览: 3503554 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

nginx-upstream-jvm-route

阅读更多

http://code.google.com/p/nginx-upstream-jvm-route/

nginx_upstream_jvm_route


This module achieves session stickiness with the session cookie. If the session is not in the cookie or URL, the module will be a normal Round-Robin upstream module.

INSTALLATION

    cd nginx
-
0.7
.
59
 
# or whatever

    patch 
-
p0 
<
 
/path/
to
/
this
/
directory
/
jvm_route
.
patch

compile nginx with the following addition option:

    
--
add
-
module
=
/path/
to
/
this
/
directory

EXAMPLE

1.For resin

upstream backend 
{

    server 
192.168
.
0.100
 srun_id
=
a
;

    server 
192.168
.
0.101
 srun_id
=
b
;

    server 
192.168
.
0.102
 srun_id
=
c
;

    server 
192.168
.
0.103
 srun_id
=
d
;


    jvm_route $cookie_JSESSIONID
;


}

detail

2.For tomcat

upstream backend 
{

    server 
192.168
.
0.100
 srun_id
=
a
;

    server 
192.168
.
0.101
 srun_id
=
b
;

    server 
192.168
.
0.102
 srun_id
=
c
;

    server 
192.168
.
0.103
 srun_id
=
d
;


    jvm_route $cookie_JSESSIONID reverse
;


}

detail

3. A simple jave test page

here

DIRECTIVES

jvm_route

syntax: jvm_route $cookie_COOKIE[ |session_url] [ reverse]
default: none
context: upstream
description:
'$cookie_SESSION_COOKIE' specifies the session cookie name(0.7.24+). 'session_url' specifies a different session name in the URL when the client does not accept a cookie. The session name is case-insensitive. In this module, if it does not find the session_url, it will use the session cookie name instead. So if the session name in cookie is the name with its in URL, you don't need give the session_url name.
With scanning this cookie, the module will send the request to right backend server. As far as I know, the resin's srun_id name is in the head of cookie. For example, requests with cookie value 'a* * * ' are always sent to the server with the srun_id of 'a'. But tomcat's JSESSIONID is opposite, which is like '* * * .a'. The parameter of 'reverse' specifies the cookie scanned from tail to head.
If the request fails to be sent to the chosen backend server, It will try another server with the Round-Robin mode until all the upstream servers tried. The directive proxy_next_upstream can specify in what cases the request will be transmitted to the next server. If you want to force the session sticky, you can set 'proxy_next_upstream off'.

server

Every syntax is the same with the official directive except the parameter of 'srun_id' which identified the backend JVM's name by cookie. The default srun_id's value is 'a';

NOTE

This is a third-party module. And you need careful test before using this module in your production environment.

Questions/patches may be directed to Weibin Yao, yaoweibin@gmail.com.

分享到:
评论

相关推荐

    nginx-upstream-jvm-route 和 nginx 对应版本,亲测可用

    此资源有两个文件,含 nginx-upstream-jvm-route 和 nginx 对应版本,都是tar.gz文件。 安装方法网上很多就不写了,亲测可用。 不用担心版本不匹配造成安装失败,再浪费积分去到处下载尝试的烦恼。 此资源有两个文件...

    nginx-upstream-jvm-route-1.15

    【标题】"nginx-upstream-jvm-route-1.15" 涉及的核心知识点是Nginx的upstream模块与JVM路由的整合,特别针对Nginx 1.15版本。这个项目旨在解决在配置Nginx时遇到的特定错误提示“nginx: [emerg] invalid parameter ...

    nginx-upstream-jvm-route-0.1.tar.gz

    "nginx-upstream-jvm-route-0.1.tar.gz"正是为了解决这个问题而设计的一个解决方案。 首先,让我们了解一下Nginx的Upstream模块。Upstream模块允许Nginx将接收到的请求转发到一组后端服务器,可以根据配置的策略...

    nginx-upstream-jvm-route-1.12.0.tar.gz

    nginx_upstream_jvm_route 是一个 Nginx 的扩展模块,用来实现基于 Cookie 的 Session Sticky 的功能。 安装方法(进入Nginx源码目录): #patch -p0 &lt; /path/to/this/directory/jvm_route.patch # ./configure -...

    nginx-upstream-jvm-route nginx共享Session

    标题 "nginx-upstream-jvm-route nginx共享Session" 涉及到的是在使用Nginx作为反向代理服务器时,如何实现多个Java应用服务器(通常指的是JVM实例)之间的Session共享。这通常在构建高可用性和负载均衡的Web服务...

    nginx-upstream-jvm-route-1.6.tar.gz

    nginx_upstream_jvm_route 是一个 Nginx 的扩展模块,用来实现基于 Cookie 的 Session Sticky 的功能。 安装方法(进入Nginx源码目录): #patch -p0 &lt; /path/to/this/directory/jvm_route.patch # ./configure -...

    nginx-upstream-manager.zip

    `nginx-upstream-manager.zip` 提供了一个开源项目,用于更方便地管理和操作 Nginx 的 upstream 配置。 这个项目的核心是 `upstream_manager.py` 脚本,它提供了对 Nginx upstream 集群进行增删改查等操作的能力。...

    linux下为nginx添加jvmroute模块的方法

    代码如下:cd /optwget ... /opt/nginx_upstream_jvm_route/jvm_route.patc

    北京-京东云测试环境NGINX端口对应表v1.0.xlsx

    北京-京东云测试环境NGINX端口对应表v1.0

    web-server-route.tar.gz

    在这个场景中,"web-server-route"的标题和描述暗示了我们讨论的是一个与Web服务器路由相关的项目,特别地,它与Golang编程语言有关。Golang,或Go语言,是由Google开发的一种静态类型、编译型的语言,因其并发处理...

    linux环境下通过nginx实现tomcat集群.pdf

    - `tar zxvf nginx-upstream-jvm-route-0.1.tar.gz` - `tar nginx-1.1.2.tar.gz` 3. 安装PCRE库: - `cd pcre-8.10` - `./configure && make && make install` 4. 应用Nginx的JVM-Remote补丁: - `cd nginx-...

    linux环境下通过nginx实现tomcat集群借鉴.pdf

    [root@localhost ~]# tar zxvf nginx-upstream-jvm-route-0.1.tar.gz [root@localhost ~]# tar nginx-1.1.2.tar.gz ``` 2. 安装Nginx并应用模块: ``` [root@localhost ~]# cd nginx-1.1.2 [root@localhost ~...

    linux nginx nginx_upstream_jvm_route

    linux nginx nginx_upstream_jvm_route

    nginx整合tomcat

    nginx-upstream-jvm-route-0.1.tar.gz #nginx会话记录的必须模块 (用于tomcat集群,单tomcat就直接忽略相关操作) pcre-8.10.tar.gz #包括 perl 兼容的正规表达式库 (shell&gt;rpm -qa|grep pcre 可以检查系统是否已...

    从零开始的Nginx详解(5)【Nginx-负载均衡】

    测试三、Nginx负载均衡算法四、Nginx相关文章链接 演示环境: 系统版本:CentOS Linux release 7.7.1908 (Core) nginx版本:nginx/1.16.1 当然讲解还是官方最棒:英语和俄语大佬请点击这里移步官网 一、负载均衡...

    linux安装nginx和tomcat

    svn checkout http://nginx-upstream-jvm-route.googlecode.com/svn/trunk/nginx-upstream-jvm-route-read-only cd nginx-1.2.8 patch -p0 &lt; ../nginx-upstream-jvm-route.tar.gz/jvm_route.patch useradd www ...

    nginx 升级为最新版 1.12.0

    如果你看到的是"nginx-upstream-jvm-route-master"这个文件名,这可能是指Nginx的一个特定模块或插件,用于实现与JVM应用服务器的智能路由。这个插件可能涉及负载均衡、故障转移和动态配置更新等功能。在升级Nginx后...

    nginx tomcat集群 session复制

    - 解压Nginx源码,应用Nginx-upstream-jvm-route的补丁,以支持与Java应用的交互。 - 配置、编译并安装Nginx。 ### 三、Nginx配置 编辑`/usr/local/nginx/etc/nginx.conf`配置文件,主要关注以下几点: - **...

Global site tag (gtag.js) - Google Analytics