Keepalived实现LVS高可用

6.1 Keepalived+LVS集群介绍

  • Keepalived和LVS共同构建了一个高效的负载均衡和高可用性解决方案:LVS作为负载均衡器,负责在集群中的多个服务器间分配流量,以其高性能和可扩展性确保应用程序能够处理大量的并发请求;而Keepalived则作为高可用性保证,通过VRRP协议监控LVS服务的状态并在主服务器发生故障时自动进行故障转移,确保服务的持续可用性和无感知切换。这种结合利用了两者的优势,为关键的网络服务提供了一个稳定、可靠且高效的运行环境。

image-20240506100440332

机器名称IP地址子网掩码说明
Keepalived-01192.168.110.31255.255.255.0负载均衡+高可用
Keepalived-02192.168.110.32255.255.255.0负载均衡+高可用
RS1192.168.110.33255.255.255.0真实服务器1
RS2192.168.110.34255.255.255.0真实服务器2
Client192.168.110.35255.255.255.0客户端

6.2 后端RS配置

  • 配置系统服务脚本

[root@LVS-RS1 ~]# vim /etc/init.d/LVS_RS
#!/bin/bash
​
# Startup script to handle the initialisation of LVS
# chkconfig: - 28 72
# description: Initialise the Linux Virtual Server for DR
# Provides: ipvsadm
# Required-Start: $local_fs $network $named
# Required-Stop: $local_fs $remote_fs $network
# Short-Description: Initialise the Linux Virtual Server
# Description: The Linux Virtual Server is a highly scalable and highly
# available server built on a cluster of real servers, with the load
# balancer running on Linux.LOCK=/var/lock/ipvsadm.lock
VIP=192.168.110.10
​
. /etc/rc.d/init.d/functions
​
start() {PID=`ifconfig | grep lo:20 | wc -l`if [ $PID -ne 0 ]; thenecho "The LVS-DR-RIP Server is already running !"else/sbin/ifconfig lo:20 $VIP netmask 255.255.255.255 broadcast $VIP up/sbin/route add -host $VIP dev lo:20echo "1" >/proc/sys/net/ipv4/conf/lo/arp_ignoreecho "2" >/proc/sys/net/ipv4/conf/lo/arp_announceecho "1" >/proc/sys/net/ipv4/conf/all/arp_ignoreecho "2" >/proc/sys/net/ipv4/conf/all/arp_announce/bin/touch $LOCKecho "starting LVS-DR-RIP server is ok !"fi
}
​
stop() {/sbin/route del -host $VIP dev lo:20/sbin/ifconfig lo:20 down >/dev/nullecho "0" >/proc/sys/net/ipv4/conf/lo/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_announcerm -rf $LOCKecho "stopping LVS-DR-RIP server is ok !"
}
​
status() {if [ -e $LOCK ]; thenecho "The LVS-DR-RIP Server is already running !"elseecho "The LVS-DR-RIP Server is not running !"fi
}
​
case "$1" instart)start;;stop)stop;;restart)stopstart;;status)status;;*)echo "Usage: $1 {start|stop|restart|status}"exit 1
esac
exit 0
​
[root@LVS-RS1 ~]# chmod +x /etc/init.d/LVS_RS 
[root@LVS-RS1 ~]# chkconfig --add LVS_RS 
[root@LVS-RS1 ~]# systemctl start LVS_RS.service 
[root@LVS-RS1 ~]# scp /etc/init.d/LVS_RS 192.168.110.34:/etc/init.d/   #发给另一台RS
​
[root@LVS-RS2 ~]# chmod +x /etc/init.d/LVS_RS 
[root@LVS-RS2 ~]# chkconfig --add LVS_RS 
[root@LVS-RS2 ~]# systemctl start LVS_RS.service 

6.3 Keepalived配置

6.3.1 基于TCP的健康检测

