ubuntugoogle-cloud-platformnexusnexus3

Not able to access Nexus console on my Ubuntu VM instance in GCP


I have installed Nexus (as a service) on my Ubuntu VM instance and while creating the vm instance, I have also checked "Allow HTTP traffic" and "Allow HTTPS traffic" options.

When I do a $ tail -f /opt/sonatype-work/nexus3/log/nexus.log, I see that Nexus is running:

2021-07-30 06:20:10,046+0000 INFO  [jetty-main-1]  *SYSTEM org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.w.WebAppContext@73ded096{Sonatype Nexus,/,file:///opt/nexus/public/,AVAILABLE}
2021-07-30 06:20:10,099+0000 INFO  [jetty-main-1]  *SYSTEM org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@5bb22683{HTTP/1.1, (http/1.1)}{0.0.0.0:8081}
2021-07-30 06:20:10,100+0000 INFO  [jetty-main-1]  *SYSTEM org.eclipse.jetty.server.Server - Started @48575ms
2021-07-30 06:20:10,101+0000 INFO  [jetty-main-1]  *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - 
-------------------------------------------------

Started Sonatype Nexus OSS 3.32.0-03

-------------------------------------------------

When I do a : $ sudo netstat -pnltu | grep -i "8081", I see:

tcp        0      0 0.0.0.0:8081            0.0.0.0:*               LISTEN      11722/java 

Also, a $ sudo systemctl status nexus :

● nexus.service - nexus service
     Loaded: loaded (/etc/systemd/system/nexus.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2021-07-30 06:19:21 UTC; 27min ago
   Main PID: 11722 (java)
      Tasks: 71 (limit: 4710)
     Memory: 1011.8M
     CGroup: /system.slice/nexus.service
             └─11722 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -server -Dinstall4j.jvmDir=/usr/lib/jvm/java-8-openjdk-amd64/jre -Dexe4j.moduleName=/opt/nexus/>

Jul 30 06:19:21 ubuntu-nexus systemd[1]: Starting nexus service...
Jul 30 06:19:21 ubuntu-nexus nexus[11541]: Starting nexus
Jul 30 06:19:21 ubuntu-nexus systemd[1]: Started nexus service.

But, When I try to access the Nexus console through the vm instance's external ip with nexus' port-> http://34.xxx.xx.xxx:8081/ I am not able to access it (This site can’t be reached).

Is there any firewall settings in GCP, that needs to be done?


Solution

  • "Allow HTTP traffic" and "Allow HTTPS traffic" only open port 80 and 443, while Nexus is listening on port 8081. Either change the listening port or open port 8081