JNLP -- the foundametal of distributed computing of Jenkins

Overview

https://devopscube.com/jenkins-architecture-explained/

master跟各种类型的worker node建立连接,有两种过程。

JNLP -- the foundametal of distributed computing of Jenkins

 

 

 

SSH负责master向slave(物理主机或者虚拟机)建立连接,然后推送agent.jar文件到此机器上

然后运行agent.jar,为了通过JNLP反向连接到master

以后master上的所有的job都通过此连接下发到slave机器上,并执行。

You can connect a Jenkins master and agent in two ways

  1. Using the SSH method: Uses the ssh protocol to connect to the agent. The connection gets initiated from the Jenkins master. Ther should be connectivity over port 22 between master and agent.
  2. Using the JNLP method: Uses java JNLP protocol (Java Network Launch Protocol). In this method, a java agent gets initiated from the agent with Jenkins master details. For this, the master nodes firewall should allow connectivity on specified JNLP port. Typically the port assigned will be 50000. This value is configurable.

 

K8S POD

https://www.slideshare.net/VadimSolovey/scaling-jenkins-with-kubernetes-by-ami-mahloof

POD生成后, 先从master上下载JNLP文件, 然后跟master建立JNLP端口的连接。

JNLP -- the foundametal of distributed computing of Jenkins

 

 

https://ameswanda.ddns.us/what-is-jnlp-port

JNLP用于加载和连接你的java应用从远程地址(此处指master服务器)

Similarly, what port does Jnlp use?

TCP Port. Jenkins can use a TCP port to communicate with inbound (formerly known as “JNLP”) agents, such as Windows-based agents.

Furthermore, what is Jnlp in Jenkins? JNLP(JAVA NETWORK LAUNCH PROTOCOL) is used to Connect to/launch your java application( here Jenkins) from a remote location.

 

实例

如下pipeline代码会首先在服务器端编译程 JNLP 文件, 然后下载到 POD中, 基于JWS插件运行,

运行过程的log打印,通过JNLP连接反向回传给master, 进而显示在console页面。

 

JNLP -- the foundametal of distributed computing of Jenkins

 

 

 

Jenkins Remoting -- agent.jar

https://www.jenkins.io/projects/remoting/

此库是jenkins的通信层,包括基于TCP的通讯协议,远程过程调用, 类加载, 数据流。

是controller和agents之间的通讯通道。

Jenkins Remoting is a library, and executable Java archive, which implements the communication layer in Jenkins. This includes the TCP-based communication protocols, remote procedure calls, class loading, data streaming, etc. Currently Remoting is primarily used in communications between the Jenkins controller and Jenkins agents.

The Remoting sub-project includes the Remoting library itself, package for agents, and a number of Remoting-specific plugins and core modules.

Remoting Usage in Jenkins

  • Agent executables (remoting.jar is a named agent.jar or slave.jar in Jenkins)

  • Controller to Agent communication protocols being used in various Agent types, including Java Web Start (aka JNLP) and SSH agents

  • Jenkins CLI, Remoting mode is deprecated since 2.54 (announcement)

  • Communication with Maven instance in the Maven Integration plugin.

 

Java Network Launch Protocol

https://docs.oracle.com/javase/tutorial/deployment/deploymentInDepth/jnlp.html

JNLP 可以让在web服务器上的资源文件,在客户端加载运行。

The Java Network Launch Protocol (JNLP) enables an application to be launched on a client desktop by using resources that are hosted on a remote web server. Java Plug-in software and Java Web Start software are considered JNLP clients because they can launch remotely hosted applets and applications on a client desktop. See Java Network Launching Protocol and API Specification Change Log for details.

Recent improvements in deployment technologies enable us to launch rich Internet applications (RIAs) by using JNLP. Both applets and Java Web Start applications can be launched by using this protocol. RIAs that are launched by using JNLP also have access to JNLP APIs. These JNLP APIs allow the RIAs to access the client desktop with the user's permission.

JNLP is enabled by a RIA's JNLP file. The JNLP file describes the RIA. The JNLP file specifies the name of the main JAR file, the version of Java Runtime Environment software that is required to run the RIA, name and display information, optional packages, runtime parameters, system properties, and so on.

 

http://setgetweb.com/p/WAS8/ccli_architect.html

JWS是一种应用部署技术, 包括小应用的可移动性, servlets和JSP文件技术的可维护性, 标签语言(XML 和 HTML)的简洁性

这个应用允许 全功能的 JAVA EE客户端应用的 加载 部署 更新, 从一个web服务器上。

ava Web Start architecture for deploying application clients

Java Web Start is an application-deployment technology that includes the portability of applets, the maintainability of servlets and JSP file technology, and the simplicity of mark-up languages such as XML and HTML. It is a Java application that allows full-featured Java EE client applications to be launched, deployed and updated from a standard Web server. The Java Web Start client is used with platforms that support a web browser.

 

JNLP -- the foundametal of distributed computing of Jenkins

 

 

上一篇:启动Jenkins报错"Job for jenkins.service failed because the control process exited with error code.


下一篇:自动化测试框架