1. 程式人生 > >如何手動建立 k8s kubeconfig 檔案以實現多環境切換

如何手動建立 k8s kubeconfig 檔案以實現多環境切換

這篇檔案簡單介紹一下叢集環境中如何配置kubectl,以及如何製作 kubeconfig 檔案,以使用 kubectl config 來實現切換多種k8s環境,官方有相應的文件,這裡簡要介紹一下如何手動生成這個 config 檔案。

1、叢集環境中如何配置kubectl (有叢集登入許可權)

要實現 kubectl get no 這種以很少命令引數的方式獲取到 k8s 叢集資訊,下面介紹一種方法,這種方法一般是面向運維人員,有叢集登入許可權。還可以實施到部署k8s叢集時,方便每個節點上執行訪問。

1、首先建立 k8s_env.sh 檔案,填寫如下相關環境配置變數,並放到 /etc/profile.d
目錄下,source 後,使其生效。

為什麼要放到這個目錄下?因為在執行命令時, bash 會預設檢查這個目錄,根據這個目錄下的配置去訪問系統。

-[[email protected]1 ~]$ cat /etc/profile.d/k8s_env.sh 
# for kubectl
export KUBERNETES_MASTER='10.130.14.155:443'
export KUBECONFIG='/etc/kubernetes/kubeconfig'

2、編寫kubeconfig檔案

這個 kubeconfig 檔案定義了叢集和客戶端資訊,包括https認證等,當然也可以採用 insecure-skip-tls-verify: true

來替換 certificate-authority: /etc/kubernetes/ssl/ca.crt 以跳過叢集驗證。
一般參考如下:

-[appuser@k8s-master-1 ~]$ cat /etc/kubernetes/kubeconfig 
apiVersion: v1
kind: Config
clusters:
- name: shjq-dev01-chenqiang-cluster
  cluster:
    server: https://10.130.14.155:443
    certificate-authority: /etc/kubernetes/ssl/ca.crt
users:
- name:
shjq-dev01-chenqiang-user
user: client-certificate: /etc/kubernetes/ssl/cs_client.crt client-key: /etc/kubernetes/ssl/cs_client.key contexts: - context: cluster: shjq-dev01-chenqiang-cluster user: shjq-dev01-chenqiang-user name: shjq-dev01-chenqiang

3、生成 kubeconfig 中指定的那些配置檔案

當裡叢集設定了 https 訪問時,請按照k8s官網手冊,生成如下證書,並放入到 /etc/kubernetes/ssl/ 下。

-[[email protected]1 ~]$ ll /etc/kubernetes/ssl/
total 60
-rw-r--r-- 1 root root 2009 May 22 15:20 ca.crt
-rw-r--r-- 1 root root 3268 May 22 15:20 ca.key
-rw-r--r-- 1 root root   17 May 22 15:20 ca.srl
-rwxr-xr-x 1 root root  702 May 22 15:20 create-master-crt
-rw-r--r-- 1 root root 1452 May 22 15:20 cs_client.crt
-rw-r--r-- 1 root root  907 May 22 15:20 cs_client.csr
-rw-r--r-- 1 root root 1679 May 22 15:20 cs_client.key
-rw-r--r-- 1 root root 9450 May 22 15:20 master_ssl.cnf
-rw-r--r-- 1 root root 2029 May 22 15:20 server.crt
-rw-r--r-- 1 root root 1846 May 22 15:20 server.csr
-rw-r--r-- 1 root root 3268 May 22 15:20 server.key
-rw-r--r-- 1 root root 5297 May 22 15:20 server.pem

之後,進入到 k8s 節點中,不需要指定 kubeconfig file,也不需要用 -s 指定 apiserver ,直接使用 kubectl 就可以拿到叢集的資訊了

-[[email protected]1 ~]$ kubectl get no
NAME           STATUS    ROLES     AGE       VERSION
10.130.14.67   Ready     <none>    15d       v1.9.3
10.130.14.68   Ready     <none>    70d       v1.9.3
10.130.14.73   Ready     <none>    70d       v1.9.3

2、將指定檔案目錄的方式轉成單kube config檔案方式訪問

