Comprehensive learning Springboot+dubbo+zookeeper, combined with the usual framework, the common framework for the integration of a bit, from the frame to the background to the front, if there is infringement, please contact delete.
Background frame Springboot+mybatis+dubbo+zookeeper+redis+nginx, which redis do data caching, Nginx do page forwarding, database with MySQL. First, the Springboot-mybatis-dubbo-zookeeper directory schema is as follows:
The Pom files for the first project's outer de
server,b machine to install SSH client. If a failure occurs during use. To restart the SSH server:sudo service ssh restartTest useOperation command:ssh-l username HostIPssh : command- l : option is the letter "L", not the number "1"username: User name for Telnethostip: The IP address that was TelnetTo view the IP that is remotely remote:telnet (Here is the user Wencong (A machine) remote login edu (B machine)). Ability to use sudo:SSH informs the use
system is integrated, we only need to map the node that needs to register the module in the dependency tree with the module implementation file.External module IntegrationPrivate Module Integration Extracting System configuration Information Rule Configuration Example rules:{rewrite:{' 404 ': '/m/blog/list/', '/m/blog/list/': '/m/blog/', '/m/setting/account/': '/m/set ting/'}, title:{'/m/blog/tag/': ' Log tag ', '/m/blog/list/': ' Log list ', '/m/setting/permission/': ' Rights Management ', '
:-c options[Email protected] ~]# useradd-c oldboy,15810516499, Hebei agan2[Email protected] ~]# grep-w "Agan2"/etc/passwdagan2:x:506:506:oldboy,15810516499, Hebei:/home/agan2:/bin/bashNote: While creating a user, add the agan2 user's personal information, and personal information is separated by commas.Example 4:-u options[Email protected] ~]# useradd-u 888 agan3[Email protected] ~]# grep-w "AGAN3"/etc/passwdAgan3:x:888:888::/home/agan3:/bin/bashNote: While creating a user, modify the user's def
scheduler allocates requests based on the actual connection of the backend real servers①.LC: Minimum Link (Least Connections)The scheduler dynamically dispatches network requests to the server with the fewest number of links established through the "least connection" scheduling algorithm. If the real server of the cluster system has similar system performance, the "Minimum connection" scheduling algorithm can be used to balance the load well.②.WLC: W
hash scheduling algorithm.In the actual application, the source address hash schedule and the target address hash schedule can be used together in the firewall cluster, they can guarantee the unique entrance of the whole system. 9, shortest expected delay (shortest expected delay scheduling) abbreviation SED based on the WLC algorithm, illustrateABC three machines weigh 123 respectively, and the number of connections is 123,name if you use the
LVS scheduling algorithm (scheduling method) A total of 10 kindsone, static method: Only according to the algorithm itself scheduling1. RR (Round Robin): Polling2. WRR (werghted Round Robin): Weighted polling3, SH (source Hashing): Source Address Hash4, DH (DH): Target Address HashIi. Dynamic Method: Based on the algorithm and the current load status of Rs1, LC (Least Connection): Minimum connectionAlgorithm: overhead=active*256+inactiveOverhead: Minimum loadActive: Active ConnectionInactive: In
of connections is +1Its connection aborted or timed out, its number of connections-1. When the server weight is 0 o'clock, it indicates that the server is unavailable and is not scheduledSimple algorithm: active*256+inactive (whichever is small)(2) WLC (Weighted least-connection scheduing): Weighted minimum connection. The weighted minimum connection scheduling algorithm is the minimum connection scheduling algorithm, and each server uses correspondi
of the peer heartbeat interfaceBcast eth1 // Nic that broadcasts heartbeat informationAuto_failback on // Default settingsNode node1.a.com // Configure the director master node, which is consistent with uname-n.Node node2.a.com // Configure the director backup node3. configure the director script# Vim/etc/init. d/ipvs#! /Bin/bash## LVS script for VS/DR#./Etc/rc. d/init. d/functionsVIP = 172.16.4.1RIP1 = 192.168.0.50RIP2 = 192.168.0.60PORT = 80Case "$1" inStart)Echo "start LVS"/Sbin/ifconfig eth
algorithm.
There are two load balancing algorithms:Weighted round robin (WRR) and Weighted least connections (WLC ),WRR uses the Weighted Round robin algorithm to allocate connections. WLC assigns the next connection to a server with fewer active connections through a certain weight value.
2) SLB ConfigurationThe configuration is divided into two parts,The first part is to use the slb serverfarm serverfarm
Public IP address.
203. x. x. B is the IP address of the domain name for Loadbance.
203. x. x. c is the first RealServer.
203. x. x. d is the second RealServer.
# Cat/etc/sysconfig/ha/lvs. cf
Serial_no = 45
Primary = 203. x. x.
Service = lvs
Rsh_command = ssh
Backup_active = 0
Backup = 0.0.0.0
Heartbeat = 1
Heartbeat_port = 539
Keepalive = 10
Deadtime = 20
Network = direct (change the Tunl mode to tunnel)
Nat_nmask = 255.255.255.255.255
Reserva
-- udp-serviceservice-address indicates that the virtual server provides udp services.[Vip: port] or [real-server-ip: port]-F -- fwmark-servicefwmark indicates the service type marked by iptables.-S -- the scheduling algorithm used by schedulerscheduler, which has the following options:Rr | wrr | lc | wlc | lblc | lblcr | dh | sh | sed | nq,The default scheduling algorithm is: wlc.-P -- persistent [timeout
connection, weighted minimum connectionOverhead= (active*256+inactive)/weight, small calculation results will be selected for next hop RS ServerDisadvantage: When the overhead is the same, the top-down poll response, the weight is small if the above the list will respond(3) Sed:shortest expection delay, shortest expected delayOverhead= (active+1) *256/weightCons: Troubleshoot WLC issues, but cannot ensure that hosts with small weights must respond(4)
network segment, and for private network IP, VIP for external service ip,director, Real server Set VIP LVS Scheduling algorithm: Round call scheduling (Round Robin) (abbreviated RR), weighted round call (Weighted Round Robin) (WRR), least link (least connection) (LC), weighted least link (Weighted least Connections) (WLC) and so on (other algorithms, reference http://www.aminglinux.com/bbs/thread-7407-1-1.html) 2. Lvs/nat Configuration Three servers
the check
Keepalived's LVS configuration The LVS section is configured with "Virtual_server" as the starting mark, which consists of two parts, namely the Real_server segment and the Health detection section. Here is a sample configuration of the common options for the Virtual_server segment: Virtual_server 192.168.12.200 80 { Delay_loop 6 Lb_algo RR Lb_kind DR Persistence_timeout 50 Persistence_granularity Protocol TCP Ha_suspend VirtualHost Sorry_server Virtual_server: Set the star
theLetter3, each internal RS node gateway address, must be configured as the scheduler lb private LAN within the physical network card address。。。Omitted####################### #IPVS调度器实现了如下十种负载调度算法: LVs scheduling algorithm10 Kinds of scheduling algorithmsFixed scheduling algorithm: Rr,wrr,dh,shDynamic scheduling algorithm: Wlc,lc,lblc,lblcr,sed,nq.Three most commonly used RR WRR WLC10 scheduling algorithms are shown in the following table:RR: Pollin
also use the vrrp feature of keepalived.-- Stop-daemon: Stop synchronization daemon-H -- help: displays help information.
Other options: -T -- TCP-Service-Address indicates that the virtual server provides the TCP Service [VIP: Port] or [real-server-IP: Port]. -U -- UDP-Service-Address indicates that the virtual server provides the UDP Service [VIP: Port] or [real-server-IP: Port]. -F -- fwmark-service fwmark indicates the service type marked by iptables. -S -- scheduler SchedulingAlgorith
-d Delete Virtual Service--clear-c Clear the whole table--restore-r Restore rules from stdin--save-s Save rules to stdout--add-server-a add real server with options--EDIT-SERVER-E edit Real Server with options--delete-server-d Delete Real Server--list-l|-l List the table--zero-z Zero counters in a service or all services--set TCP tcpfin UDP set connection timeout values--start-daemon Start Connection Sync daemon--stop-daemon Stop Connection Sync daemon--help-h Display this Help messageOptions:--
order of distribution, such as a weight of 2, gives the server 2 access requests, and then sends the access request to the step-down server.
Source Address hash (source Hashing) : Sh. A hash table is recorded with the source address of the access and the address of the server being distributed, and LVS sends the request to the corresponding server when the source address is accessed after the connection is disconnected, because it affects the equalization effect very rarely.
Destination
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.