java版spring cloud 多租户社交电子商务--注册中心搭建

电子商务平台源码请加企鹅求求:三伍三六二四柒二五玖。springCloud和springBoot之间的区别:

springboot简化xml配置,快速整合框架

springcloud是一套微服务解决方案,主要用在RPC远程调用

springcloud和springboot之间的关系:springcloud(接口:springMV)依赖于springboot(web组件springMVC)。Spring Cloud大型企业分布式微服务云架构源码请加一七九一七四三三八零

搭建springCloud项目:

pom文件:



    4.0.0
 
    com.eureka
    demo
    0.0.1-SNAPSHOT
    jar
 
    eureak
    Demo project for Spring Boot
 
    
        org.springframework.boot
        spring-boot-starter-parent
        2.0.6.RELEASE
         
    
 
    
        UTF-8
        UTF-8
        1.8
    
 
    
        
            org.springframework.cloud
            spring-cloud-starter-eureka-server
        
 
        
            org.springframework.boot
            spring-boot-starter-web
        
 
        
            mysql
            mysql-connector-java
            runtime
        
        
            org.springframework.boot
            spring-boot-starter-test
            test
        
 
 
    
    
        
            
                org.springframework.cloud
                spring-cloud-dependencies
                Dalston.RC1
                pom
                import
            
        
    
 
    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
        
    
 
    
        
            spring-milestones
            Spring Milestones
            https://repo.spring.io/milestone
            
                false
            
        
    
 
 

配置文件

server:
  port: 8888
eureka:
  instance:
    hostname: localhost
  client:
    registerWithEureka: false
    fetchRegistry: false
    serviceUrl:
      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

启动类:

package com.eureka.demo;
 
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
 
public class EureakApplication {
 
    public static void main(String[] args) {
 
        SpringApplication.run(EureakApplication.class, args);
    }
}

你可能感兴趣的:(java版spring cloud 多租户社交电子商务--注册中心搭建)