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

本文涉及的产品
服务治理 MSE Sentinel/OpenSergo,Agent数量 不受限
简介: 微服务开发神器之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!






目录
相关文章
|
6天前
|
消息中间件 Java 数据库
构建高效可靠的微服务架构:后端开发的终极指南
【5月更文挑战第30天】 随着现代软件开发的复杂性日益增加,微服务架构已成为组织解决庞大系统问题的有效手段。本文将深入探讨如何构建一个既高效又可靠的微服务系统,涉及关键组件的选择、网络通信的最佳实践以及保证系统稳定性的策略。通过一系列实际案例与性能分析,我们将揭示后端开发在设计微服务时必须考虑的核心要素,并提供一套综合性解决方案,以指导读者实现强大的后端架构。
|
5天前
|
API 开发者 微服务
探索后端开发中的微服务架构
【5月更文挑战第31天】在数字化浪潮中,微服务架构如星辰般熠熠生辉,为后端开发领域带来革命性的创新。本文将深入探讨微服务架构的精髓,从其定义、核心优势到实际应用,展现这一技术如何在复杂业务场景下提供灵活、高效的解决方案。我们将一同见证微服务如何助力企业快速响应市场变化,实现技术的可持续发展。
|
5天前
|
Cloud Native 数据库 开发者
构建高效微服务架构:后端开发的新趋势
【5月更文挑战第31天】 在数字化转型的浪潮中,微服务架构已成为企业技术战略的核心组成部分。本文将深入探讨如何构建一个高效的微服务架构,包括关键的设计原则、技术选型、以及实践中的挑战与解决方案。通过对微服务架构的细致剖析,我们将提供一套实用的指南,帮助后端开发者优化系统结构,提升服务的可靠性、伸缩性和敏捷性。
|
5天前
|
敏捷开发 API 开发者
构建高效微服务架构:后端开发的新趋势
【5月更文挑战第31天】 在现代软件开发的浪潮中,微服务架构已经成为企业追求敏捷开发、持续交付和系统弹性的关键解决方案。本文将深入探讨微服务架构的概念、优势以及如何构建一个高效的微服务系统。通过实际案例分析,我们将展示如何利用容器化、服务网格、API网关等技术手段,实现服务的解耦、分布式管理和网络通信优化。
|
6天前
|
监控 数据管理 开发者
构建高效微服务架构:后端开发的现代实践
【5月更文挑战第30天】 在当今软件开发领域,微服务架构已成为提高系统可维护性、扩展性和开发效率的关键方案。本文深入探讨了构建高效微服务架构的策略,包括服务划分原则、通信机制、数据管理以及持续集成与部署的最佳实践。通过分析具体案例和最新技术趋势,文章旨在为后端开发者提供一套全面的指导,帮助他们在不断变化的技术环境中保持竞争力。
|
5天前
|
消息中间件 运维 监控
构建高效微服务架构:后端开发的新范式
【5月更文挑战第31天】在现代软件开发中,随着业务需求的多样化和系统复杂性的增加,传统的单体应用架构逐渐显得笨重且难以适应快速变化。微服务架构作为一种新兴的后端开发模式,以其灵活性、可扩展性和独立部署的特点,成为解决这一问题的关键。本文将探讨微服务架构的核心概念、设计原则以及如何在实际项目中实现一个高效的微服务系统。
|
6天前
|
缓存 监控 开发者
构建高效微服务架构:后端开发的新趋势
【5月更文挑战第30天】在软件开发的世界中,微服务架构已经成为一种流行且高效的设计模式,它通过将大型应用程序分解成一组小的、独立的服务来提高可伸缩性和灵活性。本文深入探讨了微服务的核心概念、优势以及如何在后端开发中实现一个健壮的微服务架构。我们将讨论关键的设计原则、技术选型和常见的挑战,并提供解决方案和最佳实践以指导开发者构建出能够适应快速变化需求的系统。
|
6天前
|
监控 关系型数据库 持续交付
构建高效微服务架构:后端开发的最佳实践
【5月更文挑战第30天】随着现代应用的复杂性日益增加,微服务架构已成为众多企业和开发者的首选。本文将深入探讨如何构建一个高效的微服务系统,包括关键的设计原则、技术栈选择、以及确保系统稳定性和扩展性的实践方法。我们将通过实际案例分析,揭示后端开发中实现敏捷性和可维护性的策略,为追求卓越的软件工程师提供实用的指导。
|
6天前
|
设计模式 JavaScript Java
构建高效微服务架构:后端开发的新范式
【5月更文挑战第30天】 在现代软件开发的快速演变中,微服务架构已经成为推动技术创新和服务模块化的关键驱动力。本文将深入探讨如何构建一个高效的微服务架构,涵盖从基本概念理解到实践应用的全方位分析。我们将讨论微服务的核心原则、设计模式、技术栈选择以及它们如何促进系统的可伸缩性、灵活性和容错能力。通过具体案例研究和最佳实践分享,文章旨在为后端开发者提供一套实用的指南,帮助他们在构建和维护复杂系统时做出明智决策。
|
6天前
|
敏捷开发 API 开发者
构建高效微服务架构:后端开发的新趋势
【5月更文挑战第30天】 在现代软件开发领域,随着业务需求的不断复杂化以及敏捷开发和持续交付的普及,传统的单体应用逐渐显得笨重且难以管理。微服务架构作为解决这一问题的关键方案,正逐步成为后端开发的主流趋势。本文将深入探讨微服务的概念、优势与挑战,并详细阐述如何构建一个高效的微服务系统。通过分析模块化设计原则、服务划分策略及技术栈选择等关键要素,本文旨在为开发者提供一套实用的后端微服务架构设计指南。