LVS+Keepalived高可用群集

基于51单片机扫地机器人(全套Proteus仿真+原理图+程序+说明书) (内含源程序代码,原理图,仿真,讲解视频,元件清单等,【精品】值得推荐!!!扫地机器人是以单片机为主控制器。通过单片机控制小车行驶、除尘、蜂鸣。扫地机器人使用双电机驱动,以提高整车运动的平稳性;在智能车进驶过程中,采用双超声波模块实现避障。 阅读详情


主DR 服务器: 192.168.80.10
备DR 服务器: 192.168.80.11
Web 服务器1: 192.168.80.100
Web 服务器2: 192.168.80.101
vip: 192.168.80.188
客户端:192.168.80.200

LVS 部署

配置负载调度器(主、备相同)

systemctl stop firewalld.service
setenforce 0

yum -y install ipvsadm
modprobe ip_vs
cat /proc/net/ip_vs

vim /etc/sysctl.conf
net.ipv4.ip_forward = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.ens33.send_redirects = 0

sysctl -p

vim /etc/sysconfig/network-scripts/ifcfg-ens33:0
DEVICE=ens33:0
ONBOOT=yes
IPADDR=192.168.101.188
NETMASK=255.255.255.255

service network restart 或 systemctl restart network
ifup ens33:0
ifconfig ens33:0

route add -host 192.168.101.188 dev ens33:0

ipvsadm-save > /etc/sysconfig/ipvsadm
systemctl start ipvsadm

ipvsadm -C
ipvsadm -A -t 192.168.101.188:80 -s rr
ipvsadm -a -t 192.168.101.188:80 -r 192.168.101.100:80 -g
ipvsadm -a -t 192.168.101.188:80 -r 192.168.101.101:80 -g
ipvsadm

ipvsadm -ln

配置节点服务器

systemctl stop firewalld
setenforce 0

yum -y install httpd
systemctl start httpd

                         192.168.101.100 
echo 'this is wolf web!' > /var/www/html/index.html

                         192.168.101.101 
echo 'this is ice web! ' > /var/www/html/index.html

vim /etc/sysconfig/network-scripts/ifcfg-lo:0
DEVICE=lo:0
ONBOOT=yes
IPADDR=192.168.101.188
NETMASK-255.255.255.255

service network restart 或 systemctl restart network
ifup lo:0
ifconfig lo:0
route add -host 192.168.101.188 dev lo:0

vim /etc/sysctl.conf

net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2

sysctl -p

配置keeplived(主、备DR服务器上都要设置)

yum -y install keepalived
cd /etc/keepalived/
cp keepalived.conf keepalived.conf.bak
vim keepalived.conf
......
global_defs {
#定义全局参数
第10行进行修改,邮件服务指向本地
    smtp_server 127.0.0.1
第12行进行修改,指定服务器(路由器)的名称,主备服务器名称须不同,主为IVS_01,备为IVS_02
    router_id LvS_01
}

vrrp_instance VI_1 {                #定义VRRP热备实例参数
第20行进行修改,指定热备状态,主为MASTER,备为BACKUP
    state MASTER
第21行进行修改,指定承载vip地址的物理接口
    interface ens33
第22行进行修改,指定虚拟路由器的ID号,每个热备组保持一致
    virtual_router _id 10
第23行进行修改,指定优先级,数值越大优先级越高,这里设置主为100,备为99
    priority 100
    advert_int 1                   #通告间隔秒数(心跳频率)
    authentication {               #定义认证信息,每个热备组保持一致
        auth_type PASS             #认证类型
第27行进行修改,指定验证密码,主备服务器保持一致
        auth_ pass abc123
	}
    virtual_ipaddress {            #指定群集vip地址
        192.168.101.188
    }
}
第36行进行修改,指定虚拟服务器地址(VIP)、端口,定义虚拟服务器和web服务器池参数
virtual_server 192.168.101.188 80 {
    delay loop 6                    #健康检查的间隔时间(秒)
    lb algo rr                      #指定调度算法,轮询(rr)
第39行进行修改,指定群集工作模式,直接路由(DR)
   lb_kind DR
   persistence_timeout 50          #连接保持时间(秒)
   protocol TCP                    #应用服务采用的是TCP协议
第43行进行修改,指定第一个web节点的地址、端口
   real_server 192.168.101.100 80 {
       weight 1                    #节点的权重
第45行进行删除,添加以下健康检查方式
       TCP_CHECK {
           connect_port 80         #添加检查的目标端口
           connect_timeout 3       #添加连接超时(秒)
           nb_get_retry 3          #添加重试次数
           delay_before_retry 4    #添加重试间隔
       }
   }
   
   real_server 192.168.101.101 80 {  #添加第二个web节点的地址、端口
       weight 1
       TCP_CHECK {
           connect_port 80
		   connect_timeout 3
		   nb get retry 3
		   delay _before_retry 4
       }
   }
##删除后面多余的配置##
}


systemctl start keepalived
ip addr show dev ens33            #查看虚拟网卡vip

测试验证

在客户端访问http://192.168.101.188/,默认网关指向192.168.101.188
再在主服务器禁用网卡后再测试, ifdown ens33:0

智慧矿山无人机空地一体化解决方案 未来,随着技术的不断进步和应用场景的不断拓展,智慧矿山无人机空地一体化解决方案将在矿业领域发挥更加重要的作用,为矿山的可持续发展提供更加有力的保障。该系统能够实现矿山的全方位、全天候监测与管理,提升矿山生产效率,降低安全风险,并为矿山的可持续发展提供有力支持。智慧矿山无人机空地一体化解决方案是当前矿业领域技术创新的重要方向,旨在通过集成无人机技术、物联网、大数据、人工智能等先进技术,实现矿山的智能化、高效化和安全化运营。在矿山爆破、挖掘等危险作业中,无人机可进行远程监控和指挥,降低人员安全风险。 阅读详情

相关推荐

简单搭建 可视化日志+链路追踪

JAVA 可视化日志、链路追踪、plumeLog、Tlog、Logback

qq_39535439的博客 1206

LVS + Keepalived 高可用群集

Keepalived 的官方网站位于 http://www.keepalived.org/,在非 LVS 群集环境中使用时,Keepalived 也可以作为热备软件使用。

2501_91350469的博客 2889

Cadence Allegro 17.2 PCB设计避坑指南:从焊盘制作到封装绘制的完整流程

本文详细解析了Cadence Allegro 17.2在PCB设计中的关键操作技巧,从焊盘制作到封装绘制的完整流程。通过0402电阻和2.54mm排针的实例,揭示新手常见错误及解决方案,包括焊盘参数设置、层类型区分和坐标输入规范,帮助工程师避免设计返工和生产事故。

weixin_28683391的博客 409

LVS + Keepalived高可用群集

Keepalived的官方网站位于http://www.keepalived.org/,本章将以YUM方式讲解Keepalived的安装、配置和使用过程。在非LVS群集不境中使用时,Keepalived也可以作为热备软件使用。

2502_91448199的博客 1315

模型算力需求估算

(Billion Parameters,简称B)和训练/推理的计算任务复杂度,结合硬件计算能力(例如每秒浮点运算次数,FLOPS)来估算。以下是详细的方法和公式说明,以及实际的计算示例。算力需求的估算依赖于参数量、模型架构及硬件性能,结合训练/推理场景的特定要求来计算。通过上述公式和示例,我们可以定量分析不同任务的算力需求,并合理配置硬件资源以优化运行效率。结论:推理任务相对较轻,单台H100可以在30秒内完成此任务。推理算力需求一般远低于训练,因为只需要执行前向传播。,可以将训练时间缩短到约。

形上得其象,形下合于数;阴阳自济,玄理自明。 8962

Scratch 3.0角色控制避坑指南:为什么你的键盘移动总卡顿?

本文深入剖析了Scratch 3.0中角色移动卡顿的根本原因,指出依赖`当按下`事件积木的局限性。通过对比分析,推荐采用`重复执行`结合`如果<键被按下?>`的循环控制方案,并引入速度变量模拟惯性,从而实现流畅、实时的键盘控制优化,显著提升游戏操作体验。

dd012的博客 1015

LVS+Keepalived 高可用群集

在一个LVS服务集群中通常有主服务器(MASTER)和备份服务器(BACKUP)两种角色的服务器,但是对外表现为一个虚拟IP(VIP),主服务器会发送VRRP通告信息给备份服务器,当备份服务器收不到VRRP消息的时候,即主服务器异常的时候,备份服务器就会接管虚拟IP,继续提供服务,从而保证了高可用性。判断LVS负载调度器、节点服务器的可用性,当master主机出现故障及时切换到backup节点保证业务正常,当 master 故障主机恢复后将其重新加入群集并且业务重新切换回 master 节点。

Axic123的博客 506

Ubuntu20.04安全重启后WiFi图标消失?MT7922网卡驱动修复全攻略

本文详细解析了Ubuntu20.04安全重启后WiFi图标消失的问题,特别是针对MT7922网卡驱动失效的情况。通过诊断命令和分步解决方案,包括禁用PCIe ASPM、更新无线固件和升级HWE内核,帮助用户快速恢复网络连接。文章还提供了进阶排查技巧和系统优化建议,确保WiFi稳定运行。

weixin_29202687的博客 370

lvs-keepalived高可用群集

Keepalived 起初是专门针对 LVS 设计的一款强大的辅助工具,主要用来提供故障切换(Failover)和健康检查(Health Checking)功能-一判断 LVS 负载调度器、节点服务器的可用性,当master 主机出现故障及时切换到 backup节点保证业务正常,当 master 故障主机恢复后将其重新加入群集并且业务重新切换回 master 节点。

2401_84242106的博客 1233

23、电生理与CSD分析:探索大脑活动的前沿技术

本文介绍了电生理与电流源密度(CSD)分析在探索大脑活动中的前沿应用。从电生理技术的发展现状,到局部场电位(LFPs)的起源与解释,重点阐述了CSD分析的原理、实验方法及其在绘制皮层兴奋流、解析突触输入和研究自发振荡中的广泛应用。文章还总结了该领域的优势与挑战,并展望了技术改进、多模态融合、数据分析创新及临床拓展的未来方向,展示了这些技术在揭示大脑功能机制中的关键作用。

Apple的专栏 123

100天精通Python(可视化篇)——第98天:Pyecharts绘制多种炫酷日历图参数说明+代码实战

一、日历图介绍 二、基础配置 1. 配置项类 2. 添加函数 3. 日期标签配置 4. 坐标系配置 三、日历图实战 1. 基础日历图 2. 日历热图

努力让自己发光,对的人才能迎着光而来 2万+

LVS +Keepalived高可用群集

本节将以 DR 模式的 LVS 群集为基础,增加一台从负载调度器,使用Keepalived 来实现主、从调度器的热备,从而构建兼有负载均衡、高可用两种能力的 LVS 网站群集平台,如图 3.3 所示。基于 VRRP 的热备方式,Keepalived 可以用作服务器的故障切换,每个热备组可以有 多台服务器--当然,最常用的就是双机热备了。从调度器的配置与主调度器基本相同,也包括全局配置、热备配置、服务器池配置,只需要调整 router id、state、priority 参数即可,其余内容完全相同。

lz007_的博客 803

UE5 Niagara基础知识讲解

在UE5版本中,Niagara粒子系统引入了许多可添加的模块,分别用于控制发射器的生成和更新、粒子的生成和更新以及渲染效果。本文采用虚幻5.2.1版本,以图文方式对Niagara基础知识进行讲解。

一碗清深的博客 2472

lvs+keepalived高可用群集

Keepalived的官方网站位于http://www.keepalived.org/,本i章将以YUM方式讲解Keepalived的安装、配置和使用过程。在非LVS群集环境中使用时Keepalived也可以作为热备软件使用。

2401_84100398的博客 1431

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

LVS-DR+Keepalived 高可用群集部署

主负载调度器会发送VRRP通告信息给备份负载调度器,当主负载调度器异常时,备份负载调度器收不到主负载调度器发送的 VRRP 消息,即认定主负载调度器异常,备份负载调度器就会接管虚拟IP,继续提供服务,从而保证了服务的高可用性。在一个LVS服务集群中通常有两种角色的负载调度器,主负载调度器(MASTER)和备份负载调度器(BACKUP),但是对外表现为一个虚拟 IP(VIP)。抢占模式:keepalived 的默认模式,MASTER节点从故障中恢复后,会将 VIP 从 BACKUP 节点中抢占过来。

m0_67475830的博客 1342

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

3.LVS+Keepalived高可用群集

Keepalived 采用 VRRP(Virtual Router Redundancy Protocol,虚拟路由冗余协议)热备份协议,以软件的方式实现Linux 服务器的多机热备功能。VRRP是针对路由器的一种备份解决方案--由多台路由器组成一个热备组,通过共用的虚拟IP地址对外提供服务;每个热备组内同一时刻只有一台主路由器提供服务,其他路由器处于冗余状态。若当前在线的路由器失效,则其他路由器会自动接替(优先级决定接替顺序)虚拟IP地址,以继续提供服务。

lml4856的博客 937

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

上一篇: DR模式LVS负载均衡群集
下一篇: MysQL超变身!MysQL日志管理、备份与恢复
Alterego_
博客等级 码龄6年 14粉丝 45原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值