当前位置:网站首页>微服务远程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 还有一些开发配置文中没讲到的,比如:开发环境变量、文件同步的两种模式 patterngitignore 等等,并且 Nocalhost 支持多种语言,Java 只是其中一种,小伙伴们可以自行探索。
Nocalhost + Rainbond 让开发、部署更加高效、便捷。
边栏推荐
- Tcp/ip protocol stack
- Paint basic graphics with custompaint
- Overseas agent recommendation
- php 获取图片信息的方法
- Matplotlib drawing interface settings
- Revit secondary development - cut view
- Time standard library
- What is the difference between the three values of null Nan undefined in JS
- Reinforcement learning - learning notes 9 | multi step TD target
- 【Azure微服务 Service Fabric 】在SF节点中开启Performance Monitor及设置抓取进程的方式
猜你喜欢

Ueeditor custom display insert code

Remember aximp once Use of exe tool

#DAYU200体验官#MPPT光伏发电项目 DAYU200、Hi3861、华为云IotDA
![[JDBC Part 1] overview, get connection, CRUD](/img/53/d79f29f102c81c9b0b7b439c78603b.png)
[JDBC Part 1] overview, get connection, CRUD

Pdf document signature Guide

UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xf9 in position 56: illegal multibyte sequence

Implementation method of data platform landing
![[open source] Net ORM accessing Firebird database](/img/a2/4eff4f0af53bf3b9839a73019a212f.png)
[open source] Net ORM accessing Firebird database

客户案例|华律网,通过观测云大幅缩短故障定位时间

Ternary expressions, generative expressions, anonymous functions
随机推荐
Implementation method of data platform landing
Overseas agent recommendation
How does win11 unblock the keyboard? Method of unlocking keyboard in win11
Remember aximp once Use of exe tool
This experimental syntax requires enabling the parser plugin: ‘optionalChaining‘
PKPM 2020软件安装包下载及安装教程
Revit secondary development - collision detection
How to choose the appropriate automated testing tools?
IP网络主动测评系统——X-Vision
[interview arrangement] 0211 game engine server
C development -- WPF simple animation
Matplotlib drawing interface settings
Remember that a development is encountered in the pit of origin string sorting
php 获取图片信息的方法
客户案例|华律网,通过观测云大幅缩短故障定位时间
vite Unrestricted file system access to
Embedded development: how to choose the right RTOS for the project?
Kirin Xin'an operating system derivative solution | storage multipath management system, effectively improving the reliability of data transmission
OpeGL personal notes - lights
Attitude estimation (complementary filtering)