Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
publicCloud
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张子昊
publicCloud
Commits
ac8480ed
Commit
ac8480ed
authored
Apr 27, 2025
by
张子昊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置更新
parent
816244b0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
17 deletions
+63
-17
eureka-server/src/main/resources/application-dev.yml
+32
-0
eureka-server/src/main/resources/application.yml
+10
-7
gateway/src/main/resources/application-dev.yml
+10
-5
gateway/src/main/resources/application.yml
+11
-5
No files found.
eureka-server/src/main/resources/application-dev.yml
0 → 100644
View file @
ac8480ed
server
:
port
:
7001
spring
:
application
:
name
:
public-eureka-server
security
:
user
:
name
:
name
password
:
password
eureka
:
server
:
# 保护模式(忽略高频注册/失效)
# enableSelfPreservation: false
# 缩短清理间隔(默认60秒,调整为5秒)
evictionIntervalTimerInMs
:
5000
instance
:
# 实例名,仅为名称,随意即可
instance-id
:
publicEureka
# 实例host,本地调试时,可以是localhost,实际上应为指向当前主机的域名,或使用ip模式
hostname
:
localhost
# ip-address: 127.0.0.1
# prefer-ip-address: true
client
:
# eureka单机时,无需构建eureka服务端集群,eureka服务机自然无需注册
registerWithEureka
:
false
# eureka单机时,无需同步其他服务机注册表
fetchRegistry
:
false
serviceUrl
:
# eureka单机时,eureka服务机的defaultZone无实际意义,只是不写会使用默认值并报错
defaultZone
:
http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname}:${server.port}/eureka/
\ No newline at end of file
eureka-server/src/main/resources/application.yml
View file @
ac8480ed
...
...
@@ -4,20 +4,23 @@ spring:
application
:
name
:
public-eureka-server
security
:
basic
:
enabled
:
false
user
:
name
:
name
password
:
password
eureka
:
instance
:
# 本地调试时,可以是localhost,实际上应为指向当前主机的域名,或使用ip模式
# 实例名,仅为名称,随意即可
instance-id
:
publicEureka
# 实例host,本地调试时,可以是localhost,实际上应为指向当前主机的域名,或使用ip模式
hostname
:
localhost
# ip-address: 127.0.0.1
# prefer-ip-address: true
client
:
# eureka单机时,无需构建eureka服务端集群,eureka服务机自然无需注册
registerWithEureka
:
false
# eureka单机时,无需同步其他服务机注册表
fetchRegistry
:
false
serviceUrl
:
defaultZone
:
http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname}:${server.port}/eureka/
# server:
# enable-self-preservation: false
\ No newline at end of file
# eureka单机时,eureka服务机的defaultZone无实际意义,只是不写会使用默认值并报错
defaultZone
:
http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname}:${server.port}/eureka/
\ No newline at end of file
gateway/src/main/resources/application-
test
.yml
→
gateway/src/main/resources/application-
dev
.yml
View file @
ac8480ed
...
...
@@ -16,21 +16,25 @@ spring:
# 开启从注册中心动态创建路由的功能,利用微服务进行路由
enabled
:
true
# 使用小写服务名,只能大写或小写,两者无法通过此配置兼容
lower-case-service-id
:
true
#
lower-case-service-id: true
eureka
:
server
:
# 自定义配置,简化、统一配置逻辑
#
target: localhost:7001
target
:
localhost:7001
# 使用公司 eureka
target
:
172.18.101.171:58336
#
target: 172.18.101.171:58336
instance
:
# 实例名,仅为名称,随意即可
instance-id
:
publicGateway
# 实例host,本地调试时,可以是localhost,实际上应为指向当前主机的域名,或使用ip模式
hostname
:
localhost
# ip-address: 127.0.0.1
# prefer-ip-address: true
client
:
# 作为公共gateway,自身不注册,仅提供对外转发
#
register-with-eureka: true
#
register-with-eureka: true
fetch-registry
:
true
service-url
:
#
defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@${eureka.server.target}/eureka
#
defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@${eureka.server.target}/eureka
defaultZone
:
http://${eureka.server.target}/eureka
\ No newline at end of file
gateway/src/main/resources/application.yml
View file @
ac8480ed
...
...
@@ -20,14 +20,20 @@ spring:
eureka
:
server
:
# 自定义配置,简化、统一配置逻辑
#
eureka服务目标(域名:端口)
自定义配置,简化、统一配置逻辑
target
:
localhost:7001
# 使用公司 eureka
# target: 172.18.101.171:58336
instance
:
# 实例名,仅为名称,随意即可
instance-id
:
publicGateway
# 实例host,本地调试时,可以是localhost,实际上应为指向当前主机的域名,或使用ip模式
hostname
:
localhost
# hostname: localhost
ip-address
:
127.0.0.1
prefer-ip-address
:
true
client
:
# 作为公共gateway,自身不注册,仅提供对外转发
register-with-eureka
:
fals
e
# register-with-eureka: tru
e
fetch-registry
:
true
service-url
:
defaultZone
:
http://${spring.security.user.name}:${spring.security.user.password}@${eureka.server.target}/eureka
\ No newline at end of file
defaultZone
:
http://${spring.security.user.name}:${spring.security.user.password}@${eureka.server.target}/eureka
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment