微服务开发神器之JRebel 插件破解和实现本地及远程热部署教程

本文涉及的产品
服务治理 MSE Sentinel/OpenSergo,Agent数量 不受限
云原生网关 MSE Higress,422元/月
注册配置 MSE Nacos/ZooKeeper,118元/月
简介: 微服务开发神器之JRebel 插件破解和实现本地及远程热部署教程

IntelliJ IDEA版


为什么要用热部署?如果你公司使用微服务开发,你使用了一段时间的jenkins集成开发部署,你会发现即使有了这一套集成开发环境,假如我让你改个变量…你就需要跑一次jenkins,麻烦倒不麻烦,主要是花费太长的时间,所以开发阶段用远程服务热部署会更加方便和前端的对接,这也是这篇文章着重说的一点。


IntelliJ IDEA的JRebel插件包括JRebel代理并帮助您自动生成JRebel配置。它通过单击为应用程序和服务器启用JRebel,并改进了IDE中的调试支持。


这篇文章用英文来写,希望你能看懂



ok, let`s go


it can support many IDE tools that below:


微信图片_20220213180554.png


1. Installation


1.1 Open the IntelliJ IDEA Settings


1.2 Select Plugins from the sections menu.


1.3 Press Browse plugin repositories… and locate the JRebel plugin.


image.png


1.4 restart IntelliJ IDEA


2. Activation


An excellent plugin is offen not free, and this is no exception.But i cant to teach you to buy it, of course that is the best way to get it, i will tall you how to crack this plugin.


2.1 open the JRebel control panel


image.png


you just need to fill in the infomation in these two boxes.


Filled in the first box is :


http://139.199.89.239:1008/d6bbb34d-84c4-4214-907e-26fc52f8e1b8 Filled in the second box is your email


Node: If the first box prompt expire, you can change to a uuid after the url.

OK, it is done when you click OK.


2.2 Change working model


if you just complete the first step, you also need to set this setting. Because in the case of working online, Exception will be detected at any time,(Will be detected as pirated).So follow me down:


image.png


image.png


OK, this is a success.


3. How to use on local


The only required configuration file is rebel.xml. This is used by JRebel to map the running application to the workspace. The good news is that IDE plugin can automate this configuration for you.


微信图片_20220213180745.jpg


The meaning of the check mark is: Enable JRebel and generator therebel.xml


What`s in this file?


This file is automatically generated, Generally not need to manually modify.


<?xml version="1.0" encoding="UTF-8"?>
<!--
  This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
  Refer to https://manuals.zeroturnaround.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_1.xsd
http://www.zeroturnaround.com
http://www.zeroturnaround.com ">
    <classpath>
        <dir name="/home/fantj/xxx/xxxx-xxx/xxx-xxxx/target/classes">
        </dir>
    </classpath>
</application>


Server startup


The JRebel plugin for IntelliJ IDEA includes dedicated launch buttons. These buttons are located on the main toolbar and on the navigation toolbar by default. You can also find these commands via the Run menu.


image.png


The first button launches the container with JRebel. The second button launches the container with JRebel in debug mode.


By launching the process from one of these buttons, the JRebel plugin will automatically add the appropriate command line parameters.