第一種配置方法,需要建立存放證書的目錄,並將證書 cp 到該目錄下,這種方式不適合移植和通用化,很多時候,kubectl 客戶端其實只需要一個配置檔案即可。這裡說一個場景,比如公司某個成員想使用 k8s 環境,但我們又不希望給他 密碼以登入到叢集中來使用,我們只需要讓他在自己的電腦上下載 kubectl 這個 client, 並給他一個配置檔案 即可,那麼如何製作這樣一個配置檔案?又如何使用呢?

1、下載kubectl

kubectl 的版本有很多,也有各種作業系統版本的 kubectl,只需要到官網下載和我們 k8s 叢集私適配的版本即可。

2、修改config檔案的文段

如下這個配置檔案源於方法一

-[appuser@k8s-master-1 ~]$ cat /etc/kubernetes/kubeconfig 
apiVersion: v1
kind: Config
clusters:
- name: shjq-dev01-chenqiang-cluster
  cluster:
    server: https://10.130.14.155:443
    certificate-authority: /etc/kubernetes/ssl/ca.crt
users:
- name: shjq-dev01-chenqiang-user
  user:
    client-certificate: /etc/kubernetes/ssl/cs_client.crt
    client-key: /etc/kubernetes/ssl/cs_client.key
contexts:
- context:
    cluster: shjq-dev01-chenqiang-cluster
    user: shjq-dev01-chenqiang-user
  name: shjq-dev01-chenqiang

我們要配置成單個 kubeconfig 配置檔案,我們需要做如下操作:
- 修改 certificate-authoritycertificate-authority-data
- 修改 client-certificateclient-certificate-data
- 修改 client-keyclient-key-data
- 對 /etc/kubernetes/ssl/ca.crt, cs_client.crt, cs_client.key 進行 base64 編碼,分別執行 /etc/kubernetes/ssl/ca.crt|base64 等。

經過上述步驟,我們得到類似如下檔案:

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZuVENDQTRXZ0F3SUJBZ0lKQVBuVlJIdW9zZXpqTUEwR0NTcUdTSWIzRFFFQkN3VUFNR1V4Q3pBSkJnTlYKQkFZVEFrTk9NUkV3RHdZRFZRUUlEQWhUYUdGdVoyaGhhVEVQTUEwR0ExVUVCd3dHVUhWa2IyNW5NUll3RkFZRApWUVFLREExellXbGpiVzkwYjNJdVkyOXRNUXd3Q2dZRFZRUUxEQU5yT0hNeEREQUtCZ05WQkFNTUEyczRjekFlCkZ3MHhPREF6TURnd05qSTJORE5hRncweE9UQXpNRGd3TmpJMk5ETmFNR1V4Q3pBSkJnTlZCQVlUQWtOT01SRXcKRHdZRFZRUUlEQWhUYUdGdVoyaGhhVEVQTUEwR0ExVUVCd3dHVUhWa2IyNW5NUll3RkFZRFZRUUtEQTF6WVdsagpiVzkwYjNJdVkyOXRNUXd3Q2dZRFZRUUxEQU5yT0hNeEREQUtCZ05WQkFNTUEyczRjekNDQWlJd0RRWUpLb1pJCmh2Y05BUUVCQlFBRGdnSVBBRENDQWdvQ2dnSUJBSy9lNG11QTR6VXRCRzdXdFhDN0o0NmpkQXhabVltaDZXL2oKelRwemlyOHlLY3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dev01-chenqiang-cluster
    user: shjq-dev01-chenqiang-user
  name: shjq-dev01-chenqiang