6.3.1.1 Keepalived-01配置
[root@Keepalived-01 ~]# cp /etc/keepalived/keepalived.conf{,.bak}
[root@Keepalived-01 ~]# vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived
​
global_defs {router_id LVS_node1
}
​
vrrp_instance LVS {state MASTERinterface ens160virtual_router_id 51priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.110.10}
}
​
virtual_server 192.168.110.10 80 {delay_loop 6  lb_algo rrlb_kind DRprotocol TCP
​real_server 192.168.110.33 80 {weight 1TCP_CHECK {connect_timeout 3retry 3delay_before_retry 3connect_port 80}}real_server 192.168.110.34 80 {weight 1TCP_CHECK {connect_timeout 3retry 3delay_before_retry 3connect_port 80}}
}
​
​
[root@Keepalived-01 ~]# systemctl start keepalived.service
[root@Keepalived-01 ~]# ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.110.10:80 rr-> 192.168.110.33:80            Route   1      0          0         -> 192.168.110.34:80            Route   1      0          0 
6.3.1.2 Keepalived-02配置
[root@Keepalived-02 ~]# cp /etc/keepalived/keepalived.conf{,.bak}
[root@Keepalived-02 ~]# vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived
​
global_defs {router_id LVS_node2
}
​
vrrp_instance LVS {state MASTERinterface ens160virtual_router_id 51priority 80advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.110.10}
}
​
virtual_server 192.168.110.10 80 {delay_loop 6  lb_algo rrlb_kind DRprotocol TCP
​real_server 192.168.110.33 80 {weight 1TCP_CHECK {connect_timeout 3retry 3delay_before_retry 3connect_port 80}}real_server 192.168.110.34 80 {weight 1TCP_CHECK {connect_timeout 3retry 3delay_before_retry 3connect_port 80}}
}
​
[root@Keepalived-02 ~]# systemctl start keepalived.service
[root@Keepalived-02 ~]# ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.110.10:80 rr-> 192.168.110.33:80            Route   1      0          0         -> 192.168.110.34:80            Route   1      0          0         
6.3.1.3 访问测试
[root@Client ~]# for ((i=1;i<=6;i++)); do curl http://192.168.110.10; done
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.33  Host=LVS-RS1
6.3.1.4 模拟故障转移
[root@Keepalived-01 ~]# systemctl stop keepalived.service
​
[root@Keepalived-02 ~]# ip address show ens160   #VIP漂移到Keepalived-02
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether 00:0c:29:b0:0d:30 brd ff:ff:ff:ff:ff:ffaltname enp3s0inet 192.168.110.32/24 brd 192.168.110.255 scope global noprefixroute ens160valid_lft forever preferred_lft foreverinet 192.168.110.10/32 scope global ens160valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:feb0:d30/64 scope link noprefixroute valid_lft forever preferred_lft forever
​
[root@Client ~]# for ((i=1;i<=6;i++)); do curl http://192.168.110.10; done  #访问正常
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
​
[root@Keepalived-01 ~]# systemctl start keepalived.service
[root@Keepalived-01 ~]# ip address show ens160     #恢复后回来
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether 00:0c:29:d1:a9:eb brd ff:ff:ff:ff:ff:ffaltname enp3s0inet 192.168.110.31/24 brd 192.168.110.255 scope global noprefixroute ens160valid_lft forever preferred_lft foreverinet 192.168.110.10/32 scope global ens160valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fed1:a9eb/64 scope link noprefixroute valid_lft forever preferred_lft forever
6.3.1.5 后端服务器故障
[root@LVS-RS1 ~]# systemctl stop nginx.service
​
[root@Keepalived-02 ~]# ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.110.10:80 rr-> 192.168.110.34:80            Route   1      0          9   [root@Client ~]# for ((i=1;i<=6;i++)); do curl http://192.168.110.10; done    #访问正常
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2

6.3.2 基于HTTP的健康检测

6.3.2.1 生成远程网页的MD5哈希值
  • genhash 是一个命令行工具,用于生成远程网页的MD5哈希值。它可以用于监控HTTP和HTTPS服务,特别是在Keepalived配置中,用于健康检查。genhash 可以通过HTTP或HTTPS连接到网页,并生成页面数据的MD5哈希值,该哈希值可以在Keepalived配置文件中使用。