Node: You must have to use Run with JRebel or Debug with JRebel to start server, Because only then will it work, If you use Run mainor Debug main, sorry, you won`t be able to experience it !


4. How to use in remote servers


This chapter lists the steps required to set up JRebel remote server support for IntelliJ IDEA. You need a working, activated JRebel installation in your IDE. Please follow the instructions on how to install and configure JRebel for IntelliJ IDEA. If you have already set up JRebel, move on to step 1.


4.1 Enable JRebel remote server support on the server


Running JRebel on a remote server requires the JRebel agent and a special launch parameter. Follow these steps to do this.


1)Open Settings > JRebel > Startup.


2)Select Run on a remote server.


3)Use the drop-down menus to specify your remote server configuration.


4)Follow the instructions displayed.


1、if remote server is tomcat


image.png


2、If remote server is springboot 2.x


image.png


4.2 Server Config


1、download and install jrebel server


[root@FantJ jrebel]# curl -O http://dl.zeroturnaround.com/jrebel-stable-nosetup.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 21.2M  100 21.2M    0     0  2584k      0  0:00:08  0:00:08 --:--:-- 4778k
[root@FantJ jrebel]# unzip jrebel-stable-nosetup.zip


2、start up


because I am using the remote service of springboot 2.x, so I execute this statement :java "-agentpath:[JRebel root folder]/lib/libjrebel64.so" -Drebel.remoting_plugin=true -jar myapp-boot.jar


[root@FantJ test-jenkins]# java "-agentpath:/home/fantj/jrebel/jrebel/lib/libjrebel64.so" -Drebel.remoting_plugin=true -jar web.jar 
2018-12-04 20:16:52 JRebel:  Starting logging to file: /root/.jrebel/jrebel.log
2018-12-04 20:16:52 JRebel:  
2018-12-04 20:16:52 JRebel:  #############################################################
2018-12-04 20:16:52 JRebel:  
2018-12-04 20:16:52 JRebel:  JRebel Agent 2018.2.3 (201811261141)
2018-12-04 20:16:52 JRebel:  (c) Copyright ZeroTurnaround AS, Estonia, Tartu.
2018-12-04 20:16:52 JRebel:  
2018-12-04 20:16:52 JRebel:  Over the last 1 days JRebel prevented
2018-12-04 20:16:52 JRebel:  at least 0 redeploys/restarts saving you about 0 hours.
2018-12-04 20:16:52 JRebel:  
2018-12-04 20:16:52 JRebel:  JRebel started in remote server mode.
2018-12-04 20:16:52 JRebel:  
2018-12-04 20:16:52 JRebel:  
2018-12-04 20:16:52 JRebel:  #############################################################
2018-12-04 20:16:52 JRebel:  
2018-12-04 20:17:10,110 [main]  INFO com.alibaba.dubbo.common.logger.LoggerFactory:59 - using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter
2018-12-04 20:17:10,198 [main]  INFO c.a.b.d.c.event.WelcomeLogoApplicationListener:53 - 
  ████████▄  ███    █▄  ▀█████████▄  ▀█████████▄   ▄██████▄  
  ███   ▀███ ███    ███   ███    ███   ███    ███ ███    ███ 
  ███    ███ ███    ███   ███    ███   ███    ███ ███    ███ 
  ███    ███ ███    ███  ▄███▄▄▄██▀   ▄███▄▄▄██▀  ███    ███ 
  ███    ███ ███    ███ ▀▀███▀▀▀██▄  ▀▀███▀▀▀██▄  ███    ███ 
  ███    ███ ███    ███   ███    ██▄   ███    ██▄ ███    ███ 
  ███   ▄███ ███    ███   ███    ███   ███    ███ ███    ███ 
  ████████▀  ████████▀  ▄█████████▀  ▄█████████▀   ▀██████▀  
 :: Dubbo Spring Boot (v0.1.0) : https://github.com/dubbo/dubbo-spring-boot-project
 :: Dubbo (v2.0.1) : https://github.com/alibaba/dubbo
 :: Google group : http://groups.google.com/group/dubbo
......


if you want it run in the background.

nohup java "-agentpath:/home/fantj/jrebel/jrebel/lib/libjrebel64.so" -Drebel.remoting_plugin=true -jar web.jar > nohup.out &


you always can view its logs:

tail -f nohup.out

4.3 create a connect


image.png


Node: You may also notice that is not safe, because there is not need any certification. Official provides a method: java -jar jrebel.jar -set-remote-password, You should set it up , I will not make a demo here.


Press OK to store the new remote server.


4.4 Configure modules for remote server support


1、Open View > Tool Windows > JRebel. The JRebel Modules view is opened in IntelliJ IDEA


2、Select the checkbox for your desired modules.


image.png


3、Build and redeploy your application containing the rebel-remote.xml configuration file to the remote server.


image.png


4、You`re done, congratulations!






