lvs2种模式和haproxy配置

2023-05-16

lvs配置方法

  • nat模式配置
ip类型ip地址
VIP仅主机模式192.168.96.134
DIP192.168.149.143
host1IP192.168.149.140
host2IP192.168.149.137

host1配置

[root@host1 ~]# systemctl stop firewalld.service 
[root@host1 ~]# setenforce 0
[root@host1 ~]# yum -y install httpd
[root@host1 ~]# systemctl start httpd
[root@host1 ~]# echo "1" > /var/www/html/index.html

生成httpds
[root@host1 ~]# mkdir /etc/pki/CA
[root@host1 ~]# cd /etc/pki/CA
[root@host1 CA]# mkdir private
[root@host1 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@host1 CA]# openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days 365
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
State or Province Name (full name) []:HB
Locality Name (eg, city) [Default City]:WH
Organization Name (eg, company) [Default Company Ltd]:xkq         
Organizational Unit Name (eg, section) []:xkq
Common Name (eg, your name or your server's hostname) []:xkq.com
Email Address []:1@1.com
[root@host1 CA]# mkdir certs newcerts crl
[root@host1 CA]# touch index.txt && echo 01 > serial
[root@host1 CA]# (umask 077;openssl genrsa -out httpd.key 2048)
Generating RSA private key, 2048 bit long modulus (2 primes)
......+++++
...........................................+++++
e is 65537 (0x010001)
[root@host1 CA]# openssl req -new -key httpd.key -days 365 -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.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:HB
Locality Name (eg, city) [Default City]:WH
Organization Name (eg, company) [Default Company Ltd]:xkq
Organizational Unit Name (eg, section) []:xkq
Common Name (eg, your name or your server's hostname) []:xkq.com
Email Address []:1@1.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[root@host1 CA]# openssl ca -in httpd.csr -out httpd.crt -days 365
Using configuration from /etc/pki/tls/openssl.cnf
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 1 (0x1)
        Validity
            Not Before: Jun 14 12:04:15 2021 GMT
            Not After : Jun 14 12:04:15 2022 GMT
        Subject:
            countryName               = CN
            stateOrProvinceName       = HB
            organizationName          = xkq
            organizationalUnitName    = xkq
            commonName                = xkq.com
            emailAddress              = 1@1.com
        X509v3 extensions:
            X509v3 Basic Constraints: 
                CA:FALSE
            Netscape Comment: 
                OpenSSL Generated Certificate
            X509v3 Subject Key Identifier: 
                1E:D6:51:6F:21:A7:7D:A7:FF:06:D4:6D:13:85:11:50:6C:FD:D5:8C
            X509v3 Authority Key Identifier: 
                keyid:2B:BA:85:7C:6B:8E:0C:74:24:B2:E0:CF:83:43:9D:21:C3:8D:DF:95

Certificate is to be certified until Jun 14 12:04:15 2022 GMT (365 days)
Sign the certificate? [y/n]:y


1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

安装ssl模板
[root@host1 ~]# dnf -y install mod_ssl
[root@host1 CA]#  mv httpd.key httpd.crt /etc/httpd/
[root@host1 CA]# cd /etc/httpd/conf.d/
[root@host1 conf.d]# vim ssl.conf
修改路径
......
SSLCertificateFile /etc/httpd/httpd.crt

SSLCertificateKeyFile /etc/httpd/httpd.key
......
重启httpd
[root@host1 conf.d]# systemctl restart httpd

[root@host1 CA]#  mv httpd.key httpd.crt /etc/httpd/
[root@host1 CA]# scp /etc/httpd/httpd.crt 192.168.149.137:/etc/httpd/
root@192.168.149.137's password: 
httpd.crt                                                                        100% 4495     2.5MB/s   00:00    
[root@host1 CA]# scp /etc/httpd/httpd.key 192.168.149.137:/etc/httpd/
root@192.168.149.137's password: 
httpd.key                                                                        100% 1675     1.6MB/s   00:00  

将网关改为调度器的ip
[root@host1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
OTPROTO=static
NAME=ens160
DEVICE=ens160
ONBOOT=yes
IPADDR=192.168.149.140
PREFIX=24
GATEWAY=192.168.149.143
DNS1=114.114.114.114  
[root@host1 ~]# ifdown ens160;ifup ens160               

host2配置

[root@host2 ~]# systemctl stop firewalld
[root@host2 ~]# setenforce 0
[root@host2 ~]# yum -y install httpd
[root@host2 ~]# systemctl start httpd
[root@host1 ~]# echo "2" > /var/www/html/index.html

[root@host2 ~]# dnf -y install mod_ssl
[root@host2 ~]# cd /etc/httpd/conf.d/
[root@host2 conf.d]# vim ssl.conf
修改路径
......
SSLCertificateFile /etc/httpd/httpd.crt

SSLCertificateKeyFile /etc/httpd/httpd.key
......
重启httpd
[root@host2 conf.d]# systemctl restart httpd

将网关改为调度器的ip
[root@host2 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
OTPROTO=static
NAME=ens160
DEVICE=ens160
ONBOOT=yes
IPADDR=192.168.149.137
PREFIX=24
GATEWAY=192.168.149.143
DNS1=114.114.114.114       
[root@host2 ~]# ifdown ens160;ifup ens160        

调度器配置

[root@lb ~]# systemctl stop firewalld
[root@lb ~]# setenforce 0
[root@lb ~]# yum -y install ipvsadm

开启 IP转发 功能
[root@lb ~]# echo 'net.ipv4.ip_forward = 1' > /etc/sysctl.conf
[root@lb ~]# sysctl -p
net.ipv4.ip_forward = 1

添加并保持规则
[root@lb ~]# ipvsadm -A -t 192.168.96.132:443 -s rr
[root@lb ~]# ipvsadm -a -t 192.168.96.132:443 -r 192.168.149.137:443 -m
[root@lb ~]# ipvsadm -a -t 192.168.96.132:443 -r 192.168.149.140:443 -m
[root@lb ~]# ipvsadm -A -t 192.168.96.132:80 -s rr
[root@lb ~]# ipvsadm -a -t 192.168.96.132:80 -r 192.168.149.140:80 -m
[root@lb ~]# ipvsadm -a -t 192.168.96.132:80 -r 192.168.149.137:80 -m
[root@lb ~]# ipvsadm -Sn > /etc/sysconfig/ipvsadm
[root@lb ~]# cat /etc/sysconfig/ipvsadm
-A -t 192.168.96.134:80 -s rr
-a -t 192.168.96.134:80 -r 192.168.149.137:80 -m -w 1
-a -t 192.168.96.134:80 -r 192.168.149.140:80 -m -w 1
-A -t 192.168.96.134:443 -s rr
-a -t 192.168.96.134:443 -r 192.168.149.137:443 -m -w 1
-a -t 192.168.96.134:443 -r 192.168.149.140:443 -m -w 1

测试
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

dr模式

ip类型ip地址
VIP虚拟的192.168.149.144
DIP192.168.149.143
host1IP192.168.149.140
host2IP192.168.149.137

host1配置

[root@host1 ~]# systemctl stop firewalld.service 
[root@host1 ~]# setenforce 0
[root@host1 ~]# yum -y install httpd
[root@host1 ~]# systemctl start httpd
[root@host1 ~]# echo "1" > /var/www/html/index.html

生成httpds
[root@host1 ~]# mkdir /etc/pki/CA
[root@host1 ~]# cd /etc/pki/CA
[root@host1 CA]# mkdir private
[root@host1 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@host1 CA]# openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days 365
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
State or Province Name (full name) []:HB
Locality Name (eg, city) [Default City]:WH
Organization Name (eg, company) [Default Company Ltd]:xkq         
Organizational Unit Name (eg, section) []:xkq
Common Name (eg, your name or your server's hostname) []:xkq.com
Email Address []:1@1.com
[root@host1 CA]# mkdir certs newcerts crl
[root@host1 CA]# touch index.txt && echo 01 > serial
[root@host1 CA]# (umask 077;openssl genrsa -out httpd.key 2048)
Generating RSA private key, 2048 bit long modulus (2 primes)
......+++++
...........................................+++++
e is 65537 (0x010001)
[root@host1 CA]# openssl req -new -key httpd.key -days 365 -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.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:HB
Locality Name (eg, city) [Default City]:WH
Organization Name (eg, company) [Default Company Ltd]:xkq
Organizational Unit Name (eg, section) []:xkq
Common Name (eg, your name or your server's hostname) []:xkq.com
Email Address []:1@1.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[root@host1 CA]# openssl ca -in httpd.csr -out httpd.crt -days 365
Using configuration from /etc/pki/tls/openssl.cnf
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 1 (0x1)
        Validity
            Not Before: Jun 14 12:04:15 2021 GMT
            Not After : Jun 14 12:04:15 2022 GMT
        Subject:
            countryName               = CN
            stateOrProvinceName       = HB
            organizationName          = xkq
            organizationalUnitName    = xkq
            commonName                = xkq.com
            emailAddress              = 1@1.com
        X509v3 extensions:
            X509v3 Basic Constraints: 
                CA:FALSE
            Netscape Comment: 
                OpenSSL Generated Certificate
            X509v3 Subject Key Identifier: 
                1E:D6:51:6F:21:A7:7D:A7:FF:06:D4:6D:13:85:11:50:6C:FD:D5:8C
            X509v3 Authority Key Identifier: 
                keyid:2B:BA:85:7C:6B:8E:0C:74:24:B2:E0:CF:83:43:9D:21:C3:8D:DF:95

Certificate is to be certified until Jun 14 12:04:15 2022 GMT (365 days)
Sign the certificate? [y/n]:y


1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

安装ssl模板
[root@host1 ~]# dnf -y install mod_ssl
[root@host1 CA]#  mv httpd.key httpd.crt /etc/httpd/
[root@host1 CA]# cd /etc/httpd/conf.d/
[root@host1 conf.d]# vim ssl.conf
修改路径
......
SSLCertificateFile /etc/httpd/httpd.crt

SSLCertificateKeyFile /etc/httpd/httpd.key
......
重启httpd
[root@host1 conf.d]# systemctl restart httpd

将证书传给host2
[root@host1 CA]# scp /etc/httpd/httpd.crt 192.168.149.137:/etc/httpd/
root@192.168.149.137's password: 
httpd.crt                                                                        100% 4495     2.5MB/s   00:00    
[root@host1 CA]# scp /etc/httpd/httpd.key 192.168.149.137:/etc/httpd/
root@192.168.149.137's password: 
httpd.key                                                                        100% 1675     1.6MB/s   00:00 

[root@host1 httpd]# ifconfig lo:0 192.168.149.144/32 broadcast 192.168.149.144 up
[root@host1 httpd]# route add -host 192.168.149.144 dev lo:0
[root@host1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
OTPROTO=static
NAME=ens160
DEVICE=ens160
ONBOOT=yes
IPADDR=192.168.149.140
PREFIX=24
GATEWAY=192.168.149.2
DNS1=114.114.114.114      

[root@host1 ~]# cd /etc/httpd/
[root@host1 httpd]# cat >> /etc/sysctl.conf <<EOF
> net.ipv4.conf.all.arp_ignore=1
> net.ipv4.conf.all.arp_announce=2
> EOF
[root@host1 httpd]# sysctl -p
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
[root@host1 ~]# ifdown ens160;ifup ens160           

host2配置

[root@host2 ~]# systemctl stop firewalld
[root@host2 ~]# setenforce 0
[root@host2 ~]# yum -y install httpd
[root@host2 ~]# systemctl start httpd
[root@host1 ~]# echo "2" > /var/www/html/index.html
[root@host2 ~]# dnf -y install mod_ssl
[root@host2 ~]# cd /etc/httpd/conf.d/
[root@host2 conf.d]# vim ssl.conf
修改路径
......
SSLCertificateFile /etc/httpd/httpd.crt

SSLCertificateKeyFile /etc/httpd/httpd.key
......
重启httpd
[root@host2 conf.d]# systemctl restart httpd

[root@host2 ~]# ifconfig lo:0 192.168.149.144/32 broadcast 192.168.149.144 up
[root@host2 ~]# route add -host 192.168.149.144 dev lo:0
[root@host2 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
OTPROTO=static
NAME=ens160
DEVICE=ens160
ONBOOT=yes
IPADDR=192.168.149.137
PREFIX=24
GATEWAY=192.168.149.2
DNS1=114.114.114.114   

[root@host2 ~]# ifdown ens160;ifup ens160

[root@host2 ~]# cat >> /etc/sysctl.conf <<EOF
> net.ipv4.conf.all.arp_ignore=1
> net.ipv4.conf.all.arp_announce=2
> EOF
[root@host2 ~]# sysctl -p
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2          

调度器配置

[root@lb ~]# systemctl stop firewalld
[root@lb ~]# setenforce 0
[root@lb ~]# yum -y install ipvsadm

[root@lb ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
BOOTPROTO=static
NAME=ens160
DEVICE=ens160
ONBOOT=yes
IPADDR0=192.168.149.143
PREFIX0=24
IPADDR1=192.168.149.144
PREFIX1=24
GATEWAY=192.168.149.2
DNS1=114.114.114.114

[root@lb ~]# ifdown ens160;ifup ens160

添加规则
[root@lb ~]# ipvsadm -A -t 192.168.149.144:80 -s rr
[root@lb ~]# ipvsadm -a -t 192.168.149.144:80 -r 192.168.149.140:80 -g
[root@lb ~]# ipvsadm -a -t 192.168.149.144:80 -r 192.168.149.137:80 -g
[root@lb ~]# ipvsadm -A -t 192.168.149.144:443 -s rr
[root@lb ~]# ipvsadm -a -t 192.168.149.144:443 -r 192.168.149.137:443 -g
[root@lb ~]# ipvsadm -a -t 192.168.149.144:443 -r 192.168.149.140:443 -g
[root@lb ~]# 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.149.144:80 rr
  -> 192.168.149.137:80           Route   1      0          0         
  -> 192.168.149.140:80           Route   1      0          0         
TCP  192.168.149.144:443 rr
  -> 192.168.149.137:443          Route   1      0          0         
  -> 192.168.149.140:443          Route   1      0          0   

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

haproxy配置

[root@lb ~]# yum -y install make gcc pcre-devel bzip2-devel openssl-devel systemd-devel
[root@lb ~]# useradd -r -M -s /sbin/nologin haproxy
[root@lb ~]# useradd -r -M -s /sbin/nologin haproxy
[root@lb ~]# tar xf haproxy-v2.3.0.tar.gz 
[root@lb ~]#  cd haproxy-2.3.0/
[root@lb haproxy-2.3.0]# make clean
[root@lb haproxy-2.3.0]# make -j $(grep 'processor' /proc/cpuinfo |wc -l)  \
> TARGET=linux-glibc  \
> USE_OPENSSL=1  \
> USE_ZLIB=1  \
> USE_PCRE=1  \
> USE_SYSTEMD=1
[root@lb haproxy-2.3.0]# make install PREFIX=/usr/local/haproxy
[root@lb haproxy-2.3.0]#  echo "export PATH=/usr/local/haproxy/sbin:$PATH">/etc/profile.d/haproxy.sh
[root@lb haproxy-2.3.0]# . /etc/profile.d/haproxy.sh
[root@lb haproxy-2.3.0]# which haproxy 
/usr/local/haproxy/sbin/haproxy
[root@lb haproxy-2.3.0]# echo 'net.ipv4.ip_nonlocal_bind = 1' >>  /etc/sysctl.conf
[root@lb haproxy-2.3.0]# echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf 
[root@lb haproxy-2.3.0]# sysctl  -p 
net.ipv4.ip_forward = 1
net.ipv4.ip_nonlocal_bind = 1
[root@lb haproxy-2.3.0]# mkdir /etc/haproxy
[root@lb haproxy-2.3.0]# cat > /etc/haproxy/haproxy.cfg <<EOF
> #--------------全局配置----------------
> global
>     log 127.0.0.1 local0  info
>     #log loghost local0 info
>     maxconn 20480
> #chroot /usr/local/haproxy
>     pidfile /var/run/haproxy.pid
>     #maxconn 4000
>     user haproxy
>     group haproxy
>     daemon
> #---------------------------------------------------------------------
> #common defaults that all the 'listen' and 'backend' sections will
> #use if not designated in their block
> #---------------------------------------------------------------------
> defaults
>     mode http
>     log global
>     option dontlognull
>     option httpclose
>     option httplog
>     #option forwardfor
>     option redispatch
>     balance roundrobin
>     timeout connect 10s
>     timeout client 10s
>     timeout server 10s
>     timeout check 10s
>     maxconn 60000
>     retries 3
> #--------------统计页面配置------------------
> listen admin_stats
>     bind 0.0.0.0:8189
>     stats enable
>     mode http
>     log global
>     stats uri /haproxy_stats
>     stats realm Haproxy\ Statistics
>     stats auth admin:admin
>     #stats hide-version
>     stats admin if TRUE
>     stats refresh 30s
> #---------------web设置-----------------------
> listen webcluster
>     bind 0.0.0.0:80
>     mode http
>     #option httpchk GET /index.html
>     log global
>     maxconn 3000
>     balance roundrobin
>     cookie SESSION_COOKIE insert indirect nocache
>     server web01 192.168.149.140:80 check inter 2000 fall 5
>     server web02 192.168.149.137:80 check inter 2000 fall 5
> EOF
  • haproxy.service文件编写
[root@lb haproxy-2.3.0]# cat > /usr/lib/systemd/system/haproxy.service <<EOF
> [Unit]
> Description=HAProxy Load Balancer
> After=syslog.target network.target
> 
> [Service]
> ExecStartPre=/usr/local/haproxy/sbin/haproxy -f /etc/haproxy/haproxy.cfg   -c -q
> ExecStart=/usr/local/haproxy/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg  -p /var/run/haproxy.pid
> ExecReload=/bin/kill -USR2 $MAINPID
> 
> [Install]
> WantedBy=multi-user.target
> EOF

[root@lb haproxy-2.3.0]# systemctl daemon-reload
  • 启用日志
[root@lb haproxy-2.3.0]# vim /etc/rsyslog.conf
local0.*                                                /var/log/boot.log
[root@lb haproxy-2.3.0]# systemctl restart rsyslog
  • 重启服务
[root@lb haproxy-2.3.0]# systemctl restart haproxy
[root@lb haproxy-2.3.0]# ss -antl
State        Recv-Q       Send-Q             Local Address:Port              Peer Address:Port       Process       
LISTEN       0            128                      0.0.0.0:80                     0.0.0.0:*                        
LISTEN       0            128                      0.0.0.0:22                     0.0.0.0:*                        
LISTEN       0            128                      0.0.0.0:8189                   0.0.0.0:*                        
LISTEN       0            128                         [::]:22                        [::]:*   

测试
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

lvs2种模式和haproxy配置 的相关文章

  • java获取项目文件绝对路径

    该方法是先根据指定目录创建文件目录后 xff0c 再获取起绝对路径 xff0c 可先在指定目录中放入指定文件 xff0c 这样就可以直接获取起绝对路径 span class token keyword public span span cl
  • 三分钟带你了解最成熟最流行的LAMP网站应用架构

    三分钟带你了解最成熟最流行的LAMP网站应用架构 一 LAMP概述1 各组件的主要作用2 各组件安装顺序 二 编译安装Apache httpd服务准备工作1 关闭防火墙 xff0c 将安装Apache所需软件包传到 opt目录下2 安装环境
  • IDEA通过maven配置Spring保姆级教程

    写在前面 xff1a 此篇文章主要是记录IDEA利用maven配置Spring的全过程 由于本人也是慢慢探索出来的 xff0c 所以有不全或者遗漏的地方 xff0c 还请大家斧正 请耐心看完文章 xff0c 前期工作做完后IDEA才可以配置
  • 策略梯度算法(Policy Gradient)逐行代码详解

    理论部分以及完整代码参看之前的博客 xff1a https blog csdn net qq 47997583 article details 124506650 本文章介绍的是策略梯度算法中的REINFORCE实现 上图为算法流程图 xf
  • python爬虫(自动下载图片)

    爬虫第一步下载第三方工具 requests包 win 43 R 输入cmd点击确定或回车 输入以下命令下载requests包 requests包是python爬虫常用的包 他的下载方式是 pip install requsts 如果觉得下载
  • python json格式转字典

    impor json req 61 json loads 转换的内容
  • mysql安装5.7出现闪退解决办法

    MySQL下载官网 下载地址 xff1a https dev mysql com downloads mysql 我之前用的是5 5的版本升级到5 7是将所有的数据生成到文件里 命令 mysqldump u root p all datab
  • 小程序设置、获取本都缓存、发送请求、渲染数据、转发当前页面、下拉刷新页面

    设置 获取缓存 xff0c 发送请求 xff0c 渲染数据 xff0c 转发当前页面 设置 获取本地缓存设置本地缓存 xff08 wx setStorage xff09 获取本地缓存 xff08 wx getStorageSync xff0
  • cnpm安装步骤

    安装nodeJS 官网下载 xff1a http nodejs cn download 选择其他版本下载地址 https nodejs org zh cn download releases 选版本点击下载 然后下载后缀名为msi 因为安装
  • likeadmin权限管理菜单报错:AxiosError

    报错图片 xff1a 这个原因是后端返回的 JSON 数据太多而导致前端报错 xff0c 可能是因为前端无法处理大量数据 下面是一些可能导致前端代码处理大量数据出现问题 返回json数据中的末尾有说到数据太多了的原因 然后我去数据库的sys
  • Vue安装

    Vue安装 一 安装二 使用步骤1 在项目中使用vue2 使用命令创建vue项目 一 安装 安装vue之前需要安装nodeJS 1 需要安装Node js 可以从官方网站进行下载并安装 2 这篇博客有详细的步骤 Node js安装详解 3
  • Thinkphp6模型关联

    文章目录 前言一 一对一关联示例 二 一对多三 多对多四 示例总结hasManybelongsTohasOne 前言 ThinkPHP 6 模型关联是指使用 PHP 对象关系映射 xff08 ORM xff09 机制 xff0c 通过模型类
  • Linux----生产者与消费者

    生产者与消费者 模型场景分析 xff1a 编程流程 xff1a 生产者同步流程消费者同步流程 代码实现主函数生产者线程函数消费者线程函数 模型场景 分析 xff1a 缓冲区buff中存放数据 生产者和消费者数目不固定 xff0c 生产者向缓
  • 一篇文章了解Like用法及常见索引失效情况

    1 简介 本文主要通过介绍Like索引及常见索引失效情况 xff0c 以MySQL为例 2 EXPLAIN关键字 一条查询语句在经过MySQL查询优化器的各种基于成本和规则的优化会后生成一个所谓的执行计划 EXPLAIN 语句 就可以看到某
  • Linux——进程和计划任务管理(理论+实验)

    目录 前言一 程序 进程线程概述1 1 程序1 2 进程1 3 线程1 4 程序 进程和线程的关系1 5 程序和进程的关系 二 查看进程2 1 1 ps 命令 查看静态的进程统计信息 xff08 Processes Statistic xf
  • Uncaught SyntaxError: Unexpected token ‘var‘

    遇到Uncaught SyntaxError Unexpected token 39 var 怎么去解决 1 发现报错 xff0c 就去找报错 2 怎么查找这个报错并修改这个报错 3 为什么我写的时候没有提示报错 xff0c 运行的时候才显
  • 如何使用Maven创建Mybatis项目

    1 打开idea xff0c 依次点击左上角的File gt New gt project 2 选择Maven xff0c 然后点击Next 3 通过点击这个文件夹进行文件存放地址的改变 xff0c 然后输入项目的名字 4 再点击Finis
  • 树莓派3B+raspbian+docker+hassio安装教程

    说明 1 此文转载 侵删 参考https bbs hassbian com thread 3501 1 1 html 2 修改echo 34 96 date 43 H M S 96 gt gt gt gt gt gt gt gt gt gt
  • Linux - 开机启动流程

    目录 一 掌握开机启动流程的意义 xff1a 1 1 为什么需要了解开机启动流程 xff1f 1 2 在日常的运维过程中 xff0c 是否会遇到机器出现问题启动不了 xff1f 1 3 开机启动流程的意义 二 开机启动流程 2 1 开机启动
  • 关于Ubuntu中出现:Unable to fetch some archives, maybe run apt-get update or try with --fix-missing问题

    在Ubuntu有网络的情况下 xff0c 如果出现在进行 apt update或者apt install时 xff0c 出现Unable to fetch some archives maybe run apt get update or

随机推荐

  • 2022年宜春市职业院校技能大赛中职组“网络搭建与应用”赛项任务书

    2022年宜春市职业院校技能大赛中职组 网络搭建与应用 赛项任务书 xff08 总分1000分 xff09 赛题说明 一 竞赛内容分布 网络搭建与应用 竞赛共分二个部分 xff0c 其中 xff1a 第一部分 xff1a 网络搭建及安全部署
  • Java之变量的作用域和初始化

    write xff1a 2022 4 28 前文我们学习了Java的数据类型 xff1a Java之数据类型 xff0c 本文我们学习变量的作用域和初始化 xff0c 文中有大量使用实例讲解分析 xff0c 需耐心解读代码 文章目录 1 变
  • springboot集成mybatis:查询数据库,返回的结果为null的解决办法

    springboot集成mybatis xff1a 查询数据库 xff0c 返回的结果为null的解决办法 问题重现 xff1a 数据库中的数据 查询的结果 xff1a 也就是说我数据库中有几个数据就有几个null值 这就很奇怪了 xff0
  • springboot使用thymeleaf后找不到模板(五个细节)已解决

    问题 xff1a springboot使用thymeleaf模板后找不到html模板 第一种情况 xff1a 先说第一种情况 xff0c 也是我出现问题的原因 xff1a 那就是导入thymeleaf的命名空间后 xff0c 粗心大意的将t
  • 一篇实现springboot集成elasticsearch的增删改查

    准备工作 springboot版本 span class token generics span class token punctuation lt span parent span class token punctuation gt
  • centos7连接不上网络,保姆级演示,亲测,亲测

    centos连接网络无非就大 五步 写在前边 xff1a vmware16 centos7 1 打开vm xff1a 编辑 虚拟网络编辑器 更改设置 2 有三个网络名称 VMnet0 xff1a 选择仅主机模式 xff0c 勾选下边两个选项
  • 简单三步,实现idea远程debug

    远程debug xff0c 简单三步 这里默认你已经打好了jar包 第一步 xff0c 编辑idea配置 1 1 点击edit configurations 1 2 点击 43 号选择Remote JVM Debug 1 3 进行配置 xf
  • shell把变量的值作为变量使用

    有那么一种生产环境 我有一个变量 xff0c 变量有一个初始值比如count 61 1 我想将count计算或者处理后的值再次作为参数传递 举个例子 span class token assign left variable name sp
  • lamp配置

    lamp独立配置 简介 所谓lamp xff0c 其实就是由Linux 43 Apache 43 Mysql MariaDB 43 Php Perl Python的一组动态网站或者服务器的开源软件 xff0c 除Linux外其它各部件本身都
  • Archlinux系统屏幕花屏

    我的电脑 xff0c 联想Y7000 xff0c 2019款 xff0c Archlinux内核版本 xff0c 系统情况如下 花屏样例 xff0c 这只是其中一种花屏样式 xff0c 屏幕一直不受控制的在闪动 出现这种情况不难猜到是显卡驱
  • centos7 使用letsEncrypt certbot 生成免费的ssl证书 渐进学习

    1 我们将会使用letsencrypt证书颁发机构里的certbot客户端 certbot官网 xff0c 国内也可访问 https certbot eff org 2 准备工作 xff0c 这一步很重要 你首先需要有一个解析通过了的域名
  • CSS选择器

    c选择器表示要定义样式的对象 xff0c 可以是元素本身 xff0c 也可以是一类元素或者指定名称的元素 一 选择器的分类 1 元素选择器 xff1a 以标签名作为选择器的一种方式 xff0c 例如 xff1a p h1 h6 div ul
  • 多生产者多消费者解决方式

    在上一篇博客中记录了如何解决普通生产者消费者的问题 xff0c 这篇讲一下如何解决多生产者多消费者问题 多生产者多消费者问题案例 xff1a 一家四口围着一个盘子 xff0c 盘子中最多放两个水果 爸爸不断向盘子中投放苹果 xff0c 儿子
  • 关于Java NoSuchElementException: No value present以及java.lang.NullPointerException处理

    1 Java NoSuchElementException No value present while curSum lt 100 找出小数余额最大的组 xff0c 对其进行加1 CircleRequest max 61 list str
  • 手机号无法验证,如何注册推特

    Twitter无法添加 验证中国手机号码 xff1f 既然Twitter无法添加 验证中国手机号码 xff0c 怎么解冻呢 xff1f 以下是推特注册时 xff0c 验证 43 86手机号解决方法 xff1a 进入账号申诉页面 点此进入 T
  • vue安装vue-router出错

    项目场景 xff1a 在vue中安装vue router 问题描述 xff1a 提示 xff1a 在安装过程中报错 xff0c 缺少依赖 xff1a PS D span class token punctuation span WebDep
  • SpringBoot之SpringSecurity(安全)

    SpringSecurity xff08 安全 xff09 Spring Security是针对Spring项目的安全框架 xff0c 也是Spring Boot底层安全模块默认的技术选型 xff0c 他可以实现强大的Web安全控制 xff
  • 解决决SpringBoot图片上传需重启服务器才能显示的问题

    问题描述 xff1a 前端页面实现头像图片上传并实时更新显示的功能 xff0c 但是文件上传成功后不能实时显示 xff0c 必须重启服务器后才能显示出来 下图是我将图片文件上到到的目录 xff0c 及项目架构 问题发生的原因 这是服务器的自
  • html页面实现登录验证码功能(纯前端)

    html 43 css 43 javascript简易实现注册或登录时实现验证码功能 xff1a 原文链接 xff1a https blog csdn net weixin 41472431 article details 90732468
  • lvs2种模式和haproxy配置

    lvs配置方法 nat模式配置 ip类型ip地址VIP仅主机模式192 168 96 134DIP192 168 149 143host1IP192 168 149 140host2IP192 168 149 137 host1配置 spa