当前位置:网站首页>Micro service remote debug, nocalhost + rainbow micro service development second bullet
Micro service remote debug, nocalhost + rainbow micro service development second bullet
2022-07-07 20:16:00 【Rainbow open source】
In the previous article, we introduced how to pass Nocalhost Rapid development of Rainbond Microservices on , Introduced the basic development process .
This article will continue to introduce , Use Nocalhost Development profile Achieve the following :
- Onekey Run and long-range Debug
- Persistent configuration
- Development container resource limitations
- Port forwarding
What is development configuration ?
Development configuration is around Development mode
To carry out , For example, what image is used to enter Development mode
, Whether you need to turn on persistence to save the contents of the development container , Which files are synchronized into the development container , How to debug with one click 、 Run the services in the container with one click . After configuring the correct and appropriate development configuration , Can be used in Nocalhost Development mode
It's more handy when it comes to .
Deploy Rainbond + SpringCloud
Next, continue to the above article SpringCloud Pig For example , debugging Java Maven Service Pig-auth modular .
project Gitee Address :https://gitee.com/zhangbigqi/pig
Deploy Rainbond
I won't go into details here Rainbond Installation , see also be based on Linux install Rainbond.
Deploy SpringCloud
We are Rainbond After docking with the open source app store , Search in the open source app store Spring Cloud Pig
install 3.5.0
edition .
The English name of the application component installed from the app store is an automatically generated string , We need to set the English name of the component (Deployment Name), adopt Nocalhost When connecting to the cluster, you can distinguish clearly Deployment Corresponding components .
Nocalhost docking Rainbond
- install Nocalhost JetBrains Plugin plug-in unit , See documentation install Nocalhost JetBrains Plugin plug-in unit .
- obtain K8s Kubeconfig, See documentation obtain Kubeconfig file .
- stay
pig
Under the namespace , Find the workloadpig-auth
Right click and chooseDev Config
( Development configuration )
- Copy the following configuration file to
Dev Config
in .
# Deployment Name
name: pig-auth
serviceType: deployment
containers:
# Deployment Main container name
- name: auth
dev:
# Developing mirroring , The image contains Java Maven Environmental Science
image: registry.cn-hangzhou.aliyuncs.com/zqqq/maven:3.8.6-openjdk-8
# The default terminal is bash
shell: bash
# Rainbond Provided StorageClass Name
storageClass: rainbondvolumerwx
# Configure development container resources
resources:
limits:
memory: 4096Mi
cpu: "2"
requests:
memory: 2048Mi
cpu: "1"
persistentVolumeDirs:
# Maven Depend on the package cache path , coordination storageClass Eat together
- path: /root/.m2/repository
capacity: 10Gi
command:
# One click start command , Install dependent packages and start pig-auth Sub module
run:
- mvn
- install
- '&&'
- mvn
- spring-boot:run
- -pl
# Specify sub module startup
- pig-auth
# Onekey Debug command , Install dependent packages and Debug pig-auth Sub module
debug:
- mvn
- install
- '&&'
- mvn
- spring-boot:run
- -pl
# Specify sub module startup
- pig-auth
# Java Debug command
- -Dspring-boot.run.jvmArguments=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
debug:
# Remote port , Corresponding Debug In the command address=5005
remoteDebugPort: 5005
# choice Java Language
language: java
# Thermal loading
hotReload: true
# File synchronization
sync:
type: send
mode: gitIgnore
deleteProtection: true
# Port forwarding , Forward... In the container 3000 Port to local 3999
portForward:
- 3999:3000
Onekey Run
- Right click workload
pig-auth
. - choice Remote Run.
- Nocalhost Will automatically enter DevMode And implement Remote Run.
Onekey Debug
- Right click workload
pig-auth
. - choice Remote Debug.
- Nocalhost Will automatically enter DevMode And implement Remote Debug.
- Put a breakpoint in the code , Initiate request , Get into IDE Debug Pattern .
Persistent configuration
At development time , Most of the files we want to persist are Dependency package
journal
, This article also caches Java The dependency package of .
rainbondvolumerwx
yes Rainbond The storage class provided by default , After filling in the following configuration, it will be automatically created under the current namespace PVC, as follows :
storageClass: rainbondvolumerwx
persistentVolumeDirs:
- path: /root/.m2/repository
capacity: 10Gi
Container resource limit
Limit the resources of the development container , Quota can maximize the resource utilization of the server , You can modify it through the following development configuration :
resources:
limits:
memory: 4096Mi
cpu: "2"
requests:
memory: 2048Mi
cpu: "1"
Port forwarding
Forward container port to local , You can modify it through the following development configuration :
portForward:
- 3999:3000 # Forwarding container 3000 Port to local 3999 port
Last
Of course Nocalhost You can debug multiple microservices at the same time , In the same way, you only need to modify Deployment Name and Containers Name And the sub module of microservice .
Nocalhost There are also some things that are not mentioned in the development configuration article , such as : Development environment variables 、 Two modes of file synchronization pattern
gitignore
wait , also Nocalhost Support for multiple languages ,Java It's just one of them , Guys can explore on their own .
Nocalhost + Rainbond Let's develop 、 More efficient deployment 、 convenient .
边栏推荐
- openEuler 有奖捉虫活动,来参与一下?
- 剑指 Offer II 013. 二维子矩阵的和
- openEuler 资源利用率提升之道 01:概论
- kubernetes之创建mysql8
- 【解决】package ‘xxxx‘ is not in GOROOT
- 编译器优化那些事儿(4):归纳变量
- Leetcode force buckle (Sword finger offer 36-39) 36 Binary search tree and bidirectional linked list 37 Serialize binary tree 38 Arrangement of strings 39 Numbers that appear more than half of the tim
- 831. KMP string
- LeetCode力扣(剑指offer 36-39)36. 二叉搜索树与双向链表37. 序列化二叉树38. 字符串的排列39. 数组中出现次数超过一半的数字
- 使用高斯Redis实现二级索引
猜你喜欢
Yolov6:yolov6+win10--- train your own dataset
CIS芯片测试到底怎么测?
AIRIOT助力城市管廊工程,智慧物联守护城市生命线
openEuler 资源利用率提升之道 01:概论
Opencv学习笔记 高动态范围 (HDR) 成像
ASP.NET学习& asp‘s one word
编译器优化那些事儿(4):归纳变量
写了个 Markdown 命令行小工具,希望能提高园友们发文的效率!
Leetcode force buckle (Sword finger offer 36-39) 36 Binary search tree and bidirectional linked list 37 Serialize binary tree 38 Arrangement of strings 39 Numbers that appear more than half of the tim
MRS离线数据分析:通过Flink作业处理OBS数据
随机推荐
力扣 2315.统计星号
力扣 459. 重复的子字符串
mysql 的一些重要知识
Detailed explanation of Flink parallelism and slot
一文读懂数仓中的pg_stat
Some arrangements about oneself
AIRIOT助力城市管廊工程,智慧物联守护城市生命线
Some important knowledge of MySQL
Force buckle 912 Sort array
力扣 989. 数组形式的整数加法
Precautions for cjson memory leakage
Equals method
浅尝不辄止系列之试试腾讯云的TUIRoom(晚上有约,未完待续...)
Welcome to the markdown editor
整型int的拼接和拆分
【解决】package ‘xxxx‘ is not in GOROOT
PHP method of obtaining image information
CIS芯片测试到底怎么测?
pom.xml 配置文件标签:dependencies 和 dependencyManagement 区别
CUDA versions are inconsistent, and errors are reported when compiling apex