Issue
Premise · What I want to realize
I created a instance of google compute engine(GCE) and installed Jenkins on that instance. but I can't access the jenkins from web browser...
environment
- Google compute engine(GCE)
- Java openjdk1.8.0_181
- Jenkins2.121.3
What I did
Creating a instance of GCE
Installing and setting Java and Jenkins on GCE
$ ssh username@IPAddressOfGCE
$ sudo yum install java-1.8.0-openjdk
$ sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
$ sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
$ sudo yum install jenkins
$ sudo systemctl start jenkins
$ sudo /sbin/chkconfig jenkins on
$ sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent
$ sudo firewall-cmd --reload
Problems occurring
I accessed the Jenkins(http://IPAddress:8080/) from a web browser, and get the timed error.
What shoud I do? Could you lend me a hand? Thank you for your reading.
Solution
It's pretty simple. You're getting a timeout since Jenkins is listening on port 8080. By default, the only access you have to that GCE instance is ssh on port 22.
You have to login to the Google Cloud Console, then go to Networking -> VPC Network -> Firewall rules
.
Create a firewall rule that allows incoming TCP connections to port 8080. You already have permitted port 8080 on your linux instance using firewalld but Google has it's own firewall that does its filtering before the packets are actually hitting your linux instance.
Then you should be able to access your Jenkins.
Answered By - Bogdan Stoica Answer Checked By - Mary Flores (WPSolving Volunteer)