Lvs

Lvs

Lvs简介

LVS(Linux Virtual Server)即Linux虚拟服务器,是由章文嵩博士主导的开源负载均衡项目,目前LVS已经被集成到Linux内核模块中。在Linux内核中实现了基于IP的数据请求负载均衡调度方案,终端互联网用户从外部访问公司的负载均衡服务器,终端用户的Web请求会发送给LVS调度器,调度器根据自己预设的算法决定将该请求发送给后端的某台Web服务器,比如,轮询算法可以将外部的请求平均分发给后端的所有服务器,终端用户访问LVS调度器虽然会被转发到后端真实的服务器,但如果真实服务器连接的是相同的存储,提供的服务也是相同的服务,最终用户不管是访问哪台真实服务器,得到的服务内容都是一样的,整个集群对用户而言都是透明的。最后根据LVS工作模式的不同,真实服务器会选择不同的方式将用户需要的数据发送到终端用户,LVS工作模式分为NAT模式、TUN模式、以及DR模式。
VIP RIP
官方站点

体系结构

Lvs
使用LVS架设的服务器集群系统有三个部分组成:最前端的负载均衡层(Loader Balancer),中间的服务器群组层,用Server Array表示,最底层的数据共享存储层,用Shared Storage表示。在用户看来所有的应用都是透明的,用户只是在使用一个虚拟服务器提供的高性能服务。

Load Balancer层:位于整个集群系统的最前端,有一台或者多台负载调度器(Director Server)组成,LVS模块就安装在Director Server上,而Director的主要作用类似于一个路由器,它含有完成LVS功能所设定的路由表,通过这些路由表把用户的请求分发给Server Array层的应用服务器(Real Server)上。同时,在Director Server上还要安装对Real Server服务的监控模块Ldirectord,此模块用于监测各个Real Server服务的健康状况。在Real Server不可用时把它从LVS路由表中剔除,恢复时重新加入。

Server Array层:由一组实际运行应用服务的机器组成,Real Server可以是WEB服务器、MAIL服务器、FTP服务器、DNS服务器、视频服务器中的一个或者多个,每个Real Server之间通过高速的LAN或分布在各地的WAN相连接。在实际的应用中,Director Server也可以同时兼任Real Server的角色。

Shared Storage层:是为所有Real Server提供共享存储空间和内容一致性的存储区域,在物理上,一般有磁盘阵列设备组成,为了提供内容的一致性,一般可以通过NFS网络文件系统共享数据,但是NFS在繁忙的业务系统中,性能并不是很好,此时可以采用集群文件系统,例如Red hat的GFS文件系统,oracle提供的OCFS2文件系统等。

从整个LVS结构可以看出,Director Server是整个LVS的核心,目前,用于Director Server的操作系统只能是Linux和FreeBSD,linux2.6内核不用任何设置就可以支持LVS功能,而FreeBSD作为 Director Server的应用还不是很多,性能也不是很好。对于Real Server,几乎可以是所有的系统平台,Linux、windows、Solaris、AIX、BSD系列都能很好的支持。

LVS管理工具

ipvs:内核中的协议栈上实现
ipvs是LVS软件核心,是允许在LB(负载均衡层)上,这是个基于ip层的负载均衡
ipvs的总体结构主要有ip包处理,负载均衡算法,系统配置和管理三个模块以及虚拟服务器与真实服务器链表组成。
ipvs管理集群服务管理服务上的RS(real server)。
一个ipvs主机可以同时定义多个cluster server,但可能会影响调度性格。
一个ipvs服务至少应该有一个RS。

配置 lvs-nat 模式的 httpd 负载集群—http

环境说明:

主机名称 网卡信息 (ens160 为 nat、ens192 为仅主机) 安装应用 系统 Client 客户端 192.168.222.250(ens33) 无 RHEL8 DR DIP:192.168.222.137(ens33)—VIP:192.168.17.10(ens37) ipvsadm RHEL8 RS1 RIP:192.168.222.138(ens33)—gw:192.168.222.137 httpd RHEL8 RS2 RIP:192.168.222.139(ens33)—gw:192.168.222.137 httpd RHEL8

DR、RS1、RS2 三台主机都关闭防火墙和 selinux

[root@DR ~]# systemctl stop firewalld.service
[root@DR ~]# vim /etc/selinux/config
SELINUX=disabled
[root@DR ~]# setenforce 0
[root@DR ~]# systemctl disable --now firewalld.service
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

[root@RS1 ~]# systemctl stop firewalld.service
[root@RS1 ~]# vim /etc/selinux/config
SELINUX=disabled
[root@RS1 ~]# setenforce 0
[root@RS1 ~]# systemctl disable --now firewalld.service
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

