lvs+keepalived集群

来源:https://www.cnblogs.com/Xkf-IE/archive/2023/03/23/17245989.html
-Advertisement-
Play Games

使用lvs+keepalived架構架構實現後端web伺服器(該web伺服器要求搭建wordpress博客站)的負載均衡 最終客戶端訪問功能變數名稱 我的名字.wordpress.cn 能夠訪問搭建的博客站 ,達到負載均衡的目的 IP 主機名 角色 192.168.26.101 rs1 後端真實伺服器/ng ...


使用lvs+keepalived架構架構實現後端web伺服器(該web伺服器要求搭建wordpress博客站)的負載均衡

最終客戶端訪問功能變數名稱     我的名字.wordpress.cn 能夠訪問搭建的博客站 ,達到負載均衡的目的

IP 主機名 角色
192.168.26.101 rs1 後端真實伺服器/nginx
192.168.26.102 rs2 後端真實伺服器/nginx
192.168.26.103 master keepalived伺服器master 
192.168.26.104 backup keepalived伺服器backup
192.168.26.105 nfs Nfs伺服器
192.168.26.201 web 資料庫伺服器
192.168.26.12 cesi 客戶端

 

一.基礎環境搭建

1.1master配置

1.1.1安裝配置keepalived

[root@master ~]# yum -y install keepalived

[root@master ~]# cat /etc/keepalived/keepalived.conf

! Configuration File for keepalived
global_defs {
    router_id master
}

vrrp_instance VI_1 {
 state MASTER
 interface ens33
 virtual_router_id 51
 priority 150
 advert_int 1
 authentication {
     auth_type PASS
     auth_pass 1111
 } 
 virtual_ipaddress {
     192.168.26.222/24 dev ens33 label ens33:1
 }
}

virtual_server 192.168.26.222 80 {
 delay_loop 6
 lb_algo wrr
 lb_kind DR
 # persistence_timeout 50
 protocol TCP

 real_server 192.168.26.101 80 {
    weight 1
    HTTP_GET {
   url {
  path /
  status_code 200
  } 
   }
  connect_timeout 3
  nb_get_retry 3
  delay_before_retry 3
 }

 real_server 192.168.26.102 80 {
      weight 1
      HTTP_GET {
       url {
        path /
        status_code 200
        }
      }
       connect_timeout 3
       nb_get_retry 3
              delay_before_retry 3
 }
}
 1.1.2查看下ipvsadm -ln是否幫你自動添加了lvs集群規則
[root@master ~]# systemctl restart keepalived.service    #生效   
[root@master ~]# yum -y install ipvsadm                   
[root@master ~]# ipvsadm -ln #查看當前ipvs模塊中記錄的連接
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.26.222:80 wrr
  -> 192.168.26.101:80            Route   1      0          0         
  -> 192.168.26.102:80            Route   1      0          0         

 

1.2Backup配置
[root@backup ~]#  yum -y install keepalived
[root@backup ~]# cat /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
    router_id backup
}

vrrp_instance VI_1 {
 state BACKUP
 interface ens33
 virtual_router_id 51
 priority 100
 advert_int 1
 authentication {
     auth_type PASS
     auth_pass 1111
 }
 virtual_ipaddress {
     192.168.26.222/24 dev ens33 label ens33:1
 }
}

