The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.

Failed connect to vertica in VM

Hi all! I'm new in Vertica. And try to connect with spark vertica connector to my vertica in VM Virtualbox.

I have this options
val opt = Map(
"host" -> "",
"table" -> "test_table2",
"db" -> "test",
"user" -> "test_user",
"password" -> "test",
"port" -> "5433")

And then try to read
val df2 ="com.vertica.spark.datasource.DefaultSource").options(opt).load()

but I have an Exception
java.sql.SQLNonTransientConnectionException: [Vertica]VJDBC Failed to connect to host on port 5433. Reason: Failed to establish a connection to the primary server or any backup address
Currently I'm using scala 2.10.6 and spark 1.6.2
It is too strange, because my ip is being pinged good. And, when I used simple spark jdbc, scala 2.11 and spark 2.0.x for reading it's worked!
Maybe I'm doing something wrong?



  • I'm running into the same issue with Vertica 8.1 and Spark 2.1. Any recommendations on resolving this?

  • edited July 2017


    VJDBC Failed to connect to host on port 5433. 
    Reason: Failed to establish a connection to [...]

    Check this article - Debugging Client Issues with Client Side Logging

    Try pure java (or DbVisualizer). Is it works?

  • Hi everyone!
    I have this problem too. Spark 2.4.3, Vertica 9.2.1. Has anyone found a solution for this problem?

  • I have never tried to connect Spark to Vertica.

    The error message mentions a host (that's localhost ...), while you're explicitly specifying a host .
    Either a spark config overriding your opt Map? Or some error that prevents Spark from loading your opt Map in the first place?

  • I found the source of the problem. Default settings for vertica node export_ip is localhost(, but when spark tries to connect to vertica, it calls the node ip and connects to node directly. So export_ip should be set to one that is reachable for spark.

  • vikas_gargvikas_garg Employee

    I am able to connect with Vertica using Spark.

    Try making these 2 changes:
    1) Created Static IP instead of dhcp
    2) Change Network Card type from NTP to Bridge.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.