current-context: shjq-dev01-chenqiang
kind: Config
preferences: {}
users:
- name: shjq-dev01-chenqiang-user
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBakNDQWVvQ0NRQ0NhYWdFUnFmNExEQU5CZ2txaGtpRzl3MEJBUXNGQURCbE1Rc3dDUVlEVlFRR0V3SkQKVGpFUk1BOEdBMVVFQ0F3SVUyaGhibWRvWVdreER6QU5CZ05WQkFjTUJsQjFaRzl1WnpFV01CUUdBMVVFQ2d3TgpjMkZwWTIxdmRHOXlMbU52YlRFTU1Bb0dBMVVFQ3d3RGF6aHpNUXd3Q2dZRFZRUUREQU5yT0hNd0hoY05NVGd3Ck5USXlNRGN5TURVNVdoY05Nekl3TVRJNU1EY3lNRFU1V2pBaE1SOHdIUVlEVlFRRERCWnJPSE10YldGemRHVnkKTFRFdWJtOTJZV3h2WTJGc01JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBeUI4dgozeWI5akZsUVNMdy9RWGlVMnBXRnJOYzYwdG5qdWVYeTd4LzU2TnFzaTlIcDdlSzZaSG5LL1JabDcxZUltS0tPCjY4a1ZvWklGbEZsdlEyTFprSTJFa2F6Z3Rza3Z6b0N5eGhIUEp3SFdNbEZaQ1dndDFXVHdkTm93emI1ZEtpSngKRmxxb1pSbWdwQTBiSWE3Q2hBV0tPQ1Q1Uy9pdkpSNXpOd0x4c290WkpONlpweXJCc0YrL2lhQVBiZGRyK2NXSwo3UG9vdXlRZHhWZGplcEgvTmcyVC9zL1FLRVdvcUFnY1hvZ1BNSnNFaXNUMWloazN6UWNwcStTeC9OWFhCRzNTCk0xUWVnTlN4TnVkSjNIT0ZLaHFXKzZDcHFOU1JMb1BEUmw3Z2lQZ1JBMWpzdmVnbkJNMHFrbk1tUUEwLzdHUTIKdXN4ZGhHVFNXTERBYVVWM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pWQzQwSWNEY3I0Wnc9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=

3、配置 KUBECONFIG 環境變數

建立 $HOME/.kube/ 目錄,並將上述得到的 kubeconfig 檔案命名成 config,放於該目錄下。
並在 ~/.bash_profile中新增如下配置以匯出該環境變數:

export KUBECONFIG=$KUBECONFIG:$HOME/.kube/config

這樣我們就能在客戶端,無需登入 k8s 叢集的方式來訪問了,我在 macos 下訪問如下:

[email protected] ~$ kubectl config use-context shjq-dev01-chenqiang
Switched to context "shjq-dev01-chenqiang".
[email protected] ~$ kubectl get no
NAME           STATUS    ROLES     AGE       VERSION
10.130.14.67   Ready     <none>    15d       v1.9.3
10.130.14.68   Ready     <none>    70d       v1.9.3
10.130.14.73   Ready     <none>    70d       v1.9.3

我們也可以通過 kubectl config view 來檢視該檔案的配置。細心的你會進入 ~/.kube 看看發生了什麼,
發現生成了 cachehttp_cache 兩個資料夾,

[email protected] ~$ cd ~/.kube/
[email protected] .kube$ ll
total 16
drwxr-xr-x   4 chenqiang  staff   128 May 24 18:26 cache
[email protected]  1 chenqiang  staff  7296 May 24 18:25 config
drwxr-xr-x  31 chenqiang  staff   992 May 24 18:25 http-cache

如何在多個叢集間切換kubectl?

具體步驟與第二步相同,主要是新增相應的user和cluster即可。使用 use-context 來進行切換,大概類似:

[email protected] ~$ kubectl config use-context shjq-uat01
Switched to context "shjq-uat01".
[email protected] ~$ kubectl get no
NAME            STATUS    ROLES     AGE       VERSION
10.130.247.31   Ready     <none>    16d       v1.9.3
10.130.248.8    Ready     <none>    3d        v1.9.3
10.130.33.11    Ready     <none>    41d       v1.9.3
10.130.33.12    Ready     <none>    41d       v1.9.3
10.130.33.13    Ready     <none>    41d       v1.9.3
10.130.33.8     Ready     <none>    41d       v1.9.3
[email protected] ~$ kubectl config use-context shjq-dev01-chenqiang
Switched to context "shjq-dev01-chenqiang".
[email protected] ~$ kubectl get no
NAME           STATUS    ROLES     AGE       VERSION
10.130.14.67   Ready     <none>    16d       v1.9.3
10.130.14.68   Ready     <none>    70d       v1.9.3
10.130.14.73   Ready     <none>    70d       v1.9.3

