Prepare Java runtime
Check if had installed java
$ java -version |
if not Here is an article telling you how to install it
Create Node
1. Jenkins home page->Manage Node->New Node, such as window-build-machine
2. List Linux agent settings
Items | Settings |
---|---|
Name | Linux-build-machine |
Description | used for Linux build |
of executors | 1 |
Remote root directory | /home/agent |
Labels | Linux, build |
Usage | Use this node as much as possible |
Launch method | Launch agent agents via SSH |
Host | 192.168.1.112 |
Credentials | username/password |
Host Key Verification Strategy | Manually trusted key Verification Strategy |
Availability | Keep this agent online as much as paossible |
3. How to set credentials
credentials | configuration |
---|---|
Domain | Global credentials (unrestricted) |
Kind | Username with password |
Scope | Global(Jenkins, nodes, items, all child items, etc) |
Username | root |
Password | mypassword |
Description | Linux agent username & password |
4. Save then Connect
Remoting version: 3.29 |
Troubleshooting
Problem | how to fix |
---|---|
[04/22/19 23:15:07] [SSH] WARNING: No entry currently exists in the Known Hosts file for this host. Connections will be denied until this new host and its associated key is added to the Known Hosts file. | ssh-keyscan HOSTNAME >> known_hosts |
/var/lib/jenkins/.ssh/known_hosts [SSH] No Known Hosts file was found at /var/lib/jenkins/.ssh/known_hosts. | changing the Host key verification strategy in LAUNCH METHOD from “Known Hosts file verification strategy” to “Manually trusted key verification strategy” |