[root@Keepalived-01 ~]# genhash -s 192.168.110.33 -p 80 -u /index.html
MD5SUM = fd0508d1ccc6c66c14977e54ffc7faef
​
[root@Keepalived-01 ~]# genhash -s 192.168.110.34 -p 80 -u /index.html
MD5SUM = 0632aaa5fb77608b1a4736d47aacb62c
​
[root@Keepalived-02 ~]# genhash -s 192.168.110.33 -p 80 -u /index.html
MD5SUM = fd0508d1ccc6c66c14977e54ffc7faef
​
[root@Keepalived-02 ~]# genhash -s 192.168.110.34 -p 80 -u /index.html
MD5SUM = 0632aaa5fb77608b1a4736d47aacb62c
6.3.2.2 Keepalived-01配置
[root@Keepalived-01 ~]# vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived
​
global_defs {router_id LVS_node1
}
​
vrrp_instance LVS {state MASTERinterface ens160virtual_router_id 51priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.110.10}
}
virtual_server 192.168.110.10 80 {delay_loop 6  lb_algo rrlb_kind DRprotocol TCP
​real_server 192.168.110.33 80 {weight 1
​HTTP_GET {url {path /index.htmldigest fd0508d1ccc6c66c14977e54ffc7faef}connect_timeout 3nb_get_retry 3delay_before_retry 3}}real_server 192.168.110.34 80 {weight 1HTTP_GET {url {path /index.htmldigest 0632aaa5fb77608b1a4736d47aacb62c
​}connect_timeout 3nb_get_retry 3delay_before_retry 3}}
}
​
[root@Keepalived-01 ~]# systemctl start keepalived.service
[root@Keepalived-01 ~]# ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.110.10:80 rr-> 192.168.110.33:80            Route   1      0          0         -> 192.168.110.34:80            Route   1      0          0     
6.3.2.3 Keepalived-02配置
[root@Keepalived-02 ~]# vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived
​
global_defs {router_id LVS_node2
}
​
vrrp_instance LVS {state MASTERinterface ens160virtual_router_id 51priority 80advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.110.10}
}
virtual_server 192.168.110.10 80 {delay_loop 6  lb_algo rrlb_kind DRprotocol TCP
​real_server 192.168.110.34 80 {weight 1
​HTTP_GET {url {path /index.htmldigest fd0508d1ccc6c66c14977e54ffc7faef}connect_timeout 3nb_get_retry 3delay_before_retry 3}}real_server 192.168.110.34 80 {weight 1HTTP_GET {url {path /index.htmldigest 0632aaa5fb77608b1a4736d47aacb62c
​}connect_timeout 3nb_get_retry 3delay_before_retry 3}}
}
​
​
[root@Keepalived-02 ~]# systemctl start keepalived.service
[root@Keepalived-02 ~]# ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.110.10:80 rr-> 192.168.110.33:80            Route   1      0          0         -> 192.168.110.34:80            Route   1      0          0     
6.3.2.4 访问测试
[root@Client ~]# for ((i=1;i<=6;i++)); do curl http://192.168.110.10; done
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
6.3.2.5 模拟故障转移
[root@Keepalived-01 ~]# systemctl stop keepalived.service
​
[root@Keepalived-02 ~]# ip address show ens160   #VIP漂移到Keepalived-02
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether 00:0c:29:b0:0d:30 brd ff:ff:ff:ff:ff:ffaltname enp3s0inet 192.168.110.32/24 brd 192.168.110.255 scope global noprefixroute ens160valid_lft forever preferred_lft foreverinet 192.168.110.10/32 scope global ens160valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:feb0:d30/64 scope link noprefixroute valid_lft forever preferred_lft forever
​
[root@Client ~]# for ((i=1;i<=6;i++)); do curl http://192.168.110.10; done  #访问正常
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
​
[root@Keepalived-01 ~]# systemctl start keepalived.service
[root@Keepalived-01 ~]# ip address show ens160     #恢复后回来
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether 00:0c:29:d1:a9:eb brd ff:ff:ff:ff:ff:ffaltname enp3s0inet 192.168.110.31/24 brd 192.168.110.255 scope global noprefixroute ens160valid_lft forever preferred_lft foreverinet 192.168.110.10/32 scope global ens160valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fed1:a9eb/64 scope link noprefixroute valid_lft forever preferred_lft forever
6.3.2.6 后端服务器故障
[root@LVS-RS1 ~]# systemctl stop nginx.service
​
[root@Keepalived-01 ~]# ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.110.10:80 rr-> 192.168.110.34:80            Route   1      0          6  [root@Client ~]# for ((i=1;i<=6;i++)); do curl http://192.168.110.10; done
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2

