惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - 哈喽哈喽111111

RockyLinux SSH 跳板转发 3389(Windows 远程桌面)完整方案 MySQL使用自带的logrotate配置日志轮转 yum方式安装redis7 nacos新加用户操作 网络运营商禁止端口信息 Linux开机启动rc.local不生效的一般解决方案 Nginx流量拷贝ngx_http_mirror_module模块使用方法详解 Adobe 修改 hosts 文件 axios 投毒与好莱坞式骗术 Linux系统在使用systemctl启动服务的失败,报错如下:Error No space left on device git submodule 的增、查、改、删 Rocky Linux 安装 Google Chrome 浏览器 “头号玩家”—— 美国技术霸权下的全球虚拟货币资产收割行动深层解析 你是第几级 AI 编程 MySQL中通过关联update将一张表的一个字段更新到另外一张表中 Linux 的 Port Knocking 端口碰撞(端口敲门) MySQL解除死锁 jar文件解压缩操作 设置Windows服务器远程桌面能使用多个桌面 20251024- 使用shell脚本分库定时备份MySQL数据 禁用sentinel 在 Linux 中安装和配置 NTP 服务器和 NTP 客户端 springboot配置文件关系及加载顺序 用自带的Nginx为gitlab做白名单 Rocky9和Ubuntu使用pip安装python的库mysqlclient失败解决方式
在Spring Boot Admin中根据Nacos的命名空间来区分和管理不同的环境
哈喽哈喽111111 · 2025-09-09 · via 博客园 - 哈喽哈喽111111
在 Spring Boot Admin 中,可以通过结合 Nacos 的命名空间(Namespace)功能来区分和管理不同的环境(如开发、测试、生产等)。

以下是实现这一目标的步骤和方法:

1. Nacos 命名空间配置
Nacos 的命名空间功能可以隔离不同环境的配置和服务。首先,在 Nacos 中为每个环境创建独立的命名空间:

开发环境:例如 dev
测试环境:例如 test
生产环境:例如 prod

在 Nacos 控制台中,可以通过以下步骤创建命名空间:

登录 Nacos 控制台。
进入“命名空间”页面。
点击“新建命名空间”,填写命名空间 ID 和名称(如 dev、test、prod)。

2. Spring Boot Admin 配置
Spring Boot Admin 需要能够识别和区分来自不同命名空间的客户端实例。以下是关键配置点:

(1) 客户端配置
在每个 Spring Boot 客户端应用中,配置 Nacos 的命名空间:

spring:
cloud:
nacos:
discovery:
namespace: dev # 根据环境替换为对应的命名空间 ID
config:
namespace: dev # 根据环境替换为对应的命名空间 ID


3. 多环境部署
如果 Spring Boot Admin 需要管理多个环境的实例,可以:
部署多个 Admin 服务:每个环境一个 Admin 服务,分别配置对应的 Nacos 命名空间。

意思是说
A应用注册到nacos的dev命名空间,则再在dev命名空间部署一个Admin 服务,假设Admin 服务端口号是5001,则访问Admin 服务的dashboard的时候用的端口号是5001
B应用注册到nacos的test命名空间,则再在test命名空间部署一个Admin 服务,假设Admin 服务端口号是5002,则访问Admin 服务的dashboard的时候用的端口号是5002