欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

SpringCloudConfig入門-創(chuàng)新互聯(lián)

1.    簡介

創(chuàng)新互聯(lián)專業(yè)IDC數(shù)據(jù)服務器托管提供商,專業(yè)提供成都服務器托管,服務器租用,雅安移動機房,雅安移動機房,成都多線服務器托管等服務器托管服務。

Spring Cloud Config 是用來為分布式系統(tǒng)中為微服務應用提供集中化的外部配置支持,主要分為Spring Cloud Config Server(服務器端)和Spring Cloud Config Client(客戶端)。

2.    Spring Cloud Config Server

Spring Cloud Config Server為服務器端,它是一個單獨的微服務應用,用來連接配置倉庫(本文使用的是git倉庫)并為客戶端獲取配置信息。

1.     首先,創(chuàng)建config server工程

打開http://start.spring.io/

Spring Cloud Config 入門

填寫好Group、Artifact。選擇依賴的包有Config Server。

對應的pom.xml為

<dependencies>

     <dependency>

         <groupId>org.springframework.cloud</groupId>

         <artifactId>spring-cloud-config-server</artifactId>

     </dependency>

     <dependency>

         <groupId>org.springframework.boot</groupId>

         <artifactId>spring-boot-starter-web</artifactId>

     </dependency>

     <dependency>

         <groupId>org.springframework.boot</groupId>

         <artifactId>spring-boot-starter-test</artifactId>

         <scope>test</scope>

     </dependency>

</dependencies>

2.     將下載下來的項目導入Eclipse。

目錄結構如下,我這里面新增了bootstrap.yml

Spring Cloud Config 入門

3.     修改配置

在application.yml中添加

      server:

     port: 8080

在bootstrap.yml中添加

spring:

 cloud:

   config:

     server:

       git:

         uri: https://github.com/DevinXin/config-repo

注意:ConfigServerApplication,Spring Boot 啟動類上需要添加@EnableConfigServer注解

Spring Cloud Config 入門

4.     啟動configServer

通過訪問http://localhost:8080/master/foobar-dev.properties可以讀到git上的配置文件。

Spring Cloud Config 入門

3.    Spring Cloud Config Client

Spring Cloud Config Client為客戶端,客戶端通過配置連接服務器端,從服務器端加載配置信息。

1.     創(chuàng)建config client工程

同config server工程創(chuàng)建一樣,依賴需要web,Config Client

對應的pom.xml為:

<dependencies>

     <dependency>

         <groupId>org.springframework.cloud</groupId>

         <artifactId>spring-cloud-starter-config</artifactId>

     </dependency>

     <dependency>

         <groupId>org.springframework.boot</groupId>

         <artifactId>spring-boot-starter-web</artifactId>

     </dependency>

     <dependency>

         <groupId>org.springframework.boot</groupId>

         <artifactId>spring-boot-starter-test</artifactId>

         <scope>test</scope>

     </dependency>

  </dependencies>

2.     修改配置

application.yml配置為

   server:

   port: 8081

bootstrap.yml配置為

    spring:

     cloud:

       config:

         uri: http://localhost:8080/

         profile: dev

         label: master

     application:

       name: foobar

3.     寫一個Controller

Spring Cloud Config 入門

4.     啟動config Client。

訪問http://localhost:8081/configServer

可以從config Server中獲取到配置文件中的值。

Spring Cloud Config 入門

另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。

名稱欄目:SpringCloudConfig入門-創(chuàng)新互聯(lián)
URL鏈接:http://aaarwkj.com/article20/dpeijo.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作定制開發(fā)、做網(wǎng)站網(wǎng)站維護、響應式網(wǎng)站、網(wǎng)站建設

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

h5響應式網(wǎng)站建設
精品国产一区二区日韩91| 亚洲熟妇av乱码在线| 97超频在线观看免费| 人人妻人人澡人人爽人人dvd| 色综合色很天天综合色| 亚洲一区二区三区香蕉不卡| 婷婷av一区二区三区| 欧美日韩国产看片一区二区| 国产网红女主播视频一区二区| 日本的一级片一区二区| 午夜视频在线观看日韩| 亚洲成色在线综合剧情网站 | 国产av超爽剧情系列| 欧美黄片视频免费观看| 最新国产激情福利网站| 青青草原综合视频在线| 国产无遮挡又黄又爽网站| 中国亚洲黄色录像免费看| 日本黄色免费在线观看网站| 四虎海外永久免费地址| 密臀av一区二区三区| 国产成人原创免费观看| 亚洲啪啪av一区二区三区| 夫妻晚上同房太猛视频| 日本性电影一区二区| 亚洲精品中的亚洲精品| 亚洲一二三区精品与老人| 熟女乱熟乱熟妇综合网二区| 亚洲一区二区三区视频在线观看 | 中文字幕久久一区二区三区| 国产国产乱老熟视频网站| 青草视频在线播放免费| 日本91免费在线观看| 四虎永久精品在线视频| 日韩精品诱惑一区二区| 亚洲福利网址一二三区| 92午夜福利在线视频| 丰满少妇亚洲中文字幕| av全欧国男人在线天堂| 午夜福利尤物一区二区| 美女诱惑福利视频久久久|