Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Presto-CLI java.net.SocketException: Connection refused in GCP

I have created dataproc cluster using beta version of gcloud with optional component presto.

gcloud beta dataproc clusters create presto-test --optional-components=PRESTO --image-version=1.3-deb9

When I try to execute below command to access hive catalog it could successfully open the presto-cli.

./presto \
    --server presto-cluster-m-0:8080 \
    --socks-proxy localhost:1080 \
    --catalog hive \
    --schema default 

But I am getting below error while querying through presto-cli.

presto:default> show tables;

Error running command: java.net.SocketException: Connection refused (Connection refused)

Any help in this will be appreciated

like image 834
Pracheta Gaware Avatar asked Nov 26 '25 08:11

Pracheta Gaware


1 Answers

A couple of minor fixes to your connection settings may be necessary.

  • Presto runs on port 8060 when running as an optional component
  • Your cluster creation command did not create your cluster in HA mode, so the hostname of the master is just -m, not -m-0

Assuming your cluster is named presto-test, then the command should look like

./presto \
--server presto-test-m:8060 \
--socks-proxy localhost:1080 \
--catalog hive \
--schema default 

If that doesn't work, you might want to double check that the socks proxy and Presto are running correctly.

  1. Run curl -I -x socks5h://localhost:1080 presto-test-m:8088 - it should return HTTP 302. If you get a connection refused error or host not found error, your socks proxy is not working correctly.

  2. Run gcloud beta dataproc clusters describe presto-test and check that the following lines appear in the output

    softwareConfig:
      optionalComponents:
      - PRESTO
    
  3. Ssh into the master node of your Presto cluster and run which presto and sudo systemctl status presto to verify that Presto is installed and running.

There is a known issue where Presto may fail to be installed when specified as an optional component (in which case steps 2 and 3 above would show that Presto is not activated on the cluster). This should be fixed in the next Dataproc release - if you're running into this issue now, try using this command to create the cluster instead:

gcloud beta dataproc clusters create presto-test --properties dataproc:dataproc.components.activate=presto --image-version=1.3-deb9
like image 69
Jerry Ding Avatar answered Nov 28 '25 00:11

Jerry Ding



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!