Step#1: Creating EC2 RHEL Instance
- Create AWS Account
- Login to https://ap-southeast-2.console.aws.amazon.com/ec2/home?region=ap-southeast-2#Home (AWS Credentials)
- Click on Launch Instance
- Provide Name
- Select RedHat
- Select Amazon Machine Image (AMI)
- Select Instance type(t2.micro - Default)
- Select/Create Key pair name
- Create KeyPar:
- Key Pair Name: mykeypair
- Key Pare Type: RSH
- Private key file format: .pem
- Save the private key securely in your local machine
- Click on Edit button "Network settings"
- Inbound Security Group Rules
- Add Security Group
- Type: Custom TCP
- Port Range: 8080
- Source Type: Any where
- Click on 'Launch Instance"
- EC2 Instance is created. Wait Until is started (Instance State: Running; Status check: 2/2 checks passed)
- Get the "Public IPv4 address"
Step#2: Accessing Instance from Console
I Used MobaXTerm App to access the EC2 instance
- Open CMD/ MobaXTerm (App)
- Click on Session
- Select SSH
- Enter Remote Host Name/ID (Public IPv4 address), Port 22
- Advanced SSH Settings: browser SSH Key (use private SSH key)
- Ok
Step#3: Command to Enter on the EC2 Instance
- sudo yum -y install wget
- This is to install wget on RHEL
- sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
- sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
- These two lines are for downloading the stable version of jenkins from internet.
- sudo yum install fontconfig java-17-openjdk
- We require java for the functioning of jenkins.
- java -version
- Ensure Java installed properly
- sudo yum install jenkins
- Install Jenkins
- sudo systemctl daemon-reload
- Reload systemd manager configuration. This will rerun all generators
- sudo systemctl status jenkins
- To check the status of the Jenkins service
- sudo systemctl start jenkins
- To Start the Jenkins service
- Jenkins Password (This may also be found at: var/lib/jenkins/secrets/initialAdminPassword)
- sudo systemctl status jenkins
- To check the status of the Jenkins service
- sudo systemctl enable jenkins
- To enable the Jenkins service to start at boot with the command
Step#4: Launching Jenkins
- Open Browser - http://<Public_IP>:8080 --> Public IP can be found at Step#1.5
- Enter Jenkins Password --> Jenkins Password can be found at Step#3.9.2 or var/lib/jenkins/secrets/initialAdminPassword
- Create admin user - Save & Next
- Jenkins URL will be shown (you can change if you want)
- Save and Finish
0 comments:
Post a Comment