[root@RS2 ~]# systemctl stop firewalld.service
[root@RS2 ~]# vim /etc/selinux/config
SELINUX=disabled
[root@RS2 ~]# setenforce 0
[root@RS2 ~]# systemctl disable --now firewalld.service
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

配置 ip 信息
DR:
添加ens192网卡信息仅主机

Lvs
Lvs
Lvs
[root@DR ~]# ifconfig    //查看刚刚添加的网卡
ens33: flags=4163<up,broadcast,running,multicast>  mtu 1500
        inet 192.168.222.137  netmask 255.255.255.0  broadcast 192.168.222.255
        inet6 fe80::20c:29ff:fec7:eb2  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:c7:0e:b2  txqueuelen 1000  (Ethernet)
        RX packets 122996  bytes 47438695 (45.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 159300  bytes 28724758 (27.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens37: flags=4163<up,broadcast,running,multicast>  mtu 1500
        inet 192.168.17.134  netmask 255.255.255.0  broadcast 192.168.17.255
        inet6 fe80::318:a5d1:6043:25f  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:c7:0e:bc  txqueuelen 1000  (Ethernet)
        RX packets 6  bytes 1022 (1022.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12  bytes 1468 (1.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<up,loopback,running>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
</host></up,loopback,running></up,broadcast,running,multicast></up,broadcast,running,multicast>

查看刚刚添加网卡的网段

Lvs
[root@DR ~]# cd /etc/sysconfig/network-scripts/
[root@DR network-scripts]# ls
ifcfg-ens33
[root@DR network-scripts]# vim ifcfg-ens33
[root@DR network-scripts]# cat ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static
NAME=ens33
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.222.137
NETMASK=255.255.255.0
GATEWAY=192.168.222.2
DNS1=192.168.222.2
[root@DR network-scripts]# systemctl restart NetworkManager
[root@DR network-scripts]# nmcli connection up ens36
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)
[root@DR network-scripts]# cp ifcfg-ens33 ifcfg-ens37
[root@DR network-scripts]# ls
ifcfg-ens33  ifcfg-ens37
[root@DR network-scripts]# vim ifcfg-ens37
[root@DR network-scripts]# cat ifcfg-ens37
TYPE=Ethernet
BOOTPROTO=static
NAME=ens37
DEVICE=ens37
ONBOOT=yes
IPADDR=192.168.17.10
NETMASK=255.255.255.0
GATEWAY=192.168.222.2
DNS1=192.168.222.2
[root@DR network-scripts]# systemctl restart NetworkManager
[root@DR network-scripts]# nmcli connection up ens37
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)
[root@DR network-scripts]# nmcli connection show
NAME                UUID                                  TYPE      DEVICE
ens33               c96bc909-188e-ec64-3a96-6a90982b08ad  ethernet  ens33
ens37               4a5516a4-dfa4-24af-b1c4-e843e312e2fd  ethernet  ens37
Wired connection 1  2fcbb410-1e4b-3138-a0de-629a7e701de6  ethernet  --

RS1:

[root@RS1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
[root@RS1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static
NAME=ens33
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.222.138
NETMASK=255.255.255.0
GATEWAY=192.168.222.137
DNS1=192.168.222.2
[root@RS1 ~]# systemctl restart NetworkManager
[root@RS1 ~]# nmcli connection up ens33
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)

RS2:

[root@RS2 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
[root@RS2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static
NAME=ens33
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.222.139
NETMASK=255.255.255.0
GATEWAY=192.168.222.137
DNS1=192.168.222.2
[root@RS2 ~]# systemctl restart NetworkManager
[root@RS2 ~]# nmcli connection up ens33
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)

后端RS1和RS2部署WEB服务器
RS1:

Lvs
[root@RS1 ~]# cd /etc/yum.repos.d/
[root@RS1 yum.repos.d]# ls
CentOS-Base.repo   epel-next-testing.repo  epel-playground.repo       epel-testing.repo
epel-modular.repo  epel-next.repo          epel-testing-modular.repo  epel.repo
[root@RS1 yum.repos.d]# rm -rf *
[root@RS1 yum.repos.d]# ls
[root@RS1 yum.repos.d]# vim lnh.repo   //&#x914D;&#x7F6E;&#x672C;&#x5730;&#x7684;yum&#x4ED3;&#x5E93;
[root@RS1 yum.repos.d]# cat lnh.repo
[BaseOS]
name=111
baseurl=file:///mnt/BaseOS
gpgcheck=0
enabled=1
[AppStream]
name=222
baseurl=file:///mnt/AppStream
gpgcheck=0
enabled=1
[root@RS1 yum.repos.d]# cd
[root@RS1 ~]# mount /dev/cdrom /mnt/   //&#x6302;&#x8F7D;&#x955C;&#x50CF;
mount: /mnt: WARNING: device write-protected, mounted read-only.

[root@RS1 ~]# dnf -y install httpd
[root@RS1 ~]# echo RS1 > /var/www/html/index.html //&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x7F51;&#x7AD9;
[root@RS1 ~]# systemctl enable --now httpd   //&#x8BBE;&#x7F6E;&#x5F00;&#x673A;&#x81EA;&#x542F;
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service &#x2192; /usr/lib/systemd/system/httpd.service.

[root@RS1 ~]# curl http://192.168.222.138  //&#x53EF;&#x4EE5;&#x8BBF;&#x95EE;&#x81EA;&#x5DF1;
RS1

RS2:

Lvs
[root@RS2 ~]# cd /etc/yum.repos.d/
[root@RS2 yum.repos.d]# ls
CentOS-Base.repo   epel-next-testing.repo  epel-playground.repo       epel-testing.repo
epel-modular.repo  epel-next.repo          epel-testing-modular.repo  epel.repo
[root@RS2 yum.repos.d]# rm -rf *
[root@RS2 yum.repos.d]# vim lnh.repo   //&#x914D;&#x7F6E;&#x672C;&#x5730;yum&#x4ED3;&#x5E93;
[root@RS2 yum.repos.d]# cat lnh.repo
[BaseOS]
name=111
baseurl=file:///mnt/BaseOS
gpgcheck=0
enabled=1
[AppStream]
name=222
baseurl=file:///mnt/AppStream
gpgcheck=0
enabled=1
[root@RS2 ~]# mount /dev/cdrom /mnt/   //&#x6302;&#x8F7D;&#x955C;&#x50CF;
mount: /mnt: WARNING: device write-protected, mounted read-only.

[root@RS2 ~]# dnf -y install httpd
[root@RS2 ~]# echo RS2 > /var/www/html/index.html   //&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x7F51;&#x7AD9;
[root@RS2 ~]# systemctl enable --now httpd    //&#x8BBE;&#x7F6E;&#x5F00;&#x673A;&#x81EA;&#x542F;
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service &#x2192; /usr/lib/systemd/system/httpd.service.

[root@RS2 ~]# curl http://192.168.222.139   //&#x53EF;&#x4EE5;&#x8BBF;&#x95EE;&#x81EA;&#x5DF1;
RS2

配置DR
开启IP转发功能

[root@DR ~]# vim /etc/sysctl.conf
net.ipv4.ip_forward = 1   //&#x6DFB;&#x52A0;(&#x7B49;&#x4E8E;&#x53F7;&#x524D;&#x540E;&#x90FD;&#x8981;&#x7A7A;&#x683C;)
[root@DR ~]# sysctl -p
net.ipv4.ip_forward = 1

安装ipvsadm并添加规则

Lvs
[root@DR ~]# cd /etc/yum.repos.d/
[root@DR yum.repos.d]# ls
CentOS-Base.repo   epel-next-testing.repo  epel-playground.repo       epel-testing.repo
epel-modular.repo  epel-next.repo          epel-testing-modular.repo  epel.repo
[root@DR yum.repos.d]# rm -rf *
[root@DR yum.repos.d]# ls
[root@DR yum.repos.d]# vim lnh.repo    //&#x914D;&#x7F6E;&#x672C;&#x5730;yum&#x4ED3;&#x5E93;
[root@DR yum.repos.d]# cat lnh.repo
[BaseOS]
name=111
baseurl=file:///mnt/BaseOS
gpgcheck=0
enabled=1
[AppStream]
name=222
baseurl=file:///mnt/AppStream
gpgcheck=0
enabled=1
[root@DR yum.repos.d]# cd
[root@DR ~]# mount /dev/cdrom /mnt/    //&#x6302;&#x8F7D;&#x955C;&#x50CF;
mount: /mnt: WARNING: device write-protected, mounted read-only.

[root@DR ~]# dnf -y install ipvsadm
[root@DR ~]# ipvsadm -A -t 192.168.17.10:80 -s rr  //&#x8FD9;&#x91CC;&#x662F;vip&#x7684;&#x5730;&#x5740;
[root@DR ~]# ipvsadm -a -t 192.168.17.10:80 -r 192.168.222.138:80 -m   //vip&#x52A0;RS1&#x7684;&#x5730;&#x5740;
[root@DR ~]# ipvsadm -a -t 192.168.17.10:80 -r 192.168.222.139:80 -m   //vip&#x52A0;RS2&#x7684;&#x5730;&#x5740;
[root@DR ~]# ipvsadm -Ln  //&#x5217;&#x51FA;&#x6DFB;&#x52A0;&#x7684;ip
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.17.10:80 rr
  -> 192.168.222.138:80           Masq    1      0          0
  -> 192.168.222.139:80           Masq    1      0          0
[root@DR ~]# ipvsadm -Sn > /etc/sysconfig/ipvsadm
//&#x56E0;&#x4E3A;&#x5F00;&#x673A;&#x81EA;&#x542F;&#x540E;&#x8FD9;&#x4E9B;&#x5C31;&#x4F1A;&#x6D88;&#x5931;&#xFF0C;&#x6240;&#x4EE5;&#x5C06;&#x8FD9;&#x4E9B;&#x5BFC;&#x5165;&#x6587;&#x4EF6;&#x91CC;&#x9762;&#x5B58;&#x653E;
[root@DR ~]# cat /etc/sysconfig/ipvsadm   //&#x67E5;&#x770B;
-A -t 192.168.17.10:80 -s rr
-a -t 192.168.17.10:80 -r 192.168.222.138:80 -m -w 1
-a -t 192.168.17.10:80 -r 192.168.222.139:80 -m -w 1
[root@DR ~]# systemctl enable --now ipvsadm.service  //&#x8BBE;&#x7F6E;&#x5F00;&#x673A;&#x81EA;&#x542F;
Created symlink /etc/systemd/system/multi- user.target.wants/ipvsadm.service &#x2192; /usr/lib/systemd/system/ipvsadm.service.

客户端测试
配置好ip信息
测试:

[root@Client ~]# curl http://192.168.17.10
RS2
[root@Client ~]# curl http://192.168.17.10
RS1
[root@Client ~]# curl http://192.168.17.10
RS2
[root@Client ~]# curl http://192.168.17.10
RS1

配置lvs-nat模式的httpd负载集群—https

在DR中生成一对密钥

[root@DR ~]# mkdir  -p  /etc/pki/CA/private
[root@DR ~]# cd /etc/pki/CA/
[root@DR CA]# ls
private
[root@DR CA]# (umask 077;openssl genrsa -out private/cakey.pem 2048)
Generating RSA private key, 2048 bit long modulus (2 primes)
............................................................................................+++++
......................................................+++++
e is 65537 (0x010001)
[root@DR CA]# openssl rsa -in private/cakey.pem -pubout
writing RSA key
[root@DR CA]# openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days 1024
You are about to be asked to enter information that will be incorporated
into your certificate request.

What you are about to enter is what is called a Distinguished Name or a DN.

There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.

Country Name (2 letter code) [XX]:CN    //&#x56FD;&#x5BB6;
State or Province Name (full name) []:HB  //&#x7701;&#x4EFD;
Locality Name (eg, city) [Default City]:WH   //&#x57CE;&#x5E02;
Organization Name (eg, company) [Default Company Ltd]:tushanbu //&#x7EC4;&#x7EC7;
Organizational Unit Name (eg, section) []:linux //&#x90E8;&#x95E8;
Common Name (eg, your name or your server's hostname) []:lnh //&#x540D;&#x5B57;
Email Address []:lnh@example.com    //&#x90AE;&#x7BB1;&#x5730;&#x5740;
[root@DR CA]# touch index.txt && echo 01 > serial  //&#x63D0;&#x524D;&#x521B;&#x5EFA;&#x597D;&#x6570;&#x636E;&#x5B58;&#x653E;&#x7684;&#x6587;&#x4EF6;

在RS1中生成证书签署请求,并发送给CA

`
[root@RS1 ~]# dnf -y install mod_ssl
[root@RS1 ~]# mkdir /etc/httpd/ssl
[root@RS1 ~]# cd /etc/httpd/ssl/
[root@RS1 ssl]# (umask 077;openssl genrsa -out httpd.key 2048)
Generating RSA private key, 2048 bit long modulus (2 primes)
…………….+++++
………………………………………+++++
e is 65537 (0x010001)
[root@RS1 ssl]# openssl req -new -key httpd.key -days 1024 -out httpd.csr
Ignoring -days; not generating a certificate
You are about to be asked to enter information that will be incorporated
into your certificate request.

What you are about to enter is what is called a Distinguished Name or a DN.

There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.

Original: https://www.cnblogs.com/tushanbu/p/16739108.html
Author: 涂山布
Title: Lvs

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/573938/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • 附001.Python多版本环境管理

    一 环境背景 由于Python的版本过多,且不同版本之间差异性较大。同时又因系统底层需要调用当前版本Python,所以不能随意变更当前系统Python版本。因此,在多版本共存的情况…

    Linux 2023年6月7日
    084
  • 手把手教你在Linux系统下安装MySQL

    在CentOS中默认安装有MariaDB,这个是MySQL的分支,但为了需要,还是要在系统中安装MySQL,而且安装完成之后可以直接覆盖掉MariaDB。 1. 下载并安装MySQ…

    Linux 2023年6月14日
    0108
  • SpringSecurity

    SpringSecurity 11.1 SpringSecurity简介 Spring 是一个非常流行和成功的 Java 应用开发框架。Spring Security 基于 Spr…

    Linux 2023年6月14日
    0101
  • 数据转换-整数字节数组

    任务详情 任务详情0. 在openEuler(推荐)或Ubuntu或Windows(不推荐)中完成下面任务 1 参考《GMT 0009-2012 SM2密码算法使用规范》第6节&#…

    Linux 2023年6月8日
    0148
  • NO.4 计算机组成原理-笔记

    404. 抱歉,您访问的资源不存在。 可能是网址有误,或者对应的内容被删除,或者处于私有状态。 代码改变世界,联系邮箱 contact@cnblogs.com 园子的商业化努力-困…

    Linux 2023年6月7日
    095
  • Redis时延问题分析及应对

    Redis时延问题分析及应对 Redis的事件循环在一个线程中处理,作为一个单线程程序,重要的是要保证事件处理的时延短,这样,事件循环中的后续任务才不会阻塞;当redis的数据量达…

    Linux 2023年5月28日
    096
  • 内核同步问题

    linux内核同步问题 Linux内核设计与实现 十、内核同步方法 [手把手教Linux驱动5-自旋锁、信号量、互斥体概述](https://www.cnblogs.com/yik…

    Linux 2023年6月13日
    089
  • Java实现动态数组【数据结构与算法】

    1、数组 类型固定、长度固定 连续的内存空间 顺序存储、随机读取 查询快、新增删除慢。 最好初始化的时候就指定数组大小。这样就可以避免一定的数组扩容出现的内存消耗。 import …

    Linux 2023年6月14日
    0101
  • Java中List<T>和List<?>的区别【转载】

    ` List、List<?>、List这三者都可以&#x…

    Linux 2023年6月8日
    094
  • 一文剖析HTML块和内联元素以及DIV容器,运维开发必备前端技能,基本功强化训练。

    写在开篇 运维开发必备前端技能!虽然很枯燥,知识点很多,但要坚持住哦!笔者和大家一起坚持。本篇和大家一起巩固html中的块元素和内联元素以及DIV容器。 块元素 块元素的特点是啥?…

    Linux 2023年6月7日
    0120
  • RAID磁盘阵列技术

    RAID磁盘阵列技术 1、RAID概述 RAID(Redundant Array of Independent Disk),从字面意思讲的是基于独立磁盘的具有冗余的磁盘阵列,其核心…

    Linux 2023年6月7日
    0104
  • 最小生成树-Kruskal算法

    与 Prim算法贪心选择不同,Kruskal算法采取 每次选择权值最小的边的方法,这样,在 不构成环且最后能够连接完所有边它们的权重和一定是最小的。 和之前Prim算法的图一样,便…

    Linux 2023年6月7日
    0121
  • 多态

    一.相关定义 1-1 多态 多态是同一个行为具有多个不同表现形式或形态的能力。同一个形参类型为基类的接口,使用不同的子类的实例可以执行不同操作。 1-2 绑定 绑定:将一个方法调用…

    Linux 2023年6月8日
    089
  • Gumbel_Softmax 概要

    解决argmax不可导,无法进行反向传播的问题 出现的原因: argmax(x,y)不可导的根本原因是其向量空间不是光滑的,有尖锐的点和面;而是某些任务中,argmax会被插入到反…

    Linux 2023年6月7日
    0117
  • Ubuntu16.04部署django+nginx项目

    项目使用django+nginx部署。这个项目断断续续地部署4遍了。感觉每次部署都挺费时间的(找各种配置的资料),于是写一个博客总结一下。 安装vsftpd $ sudo apt-…

    Linux 2023年6月7日
    071
  • 使用并发 ssh 连接来提升捞日志脚本执行效率

    问题背景 公司有简单粗略的日志服务,部署在多台机器实例上,采集的日志记录在每台机器的本地硬盘上,写一小时后日志文件自动切换,硬盘空间自动回滚。大约可以保存两三天的历史数据。为什么会…

    Linux 2023年5月27日
    076
亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球