目录
相关文章
|
1月前
|
运维 监控 API
后端开发中的微服务架构:优势与挑战
【8月更文挑战第16天】在软件开发的世界中,微服务架构已经成为一种流行和强大的设计模式。它通过将应用程序分解为一组小型、独立的服务来促进敏捷开发和快速迭代。本文旨在深入探讨微服务架构的核心优势以及实施过程中可能遇到的挑战,帮助读者更好地理解这一现代软件设计方法。
|
28天前
|
设计模式 数据管理 测试技术
后端开发中的微服务架构设计哲学
【8月更文挑战第23天】在软件开发的海洋中,微服务架构如同一艘精心设计的船只,它以独特的设计理念和航行技巧,引领着后端开发的未来。本文将探讨微服务的核心概念、设计原则以及如何将这些理念融入到日常的开发实践中,旨在为读者提供一套清晰的微服务设计指南。
|
1月前
|
监控 负载均衡 数据管理
后端开发中的微服务架构实践与挑战
【8月更文挑战第20天】在现代软件工程领域,微服务架构因其灵活性和可扩展性而受到推崇。本文将深入探讨微服务架构的核心概念、实施过程中的关键步骤以及面临的主要挑战,旨在为后端开发人员提供一个全面的视角,帮助他们理解和应对微服务架构带来的变革。
|
7天前
|
缓存 Java 开发者
开发故事:一个 @Async 如何搞瘫整个微服务系统
大家好,我是小米,一个热爱分享技术的29岁开发者。本文讲述了一个困扰我们团队的开发环境问题,最终发现罪魁祸首竟是 `@Async` 注解。我们通过详细分析错误日志和 Spring 的 Bean 代理机制,逐步排查并解决了这一难题。文章介绍了三种解决方案:调整依赖结构、使用 `@Lazy` 延迟加载以及禁用 `@Async` 的代理功能。希望对你有所帮助!欢迎关注我的微信公众号“软件求生”,获取更多技术干货!
16 5
开发故事:一个 @Async 如何搞瘫整个微服务系统
|
1月前
|
运维 监控 持续交付
后端开发中的微服务架构:优势与挑战
【8月更文挑战第20天】随着云计算和容器化技术的发展,微服务架构已经成为现代软件开发中的一种流行趋势。本文将探讨微服务架构的核心优势以及在实施过程中可能遇到的技术和组织挑战。我们将从微服务的定义入手,进而深入分析其设计哲学、技术特性以及在实际应用中的效益与问题。
158 56
|
9天前
|
消息中间件 存储 缓存
后端开发之深入浅出微服务架构
在数字化时代的浪潮中,后端开发如同一座桥梁,连接着用户与数据的世界。本文将带你探索微服务架构的奥秘,从基础概念到实战应用,一步步揭开它神秘的面纱。我们将一起思考,如何在这个快速变化的时代,找到属于自己的节奏和方向。
23 2
|
14天前
|
自然语言处理 Java 网络架构
解锁跨平台微服务新纪元:Micronaut与Kotlin联袂打造的多语言兼容服务——代码、教程、实战一次打包奉送!
【9月更文挑战第6天】Micronaut是一款轻量级、高性能的Java框架,适用于微服务开发。它支持Java、Groovy和Kotlin等多种语言,提供灵活的多语言开发环境。本文通过创建一个简单的多语言兼容服务,展示如何使用Micronaut及其注解驱动特性实现REST接口,并引入国际化支持。无论是个人项目还是企业应用,Micronaut都能提供高效、一致的开发体验,成为跨平台开发的利器。通过简单的配置和代码编写,即可实现多语言支持,展现其强大的跨平台优势。
28 2
|
14天前
|
缓存 Java 应用服务中间件
随着微服务架构的兴起,Spring Boot凭借其快速开发和易部署的特点,成为构建RESTful API的首选框架
【9月更文挑战第6天】随着微服务架构的兴起,Spring Boot凭借其快速开发和易部署的特点,成为构建RESTful API的首选框架。Nginx作为高性能的HTTP反向代理服务器,常用于前端负载均衡,提升应用的可用性和响应速度。本文详细介绍如何通过合理配置实现Spring Boot与Nginx的高效协同工作,包括负载均衡策略、静态资源缓存、数据压缩传输及Spring Boot内部优化(如线程池配置、缓存策略等)。通过这些方法,开发者可以显著提升系统的整体性能,打造高性能、高可用的Web应用。
43 2
|
10天前
|
设计模式 Kubernetes 开发者
探索后端开发中的微服务架构
本文旨在通过浅显易懂的方式,向读者介绍微服务架构的概念、优势以及在后端开发中的应用。我们将从微服务的基本定义出发,逐步深入到如何设计、部署和维护一个高效的微服务系统。文章还将分享一些实际案例,帮助初学者和有经验的开发者更好地理解和掌握微服务架构。
|
1月前
|
消息中间件 NoSQL 持续交付
构建高效微服务架构:后端开发的新范式
【7月更文挑战第50天】在数字化转型的浪潮中,微服务架构已成为推动企业敏捷开发和维护的关键。本文深入探讨了如何构建一个高效的微服务架构,包括选择合适的技术栈、确保服务的可伸缩性与弹性、以及实现持续集成和持续部署(CI/CD)。通过分析具体案例,文章揭示了后端开发者如何在不断变化的技术环境中保持竞争力,并提出了优化策略以提升系统整体性能和可靠性。