当前位置: 首页 > news >正文

做网站彩票代理多少钱啊网站的绝对路径

做网站彩票代理多少钱啊,网站的绝对路径,营销型网站价格实惠,自适应手机模板前言 Eureka 是 Netflix 公司开发的一款开源的服务注册与发现组件。 Spring Cloud 使用 Spring Boot 思想为 Eureka 增加了自动化配置#xff0c;开发人员只需要引入相关依赖和注解#xff0c;就能将 Spring Boot 构建的微服务轻松地与 Eureka 进行整合。 1、Eureka 两大组…前言 Eureka 是 Netflix 公司开发的一款开源的服务注册与发现组件。 Spring Cloud 使用 Spring Boot 思想为 Eureka 增加了自动化配置开发人员只需要引入相关依赖和注解就能将 Spring Boot 构建的微服务轻松地与 Eureka 进行整合。 1、Eureka 两大组件 Eureka 采用 CSClient/Server客户端/服务器 架构它包括以下两大组件Eureka Server、Eureka Client 组件介绍Eureka ServerEureka 服务注册中心主要用于提供服务注册功能Eureka ClientEureka 客户端通常指的是微服务系统中各个微服务 2、Eureka 服务注册与发现 功能介绍服务注册中心Register Service它是一个 Eureka Server用于提供服务注册和发现功能。服务提供者Provider Service它是一个 Eureka Client用于提供服务。它将自己提供的服务注册到服务注册中心以供服务消费者发现。服务消费者Consumer Service它是一个 Eureka Client用于消费服务。它可以从服务注册中心获取服务列表调用所需的服务。 3、案例 3.1、创建主工程 名称SpringCloud 3.1.1、主工程pom.xml配置 ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersionpackagingpom/packagingparentgroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-parent/artifactIdversion2.6.13/versionrelativePath/ !-- lookup parent from repository --/parentgroupIdcom.hqyj/groupIdartifactIddrp/artifactIdversion0.0.1-SNAPSHOT/versionnamedrp-parent/namedescriptionDemo project for Spring Boot/descriptionpropertiesmaven.compiler.source8/maven.compiler.sourcemaven.compiler.target8/maven.compiler.targetproject.build.sourceEncodingUTF-8/project.build.sourceEncodingmaven.compiler.source1.8/maven.compiler.sourcemaven.compiler.target1.8/maven.compiler.targetjunit.version4.12/junit.versionlog4j.version1.2.17/log4j.versionlombok.version1.16.18/lombok.version/propertiesdependencyManagementdependenciesdependencygroupIdorg.springframework.cloud/groupIdartifactIdspring-cloud-dependencies/artifactIdversion2021.0.5/versiontypepom/typescopeimport/scope/dependency/dependencies/dependencyManagementbuildpluginsplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-compiler-plugin/artifactIdversion3.5.1/versionconfigurationsource${maven.compiler.source}/sourcetarget${maven.compiler.target}/target/configuration/plugin/plugins/build/project3.2、创建子公共模块common-api 3.2.1、添加module 3.2.2、pom.xml配置 ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersionparentgroupIdcom.hqyj/groupIdartifactIdSpringCloud/artifactIdversion0.0.1-SNAPSHOT/version/parentartifactIdcommon-api/artifactIdpropertiesmaven.compiler.source8/maven.compiler.sourcemaven.compiler.target8/maven.compiler.targetproject.build.sourceEncodingUTF-8/project.build.sourceEncoding/propertiesdependenciesdependencygroupIdorg.projectlombok/groupIdartifactIdlombok/artifactId/dependency/dependencies/project 3.2.3、maven非springboot项目增加main入口 添加Main.java指定main入口防止Maven package / install打包失败 public class Main {public static void main(String[] args) {System.out.println(common-api);}} 3.3、创建Eureka注册中心模块eureka-server 3.3.1、配置pom.xml ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersionparentgroupIdcom.hqyj/groupIdartifactIdSpringCloud/artifactIdversion0.0.1-SNAPSHOT/version/parentartifactIdeureka-server/artifactIdpropertiesmaven.compiler.source8/maven.compiler.sourcemaven.compiler.target8/maven.compiler.targetproject.build.sourceEncodingUTF-8/project.build.sourceEncodingskip-teststrue/skip-tests/propertiesdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependencydependencygroupIdorg.projectlombok/groupIdartifactIdlombok/artifactIdoptionaltrue/optional/dependencydependencygroupIdcom.github.enesusta/groupIdartifactIdspring-devtools/artifactIdversion1.0.1/versionoptionaltrue/optional/dependencydependencygroupIdorg.springframework.cloud/groupIdartifactIdspring-cloud-starter-netflix-eureka-server/artifactId/dependency/dependencies/project 3.3.2、配置application.yml 在resource目录下新建application.yml文件 编辑application.yml文件添加eureka配置 server:port: 7001eureka:instance:hostname: localhost #eureka服务端的实例名称client:register-with-eureka: false #false表示不向注册中心注册自己。fetch-registry: false #false表示自己端就是注册中心我的职责就是维护服务实例并不需要去检索服务service-url:defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ #单机版服务注册中心 3.3.3、启动eureka-server 创建EurekaServerApplication.java启动文件 import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;SpringBootApplication EnableEurekaServer public class EurekaServerApplication {public static void main(String[] args) {SpringApplication.run(EurekaServerApplication.class,args);} }3.3.3.1、编译eureka-server 3.3.3.2、运行EurekaServerApplication.java文件 启动http://localhost:7001/ 3.4、创建用户服务模块user-service 3.4.1、配置pom.xml ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersionparentgroupIdcom.hqyj/groupIdartifactIdSpringCloud/artifactIdversion0.0.1-SNAPSHOT/version/parentartifactIduser-service/artifactIdpropertiesmaven.compiler.source8/maven.compiler.sourcemaven.compiler.target8/maven.compiler.targetproject.build.sourceEncodingUTF-8/project.build.sourceEncoding/propertiesdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependency!--devtools 开发工具--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-devtools/artifactIdscoperuntime/scopeoptionaltrue/optional/dependency!--Spring Boot 测试--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependency!--junit 测试--dependencygroupIdjunit/groupIdartifactIdjunit/artifactIdversion4.12/version/dependency!-- 修改后立即生效热部署 --dependencygroupIdorg.springframework/groupIdartifactIdspringloaded/artifactIdversion1.2.8.RELEASE/version/dependencydependencygroupIdorg.springframework.cloud/groupIdartifactIdspring-cloud-starter-netflix-eureka-client/artifactId/dependencydependencygroupIdcom.hqyj/groupIdartifactIdcommon-api/artifactIdversion0.0.1-SNAPSHOT/version/dependency/dependencies/project3.4.2、配置application.yml server:port: 8001 spring:application:name: user-service #微服务名称 eureka:client: #将客户端注册到 eureka 服务列表内service-url:defaultZone: http://localhost:7001/eureka #这个地址是 7001注册中心在 application.yml 中暴露出来额注册地址 单机版3.4.3、启动user-service 创建UserApplication.java启动文件 import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;SpringBootApplication EnableDiscoveryClient public class UserApplication {public static void main(String[] args) {SpringApplication.run(UserApplication.class,args);} }3.4.3.1、编译user-service 3.4.3.2、运行UserApplication.java文件 3.4.3.3、测试 http://localhost:8001/user/userInfoList 3.5、查看编译后的包
http://www.w-s-a.com/news/882032/

