内容简介:为什么要用热部署?如果你公司使用微服务开发,你使用了一段时间的jenkins集成开发部署,你会发现即使有了这一套集成开发环境,假如我让你改个变量...你就需要跑一次jenkins,麻烦倒不麻烦,主要是花费太长的时间,所以开发阶段用远程服务热部署会更加方便和前端的对接,这也是这篇文章着重说的一点。IntelliJ IDEA的JRebel插件包括JRebel代理并帮助您自动生成JRebel配置。它通过单击为应用程序和服务器启用JRebel,并改进了IDE中的调试支持。这篇文章用英文来写(滑稽),希望你能看懂(
为什么要用热部署?如果你公司使用微服务开发,你使用了一段时间的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 isrebel.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 the rebel.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 main
or 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.
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.
- Open Settings > JRebel > Startup.
- Select Run on a remote server.
- Use the drop-down menus to specify your remote server configuration.
- Follow the instructions displayed.
1.1 if remote server is tomcat
1.2 If remote server is springboot 2.x
2. Server Config
2.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.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 复制代码
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 <NewPassword>
, You should set it up , I will not make a demo here.
Press OK to store the new remote server.
4. Configure modules for remote server support
- Open View > Tool Windows > JRebel. The JRebel Modules view is opened in IntelliJ IDEA:
- Select the checkbox for your desired modules.
- Build and redeploy your application containing the rebel-remote.xml configuration file to the remote server.
- You`re done, congratulations!
如果你喜欢我的文章,那麻烦请关注我的公众号,公众号重点分析架构师技术,该公众号还处于初始阶段,谢谢大家的支持。
关注公众号,回复java架构
获取架构视频资源(后期还会分享不同的优质资源噢)。
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- 远程部署神器 Fabric,支持 Python3
- 推荐一个神器:对 k8s 的 yaml 部署清单按照类别进行排序
- MySQL 优化神器
- ppt 神器 reveal
- 基准测试神器-JMH
- 终端复用神器Tmux
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
有限与无限的游戏
[美]詹姆斯·卡斯 / 马小悟、余倩 / 电子工业出版社 / 2013-10 / 35.00元
在这本书中,詹姆斯·卡斯向我们展示了世界上两种类型的「游戏」:「有限的游戏」和「无限的游戏」。 有限的游戏,其目的在于赢得胜利;无限的游戏,却旨在让游戏永远进行下去。有限的游戏在边界内玩,无限的游戏玩的就是边界。有限的游戏具有一个确定的开始和结束,拥有特定的赢家,规则的存在就是为了保证游戏会结束。无限的游戏既没有确定的开始和结束,也没有赢家,它的目的在于将更多的人带入到游戏本身中来,从而延续......一起来看看 《有限与无限的游戏》 这本书的介绍吧!