下面給出多叢集的 kubeconfig 參考配置。

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZuVENDQTRXZ0F3SUJBZ0lKQVBuVlJIdW9zZXpqTUEwR0NTcUdTSWIzRFFFQkN3VUFNR1V4Q3pBSkJnTlYKQkFZVEFrTk9NUkV3RHdZRFZRUUlEQWhUYUdGdVoyaGhhVEVQTUEwR0ExVUVCd3dHVUhWa2IyNW5NUll3RkFZRApWUVFLREExellXbGpiVzkwYjNJdVkyOXRNUXd3Q2dZRFZRUUxEQU5yT0hNeEREQUtCZ05WQkFNTUEyczRjekFlCkZ3MHhPREF6TURnd05qSTJORE5hRncweE9UQXpNRGd3TmpJMk5ETmFNR1V4Q3pBSkJnTlZCQVlUQWtOT01SRXcKRHdZRFZRUUlEQWhUYUdGdVoyaGhhVEVQTUEwR0ExVUVCd3dHVUhWa2IyNW5NUll3RkFZRFZRUUtEQTF6WVdsagpiVzkwYjNJdVkyOXRNUXd3Q2dZRFZRUUxEQU5yT0hNeEREQUtCZ05WQkFNTUEyczRjekNDQWlJd0RRWUpLb1pJCmh2Y05BUUVCQlFBRGdnSVBBRENDQWdvQ2dnSUJBSy9lNG11QTR6VXRCRzdXdFhDN0o0NmpkQXhabVltaDZXL2oKelRwemlyOHlLY3ZvY3gvRUxQWjZxVmRTWFpKUGI1SUtDMVJBSnoveE0ycHZVNW9BemdSYzhpbnh6M0FGSEJaTQoxb0hWb0lxNXBWRzBYVkJ0Nm8xTjE2bXlySGFDZ3dQTG55dFE1bGhKRDA5c2FmbUlHU1NoVGt0QjZKZGhBLzd5CjFvbDhOTHJGbnpCSDQvOG9Od0NDaHkrcUdYVE9hNTY2UzhjNW5vQ2c2TlovTGxZVjFLUHlJdjFMblRmd3VselUKenpSTGUwVkRjZXpwUmY0RnJ4TV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LT01YZGZBClhYcWNZcVpXbHRyc2VyREthc3haMzBPWU1hSDJSd05qdlpBcVFSVmF1bGlpRjhmZUpsSHQ5SlpIVDQ1ZFBDYU8KQmM5NzNyYlVKL3haWXhVcE9OYUNsOXZWNVpEb0Q0eTJUU3g1QzFpTS9VMWFOS2Q1Rld3dytFN0dacExpQ0Z4NApIQVI1Ujg0Y0JqYkdMRzlxTFdhK1RUTFFlWnJIdXExTlRtYkRDdHRpSlZ3Rk03YmlpNWVUUHNKQWF1UkZTNzQ0CjdRPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
    server: https://10.130.33.254:443
  name: shjq-uat01-cluster
contexts:
- context:
    cluster: shjq-dev01-chenqiang-cluster
    user: shjq-dev01-chenqiang-user
  name: shjq-dev01-chenqiang
- context:
    cluster: shjq-uat01-cluster
    user: shjq-uat01-user
  name: shjq-uat01
