Skip to main content
Background Image
  1. Posts/

Jenkins Linux agent configuration

·298 words·2 mins· ·
Xianpeng Shen
Author
Xianpeng Shen
Table of Contents

Prepare Java runtime
#

Check if had installed java
#

$ java -version
openjdk version "1.8.0_65"
OpenJDK Runtime Environment (build 1.8.0_65-b17)
OpenJDK 64-Bit Server VM (build 25.65-b01, mixed mode)

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
#

ItemsSettings
NameLinux-build-machine
Descriptionused for Linux build
of executors1
Remote root directory/home/agent
LabelsLinux, build
UsageUse this node as much as possible
Launch methodLaunch agent agents via SSH
Host192.168.1.112
Credentialsusername/password
Host Key Verification StrategyManually trusted key Verification Strategy
AvailabilityKeep this agent online as much as paossible

3. How to set credentials
#

credentialsconfiguration
DomainGlobal credentials (unrestricted)
KindUsername with password
ScopeGlobal(Jenkins, nodes, items, all child items, etc)
Usernameroot
Passwordmypassword
DescriptionLinux agent username & password

4. Save then Connect
#

Remoting version: 3.29
This is a Unix agent
Evacuated stdout
Agent successfully connected and online
SSHLauncher{host='192.168.1.112', port=22, credentialsId='d1cbab74-823d-41aa-abb7-8584859503d0', jvmOptions='', javaPath='/usr/bin/java',
prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=210, maxNumRetries=10, retryWaitTime=15,
sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.ManuallyTrustedKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=true}
[05/11/19 01:33:37] [SSH] Opening SSH connection to 192.168.1.112:22.
[05/11/19 01:33:37] [SSH] SSH host key matches key seen previously for this host. Connection will be allowed.
[05/11/19 01:33:37] [SSH] Authentication successful.
[05/11/19 01:33:37] [SSH] The remote user's environment is:

Troubleshooting
#

Problemhow 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”

Related

Jenkins Windows agent configuration
·544 words·3 mins
Provides a step-by-step guide on how to configure a Jenkins Windows agent, including setting up the Java runtime, creating the node, and troubleshooting common issues.