Under Linux nginx Tomcat load Balancing is based on Nginx-sticky-module for session stickiness __linux

Source: Internet
Author: User

Version information:

The linux:red Hat Enterprise Linux Server>nginx_upstream_jvm_route is a nginx extension module that implements the function of the Cookie-based session Sticky ( Written by the Chinese).

Principle of Jvm_route (from author Weibin Yao): 1. At the beginning of the request came, without the session information, Jvm_route on the basis of round>

--with-pcre configures the Pcre library, which is the basis for implementing regular expressions, and Nginx cannot support URL rewriting in HTTP if this library is missing

--with-openssl

--with-zlib

--add-module Add the path to the JVM module

PS: First make mistakes is unavoidable, I made nearly one weeks ah, I suspect that my IQ, in general, to see more on the Internet to try, and so successful after looking back to find that much simpler. After the installation of the configuration and others say, according to their own requirements to configure and optimize the line.

2.http://wiki.nginx.org the Nginx_sticky_module module above.

Focus on this module, this module is the program I adopted.


in the Http://wiki.nginx.org/3rdPartyModules under the known>

Click to see his English instructions, very simple should be able to understand. Select Downloads column download.


Required Tar pack nginx1.5.8> considerations

nginx-1.5.x and nginx-sticky-module-1.1 compile will have a problem, should be nginx the new version has no corresponding nginx-sticky-module, the solution is to put NGINX-STICKY-MODULE-1.1/ NGX_HTTP_STICKY_MISC.C's 281 lines are modified to:

Digest->len = Ngx_sock_ntop (in,sizeof (struct sockaddr_in), Digest->data, Len, 1);


give a reference to it: http://my.oschina.net/766/blog/156693

This is a little simpler than the last process.

Problems encountered in the actual process:

1. Initially thought that Nginx can be configured like Apache, the results are found to be compiled.

http://wiki.nginx.org/Modules

Nginx modules must be selected during compile, Run-time selection to modules is not currently supported. 2. The compiler needs some auxiliary programs, which should be checked and downloaded by yourself.

3. Some people add users and user groups when they are in the./configure, I started with root, this step did not user settings, nginx.conf in the "#user >http://my.oschina.net/u/ 878259/blog/172491

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.