当前位置:网站首页>微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
2022-07-07 21:43:00 【51CTO】
之前的文章中我们介绍了如何通过 Nocalhost 快速开发 Rainbond 上的微服务,介绍了基本的开发流程。
本文将续接上文继续介绍,使用 Nocalhost 开发配置文件 实现以下内容:
- 一键 Run 和 远程Debug
- 持久化配置
- 开发容器资源限制
- 端口转发
什么是开发配置?
开发配置是围绕 开发模式
来进行的,例如使用什么镜像来进入 开发模式
,是否需要开启持久化来保存开发容器的内容,将哪些文件同步到开发容器中,如何一键调试、一键运行容器内的服务等。 配置了正确且合适的开发配置后,可以在使用 Nocalhost 开发模式
时更加得心应手。
部署 Rainbond + SpringCloud
接下来继续以上文中的 SpringCloud Pig 为例,调试 Java Maven 服务的 Pig-auth 模块。
项目 Gitee 地址: https://gitee.com/zhangbigqi/pig
部署 Rainbond
这里就不详细介绍 Rainbond 的安装,请参阅 基于Linux安装Rainbond。
部署 SpringCloud
我们在 Rainbond 内对接了开源应用商店后,在开源应用商店内搜索 Spring Cloud Pig
安装 3.5.0
版本。
来自应用商店安装应用组件的英文名称是自动生成的字符串,需要我们设置一下组件的英文名称(Deployment Name),通过 Nocalhost 连接到集群时可以很直观的分清楚 Deployment 对应的组件。
Nocalhost 对接 Rainbond
安装 Nocalhost JetBrains Plugin 插件,请参阅文档 安装Nocalhost JetBrains Plugin 插件。
获取 K8s Kubeconfig,请参阅文档 获取 Kubeconfig 文件。
在
pig
命名空间下,找到工作负载pig-auth
右击并选择Dev Config
(开发配置)
- 将以下配置文件复制到
Dev Config
中。
一键 Run
- 右击工作负载
pig-auth
。 - 选择 Remote Run。
- Nocalhost 会自动进入 DevMode 并执行 Remote Run。
一键 Debug
- 右击工作负载
pig-auth
。 - 选择 Remote Debug。
- Nocalhost 会自动进入 DevMode 并执行 Remote Debug。
- 在代码中打上断点,发起请求,进入 IDE Debug 模式。
持久化配置
在开发时,我们希望持久化的文件大多数都是 依赖包
日志
,本篇文章中也是缓存了 Java 的依赖包。
rainbondvolumerwx
是 Rainbond 默认提供的存储类,填写以下配置后会在当前命名空间下自动创建 PVC,如下:
容器资源限制
限制开发容器的资源,限额能让服务器的资源利用最大化,可以通过以下开发配置修改:
端口转发
转发容器端口到本地,可以通过以下开发配置修改:
最后
当然 Nocalhost 可以同时调试多个微服务,同样的方式只需修改配置文件中的 Deployment Name 和 Containers Name 以及微服务的子模块。
Nocalhost 还有一些开发配置文中没讲到的,比如:开发环境变量、文件同步的两种模式 pattern
gitignore
等等,并且 Nocalhost 支持多种语言,Java 只是其中一种,小伙伴们可以自行探索。
Nocalhost + Rainbond 让开发、部署更加高效、便捷。
边栏推荐
- Record problems fgui tween animation will be inexplicably killed
- Tcp/ip protocol stack
- Dayu200 experience officer MPPT photovoltaic power generation project dayu200, hi3861, Huawei cloud iotda
- Revit secondary development - collision detection
- Variables and constants
- How to make agile digital transformation strategy for manufacturing enterprises
- How to choose the appropriate automated testing tools?
- 三元表达式、各生成式、匿名函数
- [open source] Net ORM accessing Firebird database
- How to quickly check whether the opening area ratio of steel mesh conforms to ipc7525
猜你喜欢
如何选择合适的自动化测试工具?
Embedded development: how to choose the right RTOS for the project?
IP network active evaluation system -- x-vision
Jerry's initiation of ear pairing, reconnection, and opening of discoverable and connectable cyclic functions [chapter]
Where is the big data open source project, one-stop fully automated full life cycle operation and maintenance steward Chengying (background)?
三元表达式、各生成式、匿名函数
用语雀写文章了,功能真心强大!
Display optimization when the resolution of easycvr configuration center video recording plan page is adjusted
Application practice | the efficiency of the data warehouse system has been comprehensively improved! Data warehouse construction based on Apache Doris in Tongcheng digital Department
PKPM 2020 software installation package download and installation tutorial
随机推荐
Unity development --- the mouse controls the camera to move, rotate and zoom
. Net automapper use
[JDBC Part 1] overview, get connection, CRUD
微服务架构开源框架详情介绍
使用 BlocConsumer 同时构建响应式组件和监听状态
ByteDance Android interview, summary of knowledge points + analysis of interview questions
Remember aximp once Use of exe tool
OpenGL configuration vs2019
【Azure微服务 Service Fabric 】在SF节点中开启Performance Monitor及设置抓取进程的方式
OpenGL job - texture
Attitude estimation (complementary filtering)
Jerry's about TWS channel configuration [chapter]
Oracle advanced (VI) Oracle expdp/impdp details
Main functions of OS, Sys and random Standard Libraries
用语雀写文章了,功能真心强大!
Which futures company is the safest to open a futures account?
Revit secondary development - Hide occlusion elements
Customer case | China law network, through observing the cloud, greatly shortens the time of fault location
npm uninstall和rm直接删除的区别
[开源] .Net ORM 访问 Firebird 数据库