百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 热门文章 > 正文

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

bigegpt 2024-08-06 11:46 3 浏览

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

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

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

ok, let`s go

it can support many IDE tools that below:



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.



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



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:



After that, you will see it becomes like this:



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.



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.



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



2、If remote server is springboot 2.x



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



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.



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




4、You`re done, congratulations!

相关推荐

Linux 系统启动完整流程

一、启动系统流程简介如上图,简述系统启动的大概流程:1:硬件引导UEFi或BIOS初始化,运行POST开机自检2:grub2引导阶段系统固件会从MBR中读取启动加载器,然后将控制权交给启动加载器GRU...

超专业解析!10分钟带你搞懂Linux中直接I/O原理

我们先看一张图:这张图大体上描述了Linux系统上,应用程序对磁盘上的文件进行读写时,从上到下经历了哪些事情。这篇文章就以这张图为基础,介绍Linux在I/O上做了哪些事情。文件系统什么是...

linux入门系列12--磁盘管理之分区、格式化与挂载

前面系列文章讲解了VI编辑器、常用命令、防火墙及网络服务管理,本篇将讲解磁盘管理相关知识。本文将会介绍大量的Linux命令,其中有一部分在“linux入门系列5--新手必会的linux命令”一文中已经...

Linux环境下如何设置多个交叉编译工具链?

常见的Linux操作系统都可以通过包管理器安装交叉编译工具链,比如Ubuntu环境下使用如下命令安装gcc交叉编译器:sudoapt-getinstallgcc-arm-linux-gnueab...

可算是有文章,把Linux零拷贝技术讲透彻了

阅读本文大概需要6.0分钟。作者:卡巴拉的树链接:https://dwz.cn/BaQWWtmh本文探讨Linux中主要的几种零拷贝技术以及零拷贝技术适用的场景。为了迅速建立起零拷贝的概念...

linux软链接的创建、删除和更新

大家都知道,有的时候,我们为了省下空间,都会使用链接的方式来进行引用操作。同样的,在系统级别也有。在Windows系列中,我们称其为快捷方式,在Linux中我们称其为链接(基本上都差不多了,其中可能...

Linux 中最容易被黑客动手脚的关键目录

在Linux系统中,黑客攻击后常会针对关键目录和文件进行修改以实现持久化、提权或隐藏恶意活动。本文介绍下黑客最常修改的目录及其手法。一、/etc目录关键文件有:/etc/passwd和/et...

linux之间传文件命令之Rsync傻瓜式教程

1.前言linux之间传文件命令用什么命令?本文介绍一种最常用,也是功能强大的文件同步和传输工具Rsync,本文提供详细傻瓜式教程。在本教程中,我们将通过实际使用案例和最常见的rsync选项的详细说...

Linux下删除目录符号链接的方法

技术背景在Linux系统中,符号链接(symlink)是一种特殊的文件,它指向另一个文件或目录。有时候,我们可能需要删除符号链接,但保留其指向的目标目录。然而,在删除符号链接时可能会遇到一些问题,例如...

阿里云国际站注册教程:aa云服务器怎么远程链接?

在全球化的今天,互联网带给我们无以计数的便利,而云服务器则是其中的重要基础设施之一。这篇文章将围绕阿里云国际站注册、aa云服务器如何远程链接,以及服务器安全防护如Ddos防火墙、网站应用防护waf防火...

Linux 5.16 网络子系统大范围升级 多个新适配器驱动加入

Linux在数据中心中占主导地位,因此每个内核升级周期的网络子系统变化仍然相当活跃。Linux5.16也不例外,周一最新与网络相关的更新加入了大量的驱动和新规范的支持。一个较新硬件的驱动是Realt...

搭建局域网文件共享服务(Samba),手机电脑都能看喜欢的影视剧

作为一名影视爱好者,为了方便地观看自己喜欢的影视作品,在家里搞一个专门用来存放电影的服务器是有必要的。蚁哥选则用一台Ubuntu系统的电脑做为服务器,共享影音文件,其他同一个局域网内的电脑或手机可以...

分享一个实用脚本—centos7系统巡检

概述这周闲得慌,就根据需求写了差不多20个脚本(部分是之前分享过的做了一些改进),今天主要分享一个给平时运维人员用的centos7系统巡检的脚本,或者排查问题检查系统情况也可以用..实用脚本#!/bi...

Linux 中创建符号链接的方法

技术背景在Linux系统里,符号链接(SymbolicLink),也被叫做软链接(SoftLink),是一种特殊的文件,它指向另一个文件或者目录。符号链接为文件和目录的管理带来了极大的便利,比...

一文掌握 Linux 符号链接

符号链接(SymbolicLink),通常被称为“软链接”,是Linux文件系统中一种强大而灵活的工具。它允许用户创建指向文件或目录的“快捷方式”,不仅简化了文件管理,还在系统配置、软件开发和日...