If you have not set up the nginx environment, please refer to my previous blog
Nginx Load Balancing
Lab Environment
Win7: tomcat6 + jdk6 + memcached
Linux: vmware9 + Ubuntu + jdk6 + nginx + tomcat6 + memcached
First, install memcached in windows.
Memcached-1.2.6-win32-bin.zip, 64-bit can also
Install memcached.exe-D install as a Windows Service
Memcached.exe-d start
Configure the memcached port, HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Servi
detecting the Nginx process ID and then using the KILL command to force the kill process.Query Nginx Process:PS Aux|grep Nginx8.2.6 Restart Service:1. Stop and restart (recommended):Restarting the nginx is equivalent to stopping and starting the Stop command before executing the start command. As follows:./nginx-s quit./nginx2. Reload the configuration file:When the configuration file of Ngin x nginx.conf Modified, for the configuration to take effect need to restart Nginx, use-s reload do not
virtual IP from the upper IP addr, the instructions from taking over the service; switching speed quickly;After the Lord initiates the Keepalived service, the master binds the virtual IP, takes over the service;[[Email protected] keepalived]# IP addreth1: The NC command can scan whether the port is open:Scan on other machines, 11.100 and 11.101,11.110 80 ports open;#nc-Z-w2 192.168.11.110 80[Email protecte
"/>Or we modify the dir parameter modification.650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/76/41/wKiom1ZN5E-BlKU9AABxyOzJQvQ126.png "title=" Image.png "alt=" Wkiom1zn5e-blku9aabxyozjqvq126.png "/>Then execute this script![Email protected] ~]# sh/usr/local/sbin/lvs_dr.shSiocaddrt:file existsAfter the implementation of the problem, it is because we have just executed, opened the eth0:0 so we have to shut down the network and then open.Continue to modify Dir's configuration file:vim
About haproxy
Provides high availability, Server Load balancer, and proxy Based on TCP and HTTP applications, and supports Virtual Hosts. It is a free, fast, and reliable solution. Haproxy is especially suitable for websites with extremely high loads, which usually require session persistence or layer-7 processing. Haproxy runs on the current hardware and suppor
; # 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.
1. Like Apache, they are both HTTP server software and adopt Modular Design for function implementation. They all support common language interfaces. At the same time, they also support forward and reverse proxies, virtual hosts, and URL rewriting,CompressionTransmission, SSL encrypted transmission, and so on. However, in terms of execution efficiency, nginx processes faster and consumes less memory resources. In addition, nginx also supports fcgi, wh
Nginx configuration file:nginx安装目录/conf/nginx.confReload the configuration file./nginx -s reloadConfiguring a virtual HostOne server is a single virtual host server { listen 80;//监听端口 server_name localhost;//域名 location / { root html; index index.html index.htm; } }Reverse Proxy and load balancingupstrea
Ngigx + Tomcat configure static/dynamic separation, Server Load balancer, and ngigxtomcat
Since the company used Ngnix, I felt a little curious about Nginx, So I studied it.
My version used in windows is nginx-1.8.1:
1. Start Ngnix
Double-click nginx-1.8.1. nginx.exe in the folder. If two nginx processes exist in the task manager, the startup is successful!
2. Common Ngnix commands
Forced nginx-s stop Shutd
Resttemplate can be automatically configured to use the Ribbon. To create a load balancing resttemplate create a resttemplate @Bean and use the @loadbalanced qualifier.Warning: resttemplate beans are no longer created with automatic configuration. It must be created by a single application.@Configurationpublic class MyConfiguration { @LoadBalanced @Bean RestTemplate restTemplate() { return new RestTemplate(); }}public class MyClass
RestTemplateCan be automatically configured to use the Ribbon. Create RestTemplate RestTemplate @Bean and use qualifiers to create load balancing @LoadBalanced .Warning: Beans are no longer created through automatic configuration RestTemplate . It must be created by a single application.@Configuration Public classmyconfiguration {@LoadBalanced @Bean resttemplate resttemplate () {return Newresttemplate (); }} Public classMyClass {@AutowiredPrivaterest
Resttemplate can be automatically configured to use the Ribbon. To create a load balancing resttemplate create a resttemplate @Bean and use the @loadbalanced qualifier.Warning: resttemplate beans are no longer created with automatic configuration. It must be created by a single application.@Configurationpublic class MyConfiguration { @LoadBalanced @Bean RestTemplate restTemplate() { return new RestTemplate(); }}public class MyClass
Resttemplate can be automatically configured to use the Ribbon. To create a load balancing resttemplate create a resttemplate @Bean and use the @loadbalanced qualifier.Warning: resttemplate beans are no longer created with automatic configuration. It must be created by a single application.@Configurationpublic class MyConfiguration { @LoadBalanced @Bean RestTemplate restTemplate() { return new RestTemplate(); }}public class MyClass
Resttemplate can be automatically configured to use the Ribbon. To create a load balancing resttemplate create a resttemplate @Bean and use the @loadbalanced qualifier.Warning: resttemplate beans are no longer created with automatic configuration. It must be created by a single application.@Configurationpublic class MyConfiguration { @LoadBalanced @Bean RestTemplate restTemplate() { return new RestTemplate(); }}public class MyClass
RestTemplate can be automatically configured to use the Ribbon. Create RestTemplate RestTemplate @Bean and use @LoadBalanced qualifiers to create load balancing.
Warning
The bean is no longer created by automatic configuration RestTemplate . It must be created by a single application.
@Configurationpublic class MyConfiguration { @LoadBalanced @Bean RestTemplate restTemplate() { return new RestTemplat
/arp_ignoreecho 0 >/proc/sys/net/ipv4/conf/lo/arp_announceecho 0 >/proc/sys/net/ipv4/conf/all/arp_ignoreecho 0 >/proc/sys/net/ipv4/conf/all/arp_announce;;Status# Status of Lvs-dr Real server.Islothere= '/sbin/ifconfig lo:0 | grep $VIP 'Isrothere= ' Netstat-rn | grep "lo:0" | grep $VIP 'if [! "$islothere"-O! "Isrothere"];then# either the route or the lo:0 device# not found.echo "LVS-DR Real server Stopped."Elseecho "LVS-DR Real server Running."Fi;;*)# Invalid entry.echo "$0:usage: $ {start|status
Recently, the company had a project where users worried that a single machine could not afford the most users, and they required to use the application cluster. We designed the application cluster architecture based on the application situation.
The architecture diagram is as follows:
650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; margin: 0px; border-top: 0px; border-right: 0px "title =" logical architecture "border =" 0 "alt =" logical architecture "src =" http://www.bk
* Simulation (with a domain name to get different server corresponding) This domain name is simulated by modifying the local host fileModifies the IP address of the domain name specified by the host file. Host file location: C:\Windows\System32\drivers\etc* Brief introduction of reverse proxy concept: The reverse proxy server is a reference on the service side. Decide which server provides the service. * Reverse Proxyused here One virtual machine
Tags: mysqlDrbd+heartbeat + LVS + keepalived+ MySQLHardware: Master *: Install DRBD, Heartbeat,mysqlSlave*3: Installing MySQLKeep Alived Host * 2: Install LVS, keepalived (real server is slave)Application HostIP: Two master has an ha VIP1Two keepalived hosts have a LVS VIP2Write operation:Application Host (AS)->VIP1->DEV/DRBD (two master DRBD will synchronize in real time)MySQL copy operation:0) Start slave1) 3 Slave an I/O thread sends a request to VIP1, requesting master to send Binlog;2) Mast
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.