virtual_server 192.168.26.222 80 {
 delay_loop 6
 lb_algo wrr
 lb_kind DR
 # persistence_timeout 50
 protocol TCP

 real_server 192.168.26.101 80 {
    weight 1
    HTTP_GET {
   url {
  path /
  status_code 200
  }
   }
  connect_timeout 3
  nb_get_retry 3
  delay_before_retry 3
 }

 real_server 192.168.26.102 80 {
      weight 1
      HTTP_GET {
       url {
        path /
        status_code 200
        }
      }
       connect_timeout 3
       nb_get_retry 3
              delay_before_retry 3
 }

[root@backup ~]# systemctl restart keepalived.service

[root@master ~]# systemctl restart keepalived.service

[root@master ~]# yum -y install ipvsadm

[root@backup ~]# 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.26.222:80 wrr
  -> 192.168.26.101:80            Route   1      0          0         
  -> 192.168.26.102:80            Route   1      0          0   



 

1.3Rs1 安裝nginx 添加虛擬IP arp抑制

#關閉防火牆和slinux
[root@rs1 ~]# systemctl stop firewalld.service
[root@rs1 ~]# setenforce 0
[root@rs1 ~]# yum -y install nginx


[root@rs1 ~]# echo "rs1" > /usr/share/nginx/html/index.html [root@rs1 ~]# systemctl enable --now nginx Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service. [root@rs1 ~]# curl 127.0.0.1 rs1 [root@rs1 ~]# ip addr add 192.168.26.222/32 dev ens33 label ens33:1 [root@rs1 ~]# vim /etc/sysctl.conf #在末尾插入 [root@rs1 ~]# sysctl -p net.ipv4.conf.all.arp_ignore = 1 net.ipv4.conf.all.arp_announce = 2 net.ipv4.conf.lo.arp_ignore = 1 net.ipv4.conf.lo.arp_announce = 2

1.4RS2同上

[root@rs2 ~]# systemctl stop firewalld.service 
[root@rs2 ~]# setenforce 0
[root@rs2 ~]# yum -y install nginx

[root@rs2 ~]# echo "rs2" > /usr/share/nginx/html/index.html
[root@rs2 ~]# systemctl enable --now nginx
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
[root@rs2 ~]#  ip addr add 192.168.26.222/32 dev lo label lo:1
[root@rs2 ~]# curl 127.0.0.1
rs2
[root@rs2 ~]# vim /etc/sysctl.conf
[root@rs2 ~]# sysctl -p
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2


 

 1.5測試

二.實現後端伺服器上運行wordpress博客站點

2.1Rs1  rs2繼續配置 都配置PHP環境(編譯安裝

[root@rs1 ~]# yum -y remove php-fpm php-mysqlnd php-json  #(刪除自帶yum安裝的)
Loaded plugins: fastestmirror
No Match for argument: php-fpm
No Match for argument: php-mysqlnd
No Match for argument: php-json
No Packages marked for removal
[root@rs1 ~]# yum -y install gcc openssl-devel libxml2-devel bzip2-devel libmcrypt-devel sqlite-devel oniguruma-devel
[root@rs1 ~]# cd /usr/local/src
[root@rs1 src]# wget https://www.php.net/distributions/php-7.4.11.tar.xz --2023-03-23 15:56:56-- https://www.php.net/distributions/php-7.4.11.tar.xz Resolving www.php.net (www.php.net)... 185.85.0.29, 2a02:cb40:200::1ad Connecting to www.php.net (www.php.net)|185.85.0.29|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 10302076 (9.8M) [application/octet-stream] Saving to: ‘php-7.4.11.tar.xz’ 100%[============================================================================================>] 10,302,076 2.26MB/s in 4.6s 2023-03-23 15:57:02 (2.16 MB/s) - ‘php-7.4.11.tar.xz’ saved [10302076/10302076] [root@rs1 src]# tar xf php-7.4.11.tar.xz [root@rs1 src]# cd php-7.4.11/

#編譯安裝
[root@rs1 php-7.4.11]# ./configure --prefix=/usr/local/php74 --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-zlib --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-mbstring --enable-xml --enable-sockets --enable-fpm --enable-maintainer-zts --disable-fileinfo
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE. By continuing this installation  |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.
[root@rs1 php-7.4.11]# make -j 8 && make install
[root@rs1 php-7.4.11]# cp /usr/local/src/php-7.4.11/php.ini-production /etc/php.ini
[root@rs1 php-7.4.11]# cd /usr/local/php74/etc/
[root@rs1 etc]# cp php-fpm.conf.default php-fpm.conf
[root@rs1 etc]# pwd
/usr/local/php74/etc
[root@rs1 etc]# cd php-fpm.d/
[root@rs1 php-fpm.d]# cp www.conf.default www.conf
[root@rs1 php-fpm.d]# vim www.conf

user = nginx

group = nginx

打開

listen.allowed_clients = 127.0.0.1

pm.status_path = /status

[root@rs1 php-fpm.d]#  /usr/local/php74/sbin/php-fpm -t
[23-Mar-2023 16:07:09] NOTICE: configuration file /usr/local/php74/etc/php-fpm.conf test is successful

[root@rs1 php-fpm.d]#  /usr/local/php74/sbin/php-fpm
[root@rs1 php-fpm.d]#  ss -ntl
State      Recv-Q Send-Q                      Local Address:Port                                     Peer Address:Port              
LISTEN     0      128                             127.0.0.1:9000                                                *:*                  
LISTEN     0      128                                     *:80                                                  *:*                  
LISTEN     0      128                                     *:22                                                  *:*                  
LISTEN     0      100                             127.0.0.1:25                                                  *:*                  
LISTEN     0      128                                  [::]:80                                               [::]:*                  
LISTEN     0      128                                  [::]:22                                               [::]:*                  
LISTEN     0      100                                 [::1]:25                                               [::]:*                  
[root@rs1 php-fpm.d]# vim /etc/nginx/nginx.conf
功能變數名稱登錄

 

         index        index.php;

     # Load configuration files for the default server block.

        include /etc/nginx/default.d/*.conf;

插入   location ~ \.php$ {

   root html;

   fastcgi_pass 127.0.0.1:9000;

   fastcgi_index index.php;

   fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;

   include fastcgi_params;

  }

 

[root@rs1 php-fpm.d]# systemctl restart nginx.service

 

2.2部署 WordPress

[root@rs1 ~]# wget https://cn.wordpress.org/wordpress-6.0.1-zh_CN.tar.gz
--2023-03-23 16:23:27--  https://cn.wordpress.org/wordpress-6.0.1-zh_CN.tar.gz
Resolving cn.wordpress.org (cn.wordpress.org)... 198.143.164.252
Connecting to cn.wordpress.org (cn.wordpress.org)|198.143.164.252|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 21933976 (21M) [application/octet-stream]
Saving to: ‘wordpress-6.0.1-zh_CN.tar.gz’

100%[============================================================================================>] 21,933,976  4.26MB/s   in 6.8s   

2023-03-23 16:23:35 (3.09 MB/s) - ‘wordpress-6.0.1-zh_CN.tar.gz’ saved [21933976/21933976]

[root@rs1 ~]# tar xf wordpress-6.0.1-zh_CN.tar.gz
[root@rs1 ~]# cp -r wordpress/* /usr/share/nginx/html/
[root@rs1 ~]# cd /usr/share/nginx/html/
[root@rs1 html]# cp wp-config-sample.php wp-config.php
[root@rs1 html]# vim wp-config.php

 

 
[root@rs1 html]# chown -R nginx.nginx .  #修改許可權所屬

 

2.3rocky安裝資料庫

[root@web ~]# systemctl stop firewalld.service
[root@web ~]# setenforce 0
[root@web ~]# curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
[root@web ~]# bash mariadb_repo_setup --mariadb-server-version=10.6
# [info] Checking for script prerequisites.
# [info] MariaDB Server version 10.6 is valid
# [info] Repository file successfully written to /etc/yum.repos.d/mariadb.repo
# [info] Adding trusted package signing keys...
/etc/pki/rpm-gpg ~
~
# [info] Successfully added trusted package signing keys
# [info] Cleaning package cache...
25 文件已刪除
[root@web ~]# dnf -y install mariadb-server
[root@web ~]#  systemctl enable --now mariadb
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
[root@web ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 10.6.12-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>  create database wordpress;
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> create user wordpress@'192.168.26.%' identified by '123456';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> grant all on wordpress.* to wordpress@'192.168.26.%';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> quit

 百度訪問RS1IP 192.168.26.101

 

 

 

 

2.4RS2配置

[root@rs2 ~]# yum -y remove php-fpm php-mysqlnd php-json
Loaded plugins: fastestmirror
No Match for argument: php-fpm
No Match for argument: php-mysqlnd
No Match for argument: php-json
No Packages marked for removal
[root@rs2 ~]# yum -y install gcc openssl-devel libxml2-devel bzip2-devel libmcrypt-devel sqlite-devel oniguruma-devel

[root@rs2 src]# wget https://www.php.net/distributions/php-7.4.11.tar.xz --2023-03-23 15:56:56-- https://www.php.net/distributions/php-7.4.11.tar.xz Resolving www.php.net (www.php.net)... 185.85.0.29, 2a02:cb40:200::1ad Connecting to www.php.net (www.php.net)|185.85.0.29|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 10302076 (9.8M) [application/octet-stream] Saving to: ‘php-7.4.11.tar.xz’ 100%[============================================================================================>] 10,302,076 2.26MB/s in 4.6s 2023-03-23 15:57:02 (2.16 MB/s) - ‘php-7.4.11.tar.xz’ saved [10302076/10302076] [root@rs2 src]# tar xf php-7.4.11.tar.xz [root@rs2 src]# cd php-7.4.11/


[root@rs2 php-7.4.11]# ./configure --prefix=/usr/local/php74 --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-zlib --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-mbstring --enable-xml --enable-sockets --enable-fpm --enable-maintainer-zts --disable-fileinfo
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE. By continuing this installation  |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.
[root@rs1 php-7.4.11]# make -j 8 && make install
[root@rs1 ~]#  scp /usr/local/php74/etc/php-fpm.conf [email protected]:/usr/local/php74/etc/
[email protected]'s password:
php-fpm.conf                                                                                        100% 5387     3.5MB/s   00:00    
[root@rs1 ~]# scp /usr/local/php74/etc/php-fpm.d/www.conf  [email protected]:/usr/local/php74/etc/php-fpm.d/
[email protected]'s password:
www.conf                                                                                            100%   19KB  11.1MB/s   00:00  


[root@rs2 php-7.4.11]# ls /usr/local/php74/etc/ php-fpm.conf php-fpm.conf.default php-fpm.d [root@rs2 php-7.4.11]# ls /usr/local/php74/etc/php-fpm.d/ www.conf www.conf.default [root@rs2 php-7.4.11]# vim /etc/nginx/nginx.conf

 


     index        index.php;


     # Load configuration files for the default server block.


        include /etc/nginx/default.d/*.conf;


插入   location ~ \.php$ {


   root html;


   fastcgi_pass 127.0.0.1:9000;


   fastcgi_index index.php;


   fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;


   include fastcgi_params;


  }

 

[root@rs2 php-7.4.11]# systemctl restart nginx.service
[root@rs2 php-7.4.11]# 

 

2.5NFS伺服器

  [root@nfs ~]# yum -y install nfs-utils


[root@nfs ~]# mkdir /code [root@nfs ~]# vim /etc/exports
/code * (rw)
[root@nfs
~]# chmod 777 /code/ [root@nfs ~]# systemctl start nfs-server.service

  客戶端rs1rs2 掛載

yum -y install nfs-utils

systemctl restart nfs-server

yum -y install rpcbind

systemctl enable --now nfs-server rpcbind

showmount -e 192.168.26.105 測試

Export list for 192.168.26.105:

/code *                    #以上rs1,2都執行

[root@rs1 ~]# tar zcf xkf.tar.gz /usr/share/nginx/html/
tar: Removing leading `/' from member names
[root@rs1 ~]# ls
\  anaconda-ks.cfg  wordpress  wordpress-6.0.1-zh_CN.tar.gz  xkf.tar.gz
[root@rs1 ~]# scp xkf.tar.gz [email protected]:/root

[root@nfs ~]# tar xf xkf.tar.gz
[root@nfs ~]# cd usr/share/nginx/html/
[root@nfs html]# cd ..
[root@nfs nginx]# mv html/* /code
[root@nfs nginx]# ls /code/
404.html  img          nginx-logo.png   wp-admin              wp-config-sample.php  wp-links-opml.php  wp-settings.php
50x.html  index.html   poweredby.png    wp-blog-header.php    wp-content            wp-load.php        wp-signup.php
en-US     index.php    readme.html      wp-comments-post.php  wp-cron.php           wp-login.php       wp-trackback.php
icons     license.txt  wp-activate.php  wp-config.php         wp-includes           wp-mail.php        xmlrpc.php
[root@rs1 ~]# mount -t nfs 192.168.26.105:/code /usr/share/nginx/html/
[root@rs1 ~]# df -Th
192.168.26.105:/code    nfs4       40G  1.7G   39G   5% /usr/share/nginx/html

[root@rs2 php-7.4.11]# showmount -e 192.168.26.105
Export list for 192.168.26.105:
/code *
[root@rs2 php-7.4.11]# mount -t nfs 192.168.26.105:/code /usr/share/nginx/html/
[root@rs2 php-7.4.11]# df -Th
192.168.26.105:/code    nfs4       40G  1.7G   39G   5% /usr/share/nginx/htm

 

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 說明 使用 VLD 記憶體泄漏檢測工具輔助開發時整理的學習筆記。 1. 使用前的準備 參考本人另一篇博客 安裝 Visual Leak Detector 下載 vld-2.5.1-setup.exe 並按步驟安裝 VLD。這一種使用方式的特點是,在一臺電腦上安裝完成後,將 VLD 安裝目錄下的 lib ...
  • ​1 導庫 import re 2 使用模板 re_pattern = re.compile(pattern, flags=0) result = re.findall(re_pattern,string) 3 說明 參數 描述 pattern 匹配的正則表達式,如 r'abc' 可用來匹配abc ...
  • Salt安裝部署 一:salt簡介 ​ 早期運維人員會根據自己的生產環境來寫特定腳本完成大量重覆性工作,這些腳本複雜且難以維護。系統管理員面臨的問題主要是1、系統配置管理,2、遠程執行命令,因此誕生了很多開源軟體,系統維護方面有fabric、puppet、chef、ansible、saltstack ...
  • """ 需求1:會員卡充值 金額只能輸入數字和浮點數、不能輸入負數 充值100(包含100)金額提示:成功充值N元,恭喜你成為普通會員 充值100.01(包含100.01)至200金額提示:成功充值N元,恭喜你成為鉑金會員 充值200.01(包含100.01)至300金額提示:成功充值N元,恭喜你成 ...
  • 本人是一家小公司的技術總監,工作包括寫市場分析、工作彙報、產品推廣文案及代碼開發等。在ChatGPT推出之後本人一直在工作中使用,在頭腦風暴、大綱生成、語句優化、代碼生成方面很有效果。但ChatGPT在一些常識性生成方面並不理想,比如某個省有哪些旅游景點、三角數學公式推算等,大家使用中一定要註意並仔 ...
  • .NET Core WebApi介面ip限流實踐 前言 之前一直想實現介面限流,但一直沒去實現,然後剛好看到一篇文章是基於AspNetCoreRateLimit 組件的限流策略。這個組件不做多的介紹,想瞭解詳情可以去訪問官方網址或者原文地址,地址在文章底部,本文只講實現。 實現介面限流步驟 導包 第 ...
  • 當前的Winform分頁控制項中,當前導出的數據一般使用Excel來處理,Excel的文檔可以用於後期的數據展示或者批量導入做準備,因此是比較好的輸入輸出格式。但是有框架的使用客戶希望分頁控制項能夠直接導出PDF,雖然Excel也可以直接轉換為PDF,不過直接導出PDF的處理肯定更加方便直觀。因此整理了... ...
  • 1. 核心關註點 1.1. 開發軟體的原因 2. 切麵關註點 2.1. 所有的代碼領域都需要處理相關的問題 3. 結構化模式 3.1. 裝飾器模式 3.1.1. 可以在現有對象上添加新的功能,而不改變其結構 3.2. 代理模式 3.2.1. 所提供的對象可以替代客戶端使用的實際服務對象 4. 使用P ...
一周排行
    -Advertisement-
    Play Games
  • .Net8.0 Blazor Hybird 桌面端 (WPF/Winform) 實測可以完整運行在 win7sp1/win10/win11. 如果用其他工具打包,還可以運行在mac/linux下, 傳送門BlazorHybrid 發佈為無依賴包方式 安裝 WebView2Runtime 1.57 M ...
  • 目錄前言PostgreSql安裝測試額外Nuget安裝Person.cs模擬運行Navicate連postgresql解決方案Garnet為什麼要選擇Garnet而不是RedisRedis不再開源Windows版的Redis是由微軟維護的Windows Redis版本老舊,後續可能不再更新Garne ...
  • C#TMS系統代碼-聯表報表學習 領導被裁了之後很快就有人上任了,幾乎是無縫銜接,很難讓我不想到這早就決定好了。我的職責沒有任何變化。感受下來這個系統封裝程度很高,我只要會調用方法就行。這個系統交付之後不會有太多問題,更多應該是做小需求,有大的開發任務應該也是第二期的事,嗯?怎麼感覺我變成運維了?而 ...
  • 我在隨筆《EAV模型(實體-屬性-值)的設計和低代碼的處理方案(1)》中介紹了一些基本的EAV模型設計知識和基於Winform場景下低代碼(或者說無代碼)的一些實現思路,在本篇隨筆中,我們來分析一下這種針對通用業務,且只需定義就能構建業務模塊存儲和界面的解決方案,其中的數據查詢處理的操作。 ...
  • 對某個遠程伺服器啟用和設置NTP服務(Windows系統) 打開註冊表 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer 將 Enabled 的值設置為 1,這將啟用NTP伺服器功 ...
  • title: Django信號與擴展:深入理解與實踐 date: 2024/5/15 22:40:52 updated: 2024/5/15 22:40:52 categories: 後端開發 tags: Django 信號 松耦合 觀察者 擴展 安全 性能 第一部分:Django信號基礎 Djan ...
  • 使用xadmin2遇到的問題&解決 環境配置: 使用的模塊版本: 關聯的包 Django 3.2.15 mysqlclient 2.2.4 xadmin 2.0.1 django-crispy-forms >= 1.6.0 django-import-export >= 0.5.1 django-r ...
  • 今天我打算整點兒不一樣的內容,通過之前學習的TransformerMap和LazyMap鏈,想搞點不一樣的,所以我關註了另外一條鏈DefaultedMap鏈,主要調用鏈為: 調用鏈詳細描述: ObjectInputStream.readObject() DefaultedMap.readObject ...
  • 後端應用級開發者該如何擁抱 AI GC?就是在這樣的一個大的浪潮下,我們的傳統的應用級開發者。我們該如何選擇職業或者是如何去快速轉型,跟上這樣的一個行業的一個浪潮? 0 AI金字塔模型 越往上它的整個難度就是職業機會也好,或者說是整個的這個運作也好,它的難度會越大,然後越往下機會就會越多,所以這是一 ...
  • @Autowired是Spring框架提供的註解,@Resource是Java EE 5規範提供的註解。 @Autowired預設按照類型自動裝配,而@Resource預設按照名稱自動裝配。 @Autowired支持@Qualifier註解來指定裝配哪一個具有相同類型的bean,而@Resourc... ...