相关文章:

  • 海外医疗兼职网站建设公司取名字大全免费
  • 龙口市规划建设局网站vi设计和品牌设计的区别
  • 企业网站的总体设计网站建设评审验收会议主持词
  • 网站建设完成推广响应式网站设计开发
  • 电商网站用php做的吗网站开发流程可规划为那三个阶段
  • flash网站怎么做音乐停止深圳网站建设金瓷网络
  • 哪个网站可以做房产信息群发怎么做国内网站吗
  • 微商城网站建设公司的价格卖磁铁的网站怎么做的
  • 免费做做网站手机平台软件开发
  • 网站单页做301徐州百度网站快速优化
  • 织梦怎么制作手机网站漳州专业网站建设公司
  • 邓州做网站网络优化概念
  • 查看网站开发phonegap wordpress
  • 网站建设和维护待遇怎样c 做的网站又哪些
  • 淮南网站推广网站开发行业前景
  • 丽水市龙泉市网站建设公司江门手机模板建站
  • 做化妆品注册和注册的网站有哪些wordpress加关键字
  • 四川新站优化php笑话网站源码
  • 外贸类网站酷玛网站建设
  • 合肥网站设计建设南宁网站seo推广优化公司
  • 临沂百度网站7x7x7x7x8黄全场免费
  • 海洋牧场网站建设大良网站设计价格
  • 手机端网站关键字排名北京seo公司哪家好
  • 福建建设培训中心网站网站建站服务公司地址
  • 青岛网站优化快速排名企业网址怎么整
  • 做公司网站用什么系统seo搜索排名优化方法
  • dw怎么做网站标题图标做网站重庆
  • 机场建设相关网站公司官网设计制作
  • 大学网站建设的目标技术支持 优府网络太原网站建设
  • wordpress设置密码访问带提示广州做网站优化哪家专业