![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springcloud
@我不是大鹏
上尚若水
展开
-
springcloud和springboot对应版本匹配
1、官方网站,直接转json https://start.spring.io/actuator/info 2、对应版本 "spring-cloud":{ "Hoxton.SR12":"Spring Boot >=2.2.0.RELEASE and <2.4.0.M1", "2020.0.0-M3":"Spring Boot >=2.4.0.M1 and <=2.4.0.M1", "2020.0.原创 2021-08-02 15:49:06 · 1044 阅读 · 0 评论 -
springcloud,consul作为注册服务中心的使用
一、下载地址 官网 https://www.consul.io/downloads.html 或者我的网盘,服务到位吧 链接:https://pan.baidu.com/s/1G3J4-N1I8tkk9Bxcyj_Vpw 提取码:cid4 复制这段内容后打开百度网盘手机App,操作更方便哦 启动consul,在consul目录下面cmd consul agent -dev http://localhost:8500/ui/dc1/services 查看这个界面我还是蛮喜欢的,哈哈哈 然后呢,跟之前原创 2020-12-15 22:52:12 · 144 阅读 · 0 评论 -
springcloud,搭建zookeeper注册中心,替代eureka
zookeeper是一个分布式协调工具,可以实现注册中心功能 在centos下安装好zookeeper 1、关闭Linux服务器防火墙后启动zookeeper服务器 2、在之前的父工程中新建module,zookeeper-privide-8004 引入pom <dependencies> <dependency> <groupId>com.atguigu.springcloud</groupId>原创 2020-12-14 22:35:33 · 165 阅读 · 0 评论 -
springcloud,搭建eureka集群(已暂停维护更新,但大规模使用)
下面为单机版,后面为集群 一、在之前的父工程中新建module eureka服务1 eureka-server7001 eureka-server7002 二、引入pom <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-eureka-server --> <dependency> <groupId原创 2020-12-13 19:51:24 · 357 阅读 · 0 评论 -
springcloud新建子模块
一、在上一讲中的父工程中右击新建module,选maven创建,不选骨架 二、配置工程 1、引入pom 在父工程中定义的版本号,所以父工程中有的不用引入版本号 <dependencies> <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web web工程依赖--> <dependency>原创 2020-12-13 14:16:44 · 2210 阅读 · 0 评论 -
springcloud,新建父工程(聚合工程)初始化项目
一,打开idea 如图新建 1、 2、 3、配置maven 4,点击完成,自动导入相关的包,等待下载完成 二、配置idea的环境 1、修改编码为uff-8,右击左上角file—>setting,如下图设置 2、注解激活生效 同上步setting, 3、选择java编译版本 同上步 4、filretype过滤显示的目录 三、修改父工程的pom 刪除src文件夾,是一個工程不需要,修改packaging為pom 增加pom文件内容 <packaging>pom</p原创 2020-12-12 19:36:13 · 198 阅读 · 0 评论 -
ribbon自定义配置规则
一、新建一个包,不要和component能扫描不要和启动类在一个包下 com.thunisoft.myrule 二、上面包下新建MySelfRule规则类 @Configuration public class MySelfRule { @Bean public IRule myRule(){ return new RandomRule();//定义为随机 } } 三、主启动类添加@RibbonClient ====================== ...原创 2020-11-01 22:42:01 · 686 阅读 · 0 评论 -
consul的安装和使用consul注册服务
一、安装consul windows下解压完consul,在当前根路径cmd,然后启动consul consul agent -dev 二、访问consul http://localhost:8500 三、注册服务端pom <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-st原创 2020-11-01 21:00:23 · 517 阅读 · 0 评论 -
Vue之Axios跨域问题前端解决
一、既然使用axios直接跨域访问不可行,我们就需要配置代理, 只要安装了axios就可以。 安装操作如下 npm install axios --save-dev 二、配置BaseUrl,在main.js中,配置数据所在服务器的前缀,在头部代码如下: import axios from 'axios' Vue.prototype.$axios = axios axios.defaults.baseURL = '/api' //关键代码 三、配置代理 在config文件夹下的index.js文件中的p原创 2020-10-30 16:41:09 · 705 阅读 · 0 评论 -
eureka使用搭建
一、建工程,引入pom <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId> </dependency> 二、配置yml server: port: 700原创 2020-10-28 22:47:51 · 135 阅读 · 0 评论 -
RestTemplate远程rpc调用
1、新建配置类 ApplicationContextConfig package com.atguigu.springcloud.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.client.RestTemplate; @Configuration原创 2020-10-28 20:31:23 · 589 阅读 · 0 评论 -
idea配置热部署
一、加入pom <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> 二、加入编译原创 2020-10-28 20:01:29 · 373 阅读 · 0 评论