DevOps Classroom Series – 03/Dec/2021

Configuring Distributed Builds with Jenkins

  • Initial Lab setup
    • Jenkins master
      • Configuration: 2 VCPUs 4 GB of RAM
      • Operating System: ubuntu 20.04
      • Softwares: JDK 11, Jenkins LTS, git
    • Jenkins node 1:
      • Configuration: 2 VCPU 4 GB of RAM
      • Operating System: ubuntu 20.04
      • Softwares: Jdk 11, maven latest, git
  • Note: There should be connectivity between master and node
  • Lab Setup Overview
  • I will be creating both the machine in AWS
  • Now lets install jenkins on jenkins master
  • Once the jenkins server is up, set the necessary permissions for the jenkins user to perform actions on jenkins master
  • Now we have jenkins master setup. Now we need to configure the jenkins node
  • The way jenkins master will communicate with Jenkins node if it is linux
    • The jenkins master will login into jenkins node using ssh => username & password or username & key
    • So on the nodes for this sessions, lets create a user called as devops on all the nodes.
    • We would create a user devops and we would be giving them sudo permissions as well
    • Now lets create a devops user with some password
      • In linux machines (AWS or in other clouds) login with password might be disabled so we need to enable it first => change PasswordAuthentication to yes in /etc/ssh/sshd_config file and restart sshd service
      • Create user
        • debian => sudo adduser devops
        • redhat => sudo adduser devops & sudo passwd devops
      • Grant sudo permissions with no password to devops as this will be used by jenkins
      • Refer Here to the previous class room notes to install jdk 11 and maven latest
    • When we create jenkins job, how can we tell jenkins to run a partiular job on a particular node
  • Jenkins node configuration
    • Screen Shots
    • Once you save the node we can verify if the node is connected or not
  • Now lets create a jenkins job which will build the spring pet clinic project
  • Now let build to verify if the job is getting scheduled on the remote node or not
  • Next Steps: Lets try to fix the problem of maven not found (mvn not found)

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Network Integration by Acurax Social Media Branding Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%