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

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

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

为什么要用热部署?如果你公司使用微服务开发,你使用了一段时间的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!

相关推荐

Redis集群对比:主从复制、哨兵模式、Cluster一文看懂所有优缺点

在分布式系统中,Redis作为高性能的内存数据库,其集群方案的选择直接影响到系统的稳定性、可用性和扩展性。本文将全面对比Redis的三种主流集群方案:主从复制、哨兵模式和Cluster模式,帮助开发者...

redis的主从复制,读写分离,主从切换

当数据量变得庞大的时候,读写分离还是很有必要的。同时避免一个redis服务宕机,导致应用宕机的情况,我们启用sentinel(哨兵)服务,实现主从切换的功能。redis提供了一个master,多个sl...

# Redis 入门到精通(九)-- 主从复制(3)

#Redis入门到精通(九)--主从复制(3)##一、redis主从复制-常见问题(1)###1、伴随着redis系统的运行,master的数据量会越来越大,一旦master重启...

redis - 主从复制(Redis主从复制时序图)

1引言在上一篇文章中,我们了解了Redis两种不同的持久化方式,Redis服务器通过持久化,把Redis内存中持久化到硬盘当中,当Redis宕机时,我们重启Redis服务器时,可以由RDB文件或AO...

# Redis 入门到精通(九)-- 主从复制(2)

#Redis入门到精通(九)--主从复制(2)##一、redis主从复制--数据同步阶段注意事项###1、数据同步阶段master说明1)如果master数据量巨大,数据同步阶段应...

Redis主从复制(redis主从复制主节点挂了)

介绍Redis有两种不同的持久化方式,Redis服务器通过持久化,把Redis内存中持久化到硬盘当中,当Redis宕机时,我们重启Redis服务器时,可以由RDB文件或AOF文件恢复内存中的数据。不过...

深入解析 Redis 集群的主从复制实现方式

在互联网大厂的后端开发领域,Redis作为一款高性能的内存数据库,被广泛应用于缓存、消息队列等场景。而Redis集群中的主从复制机制,更是保障数据安全、实现读写分离以及提升系统性能的关键所在。今...

Redis主从架构详解(redis主从架构高可用如何实现)

Redis主从架构搭建Redis主节点配置创建主节点目录(/opt/redis-master),复制redis.conf到该目录下,redis.conf配置项修改#后台启动daemonizeyes...

抖音“四大包塘战神”:承包了全网的快乐

在抖音钓鱼垂类领域,"包塘战神"军团正掀起一场黑色幽默风暴。空军华、大表坑、李赔光、透心良四位创作者,以承包鱼塘为舞台,用连续翻车的钓鱼直播构筑起流量奇观。当钓鱼佬在抖音集体转型喜剧人...

ORACLE 11G RAC 安装-通过VM配置共享磁盘

简介:在自己的电脑上通过VM软件搭建Oracle11GRAC,通过修改VM的参数文件来实现磁盘共享!目标:搭建RAC环境实现:使用VMwareWorkstation8.0.0+ORACLE...

Linux操作系统安全配置(linux系统安全配置包括)

一、服务相关命令systemctlenable服务名#开机自启动systemctldisable服务名#禁用开机自启动systemctlstop服务名#停止服务systemctls...

关于Linux性能调优中网络I/O的一些笔记

写在前面和小伙伴分享一些Linux网络优化的笔记,内容很浅,可以用作入门博文内容结合《Linux性能优化》读书笔记整理涉及内容包括常用的优化工具(mii-tool,ethtool,ifconfig,i...

从 Sonatype Nexus Repository Manager 迁移到 Artifactory

1.Nexus1.1下载下载链接:https://help.sonatype.com/repomanager3/product-information/download/download-archiv...

Ubuntu20安装zabbix5.0企业监控系统亲测教程

前言示例主机:zabbix10.0.100.10,将安装在UbuntuServer上教程说明:因使用官方教程无法安装成功,所以本教程与官方教程有所不同安装前提:已安装UbuntuServer2...

Linux内核设计与实现—进程管理(linux内核程序设计)

进程进程就是处于执行期的程序(目标码存放在某种存储介质上)。进并不仅仅局限于一段可执行程序代码(Unix称其为代码段,textsection)。通常进程还要包含其他资源,像打开的文件,挂起的信号,...