current-context: shjq-dev01-chenqiang
kind: Config
preferences: {}
users:
- name: shjq-dev01-chenqiang-user
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBakNDQWVvQ0NRQ0NhYWdFUnFmNExEQU5CZ2txaGtpRzl3MEJBUXNGQURCbE1Rc3dDUVlEVlFRR0V3SkQKVGpFUk1BOEdBMVVFQ0F3SVUyaGhibWRvWVdreER6QU5CZ05WQkFjTUJsQjFaRzl1WnpFV01CUUdBMVVFQ2d3TgpjMkZwWTIxdmRHOXlMbU52YlRFTU1Bb0dBMVVFQ3d3RGF6aHpNUXd3Q2dZRFZRUUREQU5yT0hNd0hoY05NVGd3Ck5USXlNRGN5TURVNVdoY05Nekl3TVRJNU1EY3lNRFU1V2pBaE1SOHdIUVlEVlFRRERCWnJPSE10YldGemRHVnkKTFRFdWJtOTJZV3h2WTJGc01JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBeUI4dgozeWI5akZsUVNMdy9RWGlVMnBXRnJOYzYwdG5qdWVYeTd4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OWkvVkF2U2dnOS91alpZV1hVdmt3QVhGV0VSZHh5MFlHbW9HYzJWeURxN2taQ21ld3duUGs3L0hBUgpQZnhlM1hDdnYzRlJoeVhzOHd5V0ZzZHdZRSt1THlHYkVqT2pLWDAvczRGckdrNVdpbkRPUlFKZTRKZkxPVDUrCkprckZOUUtCZ1FEZlRNMHJ1UDcwTmdYcTJBQUVtYjA2eDRLWGU4MjJpWW1oOUZFc2dxWS9CeVArV2VjQkUwdmQKVWlwVGlRQm5nRFJUSHBpTGVGb1M3NVhSb0RvSDB3MUpyZ0pFRDQ4R253U3A3QjhocUJISmh4RlgzckFiZlFOeAppYnBEM1Z5K0FjejAwZXc5RFlXZ2ptdFVhMTVyTVhKdGRzUzUwUDdOeG1aWW9xbFlJOHZYaFE9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=

相關推薦

如何手動建立 k8s kubeconfig 檔案實現環境切換

這篇檔案簡單介紹一下叢集環境中如何配置kubectl,以及如何製作 kubeconfig 檔案,以使用 kubectl config 來實現切換多種k8s環境,官方有相應的文件,這裡簡要介紹一下如何手動生成這個 config 檔案。 1、叢集環境中如何配置

SpringBoot 使用properties配置檔案實現環境配置

一.前言 實際專案開發過程中會用到多個環境,比如dev,test,product環境,不同的環境可能使用不同引數,為便於部署提高效率,本篇主要通過properties配置檔案來實現多環境的配置。 二.多環境配置實現 分別建立application-dev.properties,application-te

將Linux系統轉換為ISO映象檔案實現備份

操作環境為Ubuntu14.04 LTS,近日在Ubuntu上搭建了Git伺服器及很多其他配置,想將已安裝好的系統轉換為ISO檔案,這樣可以實現備份具體步驟如下: 1.首先,開啟在/etc/apt/sources.list檔案(使用vim或者gedit均可); 2.根據具體

ionic2 基於ngx-translate實現語言切換,翻譯

click create -a fault template con 設置 切換 使用 介紹 ngx-translate 是Angular 2+的國際化(i18n)庫,在github的地址是箭頭 https://github.com/ngx-translate/core 將

使用maven profile實現環境配置相關打包

本地 ces 軟件測試 測試 project oca rect fault uil 項目開發需要有多個環境,一般為開發,測試,預發,正式4個環境,通過maven可以實現按不同環境進行打包部署,命令為: mvn package -P dev 在eclipse中可以右擊選項r

MAVEN實現環境搭建

director arch 目錄 packaging res ring add build 故障排除 在實際的開發中,會遇到開發環境的不同(開發環境,測試環境,線上環境),會來回根據環境的不同修改配置文件,一不小心修改錯誤導致無法正常運行,故障排除導致開發效率低。使用mav

Puppet 之 Master/agent配置與實現環境

master agent 多環境1 概述Puppet通過master/agent模型的方式,實現環境中的agent能主動同步master定義的狀態。實現配置的統一。同時,我個人認為多環境是master/agent模型的擴展,因此放到到同一篇文章中介紹。2 Master/agent模型的2.1 概念介紹默

SpringBoot實現環境配置

running source ted ram exp active start 數據 amp 1.為什麽需要配置多環境配置 在實際的開發中,我們往往需要在不同的環境中使用不同的數據庫、緩存配置,如果使用同一套配置文件,在不同環境部署的時候手動去修改配置文件,會使部署變得很繁

webpack的DefinePlugin外掛實現環境下配置切換

