allocation#========loadbalancer, Load Balancer controller ========Worker.loadbalancer.type=lb#请求失败以后重试次数Worker.loadbalancer.retries=3#controller控制的tomcat的名称, TOMCAT1 and TOMCAT2 respectively, set by Server.xml in TomcatWorker.loadbalancer.balance_workers=tomcat1,tomcat2,tomcat3#回话是否有粘性, false means no stickiness, and the same reply request will be processed in different tomcatWorker.loadbalancer.sticky_ses
: This article mainly introduces several methods for nginx server load balancer to process session sharing. For more information about PHP tutorials, see.
1) use cookie instead of sessionBy changing the session into a cookie, you can avoid some drawbacks of the session. in a previously read J2EE book, it also indicates that the session cannot be used in the cluster system, otherwise, it will be difficult to
follows:# cp/usr/local/tomcat/webapps/root/web-inf/web.xml/web/webapps/web-inf/# Vim/web/webapps/web-inf/web.xml #添加下面这一行, in Add multicast routing addresses for each Tomcat node (two Tomcat hosts to configure):Route add-net 228.0.1.7 netmask 255.255.255.255 Dev eth0Restart the Tomcat service# Service Tomcat stop# service Tomcat startThe access tests are as follows:650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/88/75/wKiom1f4gY7jT5pZAAEW7
;Include/opt/nginx/conf/proxy. conf;}}In the above configuration instance, a server load balancer group myserver is defined first, and then the "proxy_pass http: // myserver" function is implemented in the location section, the proxy_pass command specifies the proxy's backend server address and port. The address can be the host name or IP address, or the server load
, transfers the request evenly to the different server execution, and the scheduler automatically shields off the server's failure, thereby forming a set of servers into a high-performance, highly available virtual server. The structure of the entire server cluster is transparent to the customer and eliminates the need to modify client and server-side programs. To do this, you need to consider system transparency, scalability, high availability, and manageability at design time.Cluster structure
an administrator and execute the following command:netsh interface IPv4 set interface "Real node NIC name" Weakhostreceive=enablednetsh interface IPv4 set interface "Real node nic name" Weakhosts End=enablednetsh interface IPv4 set interface "Real node loopback network card name" Weakhostreceive=enablednetsh interface IPv4 set interface "Real
is located
Run the Redis-server.exe redis.windows.conf command to start the redis Database
Redis Setup Password
Opening:redis.windows.conf file
Ctrl+f looking for requirepass
Cancel the previous # sign and set your own password
Tomcat configuration Session sharing
1: Copy the required jar package to the Tomcat server lib directory
2: Configure conf directory under context.xml
Host= "127.0.0.1"
Port= "6379"
password= "Root"
database= "0"
Maxinactiveinterval= "/>"
Host: point to the IP
] ~]# systemctl start Ipvsadm.service #在centos7上面直接启动会有一个报错没有保存ob for Ipvsadm service failed because the control process EXITD with error code. See "Systemctl Start Ipvsadm.service" and "Journalctl-xe" for details[[emailprotected] ~]# ipvsadm--save >/et C/sysconfig/ipvsadm #开启管理工具时把规则做保存 (unique and 6 differences) [[emailprotected] ~]# systemctl start ipvsadm.service [email protected] ~]# systemctl status Ipvsadm.service #查看状态显示绿色证明开启成功 [[emailprotected] opt]# vim net.sh # Scripting iptables fir
Cookie $http _cookie;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for; Proxy_set_header X-forwarded-proto $scheme;
Client_max_body_size 100m; }
Reference Document: Nginx Load balancer Several usages of the session sticky post based on Ip_hash -7. Test A. Test auto-SwitchTo access the Nginx server represent
line.(1) Add Nginx storage, add Epel repositorysudo yum install epel-release(2) Check if Nginx has been installedFind-name Nginx(3) If there is an installation then deleteYum Remove Nginx(4) Installing Nginxsudo yum install Nginx(5) Start Nginxsudo systemctl start Nginxsudo systemctl enable Nginx #可用(6) Set Nginx to start the system automatically start Nginxecho "/usr/local/nginx/sbin/nginx" >>/etc/rc.local(7) View the native IP for subsequent configuration of nginx.confIfconfig(8) Modify the n
, there are also real-time static content, the Mop-like hodgedge and Netease community use such strategies.Category 3: The content changes in real time and is very personalized. For example, for mailbox applications, the content provided by such services cannot be static and can only be optimized through regional deployment and load balancing.For the vendors that provide cdn services, static content cdn is naturally no problem. For the third type of s
balancer group name set through the upstream command. Proxy_next_upstream is used to define a Failover policy. When the backend service node returns errors such as 500, 502, 503, 504, and execution timeout, the request is automatically forwarded to another server in the upstream load balancing group, implement failover. Finally, the include command contains a pr
With load balancing, modify the configuration HTTP node as follows:#设定http服务器, using its reverse proxy function to provide load balancer support http{ #设定mime类型, type defined by Mime.type file include/etc/nginx/ mime.types;default_typeapplication/octet-stream; #设定日志格式 access_log/var/log/ nginx/access.log; #省略上文有的一些配置
folder under the apache installation directory.
The configuration is as follows:
Purpose: configure the working tomcat node.3.2tomcat Configuration
(1) Copy two tomcat servers
(2) modify the server. xml file in the conf folder under the tomcat installation directory as follows:
The jvmRoute and worker. properities files are configured with the same name.
Tomcat1 configuration is the same as tomcat2 configuration.
4. Test
Create a folder under the
the value of the sqlconnectionstring at the same time, in the format:sqlconnectionstring= "Data source=localhost; Integrated Security=sspi; "Where data source refers to the IP address of the SQL Server server, if SQL Server and IIS are a machine, write 127.0.0.1. Integrated SECURITY=SSPI means that Windows Integrated authentication is used, so that access to the database is made as an ASP, and by this configuration, SQL can be obtained that is more than using the userid=sa;password= password Be
Linux load Balancer software LVS II (Installation article)2011-04-26 16:01:47Tags: LVS installation configuration Linux LVS Leisure Linux high AvailabilityOriginal works, allow reprint, please be sure to use hyperlinks in the form of the original source of the article, author information and this statement. Otherwise, the legal liability will be investigated. http://ixdba.blog.51cto.com/2895551/554029First,
Apache Load Balancer Session sticker configuration (JK mode)
In the work, because other products and Apache reverse proxy mode of work is not very good, so need to put Apache and Application Server (TOMCAT) co-configuration of a long MOD_JK mode of the session paste pattern, in the configuration process, or encountered some problems, mainly forget to modify Tomcat The name of the Jvmroute in/conf/server.xml
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.