添加eureka注册中心支持

This commit is contained in:
macro
2019-10-17 16:36:05 +08:00
parent feff3937ac
commit 47eaa3a5af
39 changed files with 192 additions and 1150 deletions

View File

@@ -2,7 +2,9 @@ package com.macro.mall.search;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@EnableDiscoveryClient
@SpringBootApplication
public class MallSearchApplication {

View File

@@ -16,4 +16,10 @@ spring:
elasticsearch:
repositories:
enabled: true
cluster-nodes: 127.0.0.1:9300
cluster-nodes: 127.0.0.1:9300
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://localhost:8001/eureka/

View File

@@ -1,6 +1,8 @@
spring:
profiles:
active: dev #默认为开发环境
application:
name: mall-search
server:
port: 8081