6.3.3 Keepalived健康检查(MISC方式)

6.3.3.1 编写健康脚本
[root@Keepalived-01 ~]# vim /etc/keepalived/chk_web.sh
#!/bin/bash# 检查传入的参数数量是否正确
if [ $# -ne 2 ]; thenecho "Error, Parameter error"exit 1
else# 使用 nmap 进行端口扫描,获取端口状态n=$(nmap -Pn -p$2 -sS -vv $1 | grep "^$2" | awk '{print $2}')
​# 判断端口是否开放if [ "$n" = "open" ]; thenexit 0elseexit 1fi
fi
​
[root@Keepalived-01 ~]# chmod +x /etc/keepalived/chk_web.sh 
[root@Keepalived-01 ~]# scp /etc/keepalived/chk_web.sh 192.168.110.32:/etc/keepalived/
6.3.3.2 keepalived-01配置
[root@Keepalived-01 ~]# vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived
​
global_defs {router_id LVS_node1
}
​
vrrp_instance LVS {state MASTERinterface ens160virtual_router_id 51priority 100advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.110.10}
}
​
virtual_server  192.168.110.10  80 {delay_loop  6lb_algo rrlb_kind DRprotocol TCP
​real_server  192.168.110.33  80 {weight  1MISC_CHECK {misc_path "/etc/keepalived/chk_web.sh  192.168.110.33  80"misc_timeout  3}}
​real_server  192.168.110.34  80 {weight  1MISC_CHECK {misc_path "/etc/keepalived/chk_web.sh  192.168.110.34  80"misc_timeout  3}}
}
​
​
[root@Keepalived-01 ~]# systemctl start keepalived.service
[root@Keepalived-01 ~]# ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.110.10:80 rr-> 192.168.110.33:80            Route   1      0          0         -> 192.168.110.34:80            Route   1      0          0  
6.3.3.3 keepalived-02配置
[root@Keepalived-02 ~]# vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived
​
global_defs {router_id LVS_node2
}
​
vrrp_instance LVS {state MASTERinterface ens160virtual_router_id 51priority 80advert_int 1authentication {auth_type PASSauth_pass 1111}virtual_ipaddress {192.168.110.10}
}
​
virtual_server  192.168.110.10  80 {delay_loop  6lb_algo rrlb_kind DRprotocol TCP
​real_server  192.168.110.33  80 {weight  1MISC_CHECK {misc_path "/etc/keepalived/chk_web.sh  192.168.110.33  80"misc_timeout  3}}
​real_server  192.168.110.34  80 {weight  1MISC_CHECK {misc_path "/etc/keepalived/chk_web.sh  192.168.110.34  80"misc_timeout  3}}
}
​
[root@Keepalived-02 ~]# systemctl start keepalived.service 
6.3.3.4 访问测试
[root@Client ~]# for ((i=1;i<=6;i++)); do curl http://192.168.110.10; done
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
6.3.3.5 模拟故障转移
[root@Keepalived-01 ~]# systemctl stop keepalived.service
​
[root@Keepalived-02 ~]# ip address show ens160   #VIP漂移到Keepalived-02
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether 00:0c:29:b0:0d:30 brd ff:ff:ff:ff:ff:ffaltname enp3s0inet 192.168.110.32/24 brd 192.168.110.255 scope global noprefixroute ens160valid_lft forever preferred_lft foreverinet 192.168.110.10/32 scope global ens160valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:feb0:d30/64 scope link noprefixroute valid_lft forever preferred_lft forever
​
[root@Client ~]# for ((i=1;i<=6;i++)); do curl http://192.168.110.10; done  #访问正常
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.33  Host=LVS-RS1
This is LVS test IP=192.168.110.34  Host=LVS-RS2
​
[root@Keepalived-01 ~]# systemctl start keepalived.service
[root@Keepalived-01 ~]# ip address show ens160     #恢复后回来
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether 00:0c:29:d1:a9:eb brd ff:ff:ff:ff:ff:ffaltname enp3s0inet 192.168.110.31/24 brd 192.168.110.255 scope global noprefixroute ens160valid_lft forever preferred_lft foreverinet 192.168.110.10/32 scope global ens160valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fed1:a9eb/64 scope link noprefixroute valid_lft forever preferred_lft forever
6.3.3.6 后端服务器故障
[root@LVS-RS1 ~]# systemctl stop nginx.service
​
[root@Keepalived-01 ~]# ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.110.10:80 rr-> 192.168.110.34:80            Route   1      0          6  [root@Client ~]# for ((i=1;i<=6;i++)); do curl http://192.168.110.10; done
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2
This is LVS test IP=192.168.110.34  Host=LVS-RS2

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/832184.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何使用DEEPL免费翻译PDF

