21 Eylül 2022 Çarşamba

Jenkins Manage Nodes - Master ve Slave

Giriş
Master ve Agent arasında bağlantı için 3 yöntem var
1. SSH Connector
2. Inbound Connector
3. Custom Script

1. Master'ın public key Agent üzerindeki "/home/jenkins/.ssh/authorized_keys" dosyasına kopyalanır. authorized_keys Dosyası yazısına bakabilirsiniz
2. Master'dan Agent'a ssh komutuyla yani elle bir ssh bağlantısı açılır
3. Bu bağlantının neticesinde güncellenen known_hosts dosyasını tekrar Jenkins'e kopyalanır
sudo cp ~/.ssh/known_hosts /var/lib/jenkins/.ssh
known_hosts Dosyası yazısına bakabilirsiniz
4. Master Jenkins'e yeni bağlantı için private key ekrandan girilir

Örnek
1. Soldaki Manage Jenkins menüsüne tıklanır
2. Manage Nodes and Clouds düğmesine tıklanır
3. Sol tarafta New Node menüsüne tıklanır
4. Node ismi girilir, ayrıca " Permanent agent" seçeneği de seçilir
Ekrandaki bazı alanların açıklaması şöyle
Name : Enter the name of slave node

Description : Enter the detailed description of the slave node

Number of Executor: This means that no. of jobs in the slave machine can run parallelly based on the count is given in the text box. Here is given as 1 (it can be change based on the user specification for execution), 

Label: Enter the label name of the slave machine.

Usage: In this field, two options are available ,one is "Use this node as much as possibl"e and another one is "Only build jobs with label expressions matching this node". Here is selected as option1 (Use this node as much as possible)

Launch Method : Select the option "Launch agent by connecting it to the controller(Master)

Custom WorkDir path :Enter the slave workspace directory(path) in this field.

Internal data Directory : Here is used “remoting” as value. And Choose the Use WebSocket option.

In Availability : Select the option as “Keep this agent online as much as possible” and Click on “Save” button.

Jenkins node'larını yönetmek için şöyle yaparız
Yeni node eklemek için şöyle yaparız. Burada "Permanent Agent" seçiliyor

SSH ile bağlanacağımız için şöyle yaparız







Hiç yorum yok:

Yorum Gönder