webpack的DefinePlugin外掛實現多環境下配置切換 文章目錄 前言 例項 專案實戰 前言 在使用springboot開發後臺時,可以使用spring.profies.active實現應用程式在不同的環境可能會有不同

利用vue-i18n實現語言切換

在angular中有ngx-translate解決i18n的需求,vue也具備這樣的能力,利用vue-i18n,我們可以實現多語言的切換,可以輕鬆搞定大部分的需求,包括中英文切換,以及詞條的變更。詞條變更在基線版本真的是經常會遇到的,本人深有體會。不扯淡了,說一下vue-i18n基本的使

SpringBoot31 整合SpringJDBC、整合MyBatis、利用AOP實現資料來源切換

  一、整合SpringJDBC 1  JDBC   JDBC(Java Data Base Connectivity,Java 資料庫連線)是一種用於執行 SQL 語句的 Java API,可以為多種關係資料庫提供統一訪問,它由一組用 Java 語言編寫的類和介面組成。JDBC 提

Spring boot 的profile功能如何實現環境配置自動切換

通常服務端應用開發需要經過以下幾個流程: 開發 -> 測試 -> RC驗證 -> 上線 這就涉及到四個不同的環境,開發環境、測試環境、RC環境以及生產環境,為了避免不同環境之間相互干擾,通常需要獨立部署資料庫、快取伺服器等,那麼應用配置也要做相應的調整。

Python—OpenCV建立級聯檔案(Windows7/10環境

目錄 搭建環境 準備資料集 訓練級聯檔案 之前使用Python+OpenCV實現交通路標識別,具體實現步驟及心得如下: OpenCV訓練屬於自己的xml檔案,需以下幾個步驟: 1、首先下載OpenCV(Windows版);      &n

Android CoordinatorLayout實現列表切換並和頭佈局聯動;

注意:不是雙列表聯動,是多列表和頭佈局聯動; 大概就是和餓了麼店鋪首頁類似的佈局框架吧,頭佈局顯示時,列表RecyclerView或ScrollView和頭佈局一起滾動,頭佈局完全隱藏後列表再去滾動,可以多個列表切換; 有空再上圖看效果吧; 1、主要的佈局檔案,註釋寫的很清楚; &l

【轉】maven profile實現環境打包

作為一名程式設計師,在開發的過程中,經常需要面對不同的執行環境(開發環境、測試環境、生產環境、內網環境、外網環境等等),在不同的環境中,相關的配置一般不一樣,比如資料來源配置、日誌檔案配置、以及一些軟體執行過程中的基本配置。每次在不同環境部署程式時,都需要修改相應的配置檔案,使之完成環境的配置。這麼

Java-SpringBoot-實現環境配置

SpringBoot實現多環境配置       Boos讓我對資源進行優化,動態sql改成指定sql,資料庫至少可以連線兩種Mysql,Oracle,連線不同的資料庫,走不同的配置,執行相對應的sql語句   多資料來源配置 建立一

SpringBoot+MongoDB實現租戶切換

目標:實現不同分組的使用者訪問自己的專用資料庫(資料庫在同一個伺服器).例:A公司使用者,僅可訪問A公司的專用資料庫 要求:MongoDB + SpringBoot Pom依賴: <parent> <groupId>org.s

Spring使用Spring的AbstractRoutingDataSource實現資料來源切換

最近因為專案需要在做兩個專案間資料同步的需求,具體是專案1的資料通過訊息佇列同步到專案2中,因為這個更新操作還涉及到更新多個庫的資料,所以就需要多資料來源切換的操作。下面就講講在Spring中如何進行資料來源切換。這裡是使用AbstractRoutingDataSource類

Spring Boot通過Profiles實現環境下配置切換

1、在yml中使用pom定義的maven屬性變數 格式:@[email protected] spring: application: name: dream-web-gateway profiles: active: '@[

Spring AOP實現資料來源切換

有時候我們會遇到這樣的場景:一個應用系統中存在多個數據源,需要根據不同業務場景進行臨時切換。比如讀寫分離(也可以考慮使用Mycat等資料庫中介軟體)等。 Spring提供了動態資料來源的功能,可以讓我們實現在對資料庫操作前進行切換。 下面我們演示怎麼在專案中配置多資料來源並根據不用業務場