如何使用DEEPL免费翻译PDF 安装DEEPL取消PDF限制 安装DEEPL 安装教程比较多&#xff0c;这里不重复。 把英文pdf拖进去&#xff0c;点翻译&#xff0c;在下面的框中有已经翻译完毕的文档。 但是存在两个问题 问题1&#xff1a;这些文档是加密的。 问题2&#xff1a;带有DeepL标…

C#知识|上位机UI设计-详情窗体设计思路及流程(实例)

哈喽,你好啊,我是雷工! 上两节练习记录了登录窗体和主窗体的实现过程,本节继续练习内容窗体的实现,以下为练习笔记。 01 详情窗体效果展示: 02 添加窗体并设置属性 在之前练习项目的基础上添加一个Windows窗体,设置名称为:FrmIPManage.cs 设置窗体的边框和标题栏的外…

flink sql 优化

文章目录 一、参数方面二、资源方面三、总结 提示&#xff1a;实时flink sql 参考很多网上方法与自己实践方法汇总(版本:flink1.13) 一、参数方面 flink sql参数配置 //关闭详细算子链(默认为true),true后job性能会略微有提升。false则可以展示更详细的DAG图方便地位性能结点…

go mod

常用命令 初始化模块 go mod init 模块名下载 go.mod 文件中指明的所有依赖 go mod download github.com/gin-gonic/ginv1.9.(依赖路径)依赖对其&#xff08;使引用的都是所依赖的&#xff09; go mod tidy编辑go.mod go mod edit go mod edit -require"github.com/g…

jvm 马士兵 01 JVM简介,class文件结构

01.JVM是什么 JVM是一个跨平台的标准 JVM只识别class文件&#xff0c;符合JVM规范的class文件都可以被识别 u1 是一个字节 u2是两个字节

5款采用AMD Instinct MI300芯片的超酷AI和HPC服务器

我们收集了戴尔科技、联想、超微和技嘉的五款超酷人工智能和高性能计算服务器&#xff0c;这些服务器使用 AMD 的 Instinct MI300 芯片&#xff0c;该芯片于几个月前推出&#xff0c;旨在挑战 Nvidia 在人工智能计算领域的主导地位。 AMD 正在凭借其 Instinct MI300 加速器芯片…

新手必看!场外个股期权的权利金估算公式

场外个股期权的权利金估算公式 场外个股期权的权利金估算公式通常涉及多个因素&#xff0c;这些因素共同决定了权利金的具体数额。虽然具体的估算公式可能因不同的交易平台、交易规则和标的资产而有所差异&#xff0c;但一般来说&#xff0c;权利金的计算会考虑以下几个关键要…

毕业单纯的钻研嵌入式知识有前景吗?

毕业之后单纯地去钻研嵌入式知识到底有没有前景呢&#xff1f;不可否认的是&#xff0c;嵌入式领域有着较高的薪资待遇&#xff0c;并且还存在着巨大的上升空间。然而&#xff0c;要学习嵌入式开发并非易事&#xff0c;其中存在着诸多挑战。其中一个挑战就是需要深入理解计算机…

前端奇怪面试题总结

面试题总结 不修改下面的代码进行正常结构 这道题考的是迭代器和生成器的概念 let [a,b] {a:1,b:2}答案 对象缺少迭代器&#xff0c;需要手动加上 Object.prototype[Symbol.iterator] function* (){// return Object.values(this)[Symbol.iterator]()return yeild* Object.v…

