Jenkins+ Basic Series 8: Node Overview and Explanation of the Pit Encountered in Advance

What is a node: My personal understanding is that the place where jenkins builds work.

master node: the master node, after the platform is built, you will have it yourself, that is, on the Jenkins server, and the build operation is performed on the master by default

1. Create a new node for system management - node management

2. Set the node name

3. Set node information

Usage reminder, the option here is as much as possible, that is, as long as your state here is idle, use this node

After the setting is complete, save and a new node will be added

pit encountered

I stepped on a pit in the configuration of the following tasks: No matter how I set it up, I couldn’t package it successfully and reported an environment error, but there were no problems with other similar projects. The process:

1. A certain maven project keeps prompting an environment error during the construction process, and cannot find the environment variables I configured

2. Check the environment variables. The same project a can be executed, but b cannot, which means that the environment is ok

3. Check the version of maven, consult R&D to make the environment consistent with the version of the R&D local packaging environment, or not

4. Check whether the configuration content of the jenkins project is correct, or not found

5. Finally, click on the workspace suddenly and inadvertently

I found that the node used at that time was not the node I configured, because some environments on it were not installed. At this time, it was determined that it was the reason for node selection. After continuous exploration and retrospect, it was determined that the problem was: the number of executors

The default number of executors of the master is 2. At that time, there were already 2 tasks running on this node by default. When the third task was created, it was automatically assigned to another node. However, part of the environment variables of the other node is not installed, and all environment errors are reported. Finally, the number of executors is changed to 10, and the problem is solved, but it is not perfect. why, please look down

If you have multiple nodes, be sure to set it on the usage of the node

If both nodes are set to use this node as much as possible, there will be a conflict. So to make sure the node is used correctly

1. When creating a task, it is necessary to select a good node

2. Only one node is allowed to choose the option to use as much as possible, and the others are used according to the binding task

Summarize

1. The node is the server where jenkins works, and you can specify which server it will perform packaging operations on

2. When there are many construction tasks, be sure to pay attention to whether the number of default executors is exceeded, and it can be effectively distinguished from other nodes

3. To use other nodes as jenkins work servers, you also need to configure related environment variables to run

Guess you like

Origin blog.csdn.net/yangj507/article/details/95089087