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" -> "10.0.3.117",
"table" -> "test_table2",
"db" -> "test",
"user" -> "test_user",
"password" -> "test",
"port" -> "5433")

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

but I have an Exception
java.sql.SQLNonTransientConnectionException: [Vertica]VJDBC Failed to connect to host 127.0.0.1 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 10.0.3.117 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?

Tagged:

Comments

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

  • edited July 2017

    Hi!

    VJDBC Failed to connect to host 127.0.0.1 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?

  • marcothesanemarcothesane - Select Field - Administrator

    I have never tried to connect Spark to Vertica.

    But:
    The error message mentions a host 127.0.0.1 (that's localhost ...), while you're explicitly specifying a host 10.0.3.117 .
    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(127.0.0.1), 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 - Select Field - 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.

  • safasafa Vertica Customer

    Hello,
    I have the same problem : java.sql.SQLNonTransientConnectionException: [Vertica]VJDBC Failed to connect to host ( VIP ) on port 5433. Reason: Failed to establish a connection to the primary server or any backup address
    however , the connexion works using DbVisualizer.
    Any help please ?

  • Jim_KnicelyJim_Knicely - Select Field - Administrator

    @safa - What version of Vertica is this (server and JDBC client)? Take a look at the JDBC Connection Property LoginTimeout .

    https://www.vertica.com/docs/10.0.x/HTML/Content/Authoring/ConnectingToVertica/ClientJDBC/JDBCConnectionProperties.htm?zoom_highlight=LoginTimeout

    Setting the value to >= 30 seconds may help.

  • SergeBSergeB - Select Field - Employee

    What IPs do you see when running select * from nodes; ?

Leave a Comment

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