SpringBootWeb创建

创建spring项目 创建SpringBoot工程定义请求处理类运行常见问题java: 无效的源发行版: XXjava: 无法访问org.springframework.web.bind.annotation.RequestMapping类文件具有错误的版本 61.0, 应为 52.0 创建SpringBoot工程 定义请求处理类 RestController public class HelloC…

毕业设计uniapp+vue有机农产品商城系统 销售统计图 微信小程序

本人在网上找了一下这方面的数据发现农村中的信心普及率很是低农民们都不是怎么会用手机顶多就是打打电话发发短信&#xff0c;平时不太会上网更不会想到通过网络手段去卖出自己的劳作成果—农产品&#xff0c;这无疑大大浪费了农民的劳动成果和国家资源也大大打击了人们的生产…

Centos7配置NFS

环境描述 服务器IP为192.168.200.132客户机IP为192.168.200.143 服务器配置 首先安装软件包 [rootlocalhost ~]# yum install nfs-utils rpcbind //我这里已经安装完毕了建立共享目录 [rootlocalhost ~]# mkdir -p /data/share更改文件夹权限 chmod 777 /data/share编辑配置…

vsftp虚拟用户和ssl加密配置 —— 筑梦之路

为什么要用虚拟用户&#xff1f; 1.增强安全性&#xff1a;使用虚拟用户&#xff0c;可以避免直接使用系统账户进行 FTP 访问,通过使用虚拟用户&#xff0c;可以限制 FTP 用户的访问范围和权限&#xff0c;减少潜在的安全风险。 2.隔离用户和文件&#xff1a;虚拟用户可以被隔…

docker如何关闭证书认证

目录 前言关闭Docker认证的步骤修改pom 前言 当docker认证证书过期了&#xff0c;项目又要马上上线怎么办&#xff1f;重新生成证书&#xff0c;时间来不及&#xff0c;这时最快的方法就是关闭证书认证。 关闭Docker认证的步骤 停止Docker服务 systemctl stop docker编辑Do…

Ts创建的详细过程及配置步骤(傻瓜式配置创建),最后效果展示

一:首先创建一个 空文件夹 二:使用编辑器打开,再创建一个src文件夹,然后按照以下步骤

VMware worksation 17 简易安装Centos8.2、Redhat8.2、Ubuntu16.04

系列文章目录 文章目录 系列文章目录前言一、VMware worksation 17 安装二、安装Centos8.2三、安装RHEL8.2四、安装Ubuntu16.04总结 前言 傻瓜式按照Linux系统&#xff0c;如果觉得简单&#xff0c;可以自定义设置&#xff0c;特别是配置一下磁盘空间大小&#xff0c;对以后排…

2023年上半年系统规划与管理师上午真题及答案解析

1.香农用概率来定量描述信息的公式如下&#xff0c;其中H(x)表示X的( )&#xff0c;Pi是( )出现第i种状态的( )。 A.信息熵 事件 概率 B.总熵 单位 概率 C.信息熵 单位 概率 D.总熵 单位 度量 2.信息传输模型中&#xff0c;( )负责信息的向外传播&#xff0c;( )负责…

数据结构--链表进阶面试题

在链表题目开始之前我们来复习一道数组元素的逆序问题&#xff1a; 给定一个整数数组 nums&#xff0c;将数组中的元素向右轮转 k 个位置&#xff0c;其中 k 是非负数。 提示&#xff1a; 1 < nums.length < 10^5-2^31 < nums[i] < 2^31 - 10 < k < 10^5 思…

wordpress子比主题给文章内容加上密码查看

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言一、pandas是什么?二、使用步骤1.引入库2.读入数据第三步:文章内添加代码前言 提示:这里可以添加本文要记录的大概内容: 例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,…

Docker容器:Docker-Consul的容器服务更新与发现

目录 前言 一、什么是服务注册与发现 二、 Docker-Consul 概述 1、Consul 概念 2、Consul 提供的一些关键特性 3、Consul 的优缺点 4、传统模式与自动发现注册模式的区别 4.1 传统模式 4.2 自动发现注册模式 5、Consul 核心组件 5.1 Consul-Template组件 5.2 Consu…