Search code examples
google-cloud-platformgoogle-compute-engineubuntu-18.04glassfish-4

I have problem to connect me glassfish server from compute engine


i´m using ubuntu 18.04 lts in google compute engine and glassfish server running perfectly as seen in the following image:

enter image description here

already configure a static ip to the gcp vm:

enter image description here

and i remove the S so I can access my server enter image description here

and i also add port 8080 to be able to connect and nothing keeps throwing me error already try like this :http://34.94.96.242:8080 and this: http://34.94.96.242:4848 And i still don't have access


Solution

  • Did you try reaching your glassfish server inside the Compute Engine?, I mean using for example:

    curl localhost:[PORT]

    in the terminal and see the output, if OK, your installation is OK and probably there is a firewall rule missing, so you have to create it with the specific port.

    For example for enabling traffic in port 22 for using SSH, you need to execute the following command in cloud shell:

    gcloud compute firewall-rules create default-allow-ssh --allow tcp:22

    or for opening port 8080

    gcloud compute firewall-rules create default-allow-glassfish --allow tcp:808

    Take a look at this documentation about how to set up firewall rules in GCP step-by-step.