Options

odbc loader package compile error

Navin_CNavin_C Vertica Customer
Hello All,

I need to setup connection between Vertica and SQL server.
Trying to use ODBC loader package
When trying to compile, I am getting this error

make installmkdir -p build
g++  -I /opt/vertica/sdk/include -I /opt/vertica/sdk/examples/HelperLibraries -fPIC -shared -Wall -g -o build/ODBCLoader.so /opt/vertica/sdk/include/Vertica.cpp ODBCLoader.cpp -lodbc
/opt/vertica/bin/vsql -f ddl/install.sql
vsql:ddl/install.sql:2: ROLLBACK 3399:  Failure in UDx RPC call InvokeSetExecContext(): Error calling setupExecContext() in User Defined Object [] at [/scratch_a/release/vbuild/vertica/OSS/UDxFence/vertica-udx-C++.cpp:180], error code: 0, message: Error happened in dlopen(): [libodbc.so.2: cannot open shared object file: No such file or directory]
vsql:ddl/install.sql:3: ROLLBACK 3861:  Library not found: ODBCLoaderLib
vsql:ddl/install.sql:4: ROLLBACK 3861:  Library not found: ODBCLoaderLib


Why is it looking for libodbc.so ? and if its looking where is it looking?

Also attaching the this info

 ldd ODBCLoader.so       
 linux-vdso.so.1 =>  (0x00007fff2d1fd000)
        libodbc.so.2 => not found
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002b981bb04000)
        libm.so.6 => /lib64/libm.so.6 (0x00002b981be04000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002b981c087000)
        libc.so.6 => /lib64/libc.so.6 (0x00002b981c296000)
        /lib64/ld-linux-x86-64.so.2 (0x00002b981b685000)



Any workaround or solution to this.

Comments

  • Options
    Hey Navin,

    The ODBC Loader communicates with the remote server (in your case, the SQL Server system) using, well, ODBC.  Per the ODBC Loader documentation, each machine in your Vertica cluster must therefore be configured to be able to connect to your SQL Server system as an ODBC client / have the SQL Server's ODBC driver configured and working.

    "libodbc.so.2" is part of that configuration.  It is available via yum or apt-get on most platforms as part of the "unixodbc" package or similar.  You can also download and install unixODBC directly.  We look for it in the standard Linux library search path -- /lib, /usr/lib, etc.

    You can configure this, if necessary, via /etc/ld.so.conf* .  Or, alternatively (I think), by editing the ODBCLoader Makefile to add "-Wl,-rpath=/path/to/directory/containing/your/libraries/" as an additional argument to "g++".  But these are system libraries; I would encourage you to just install them systemwide.  Keeps things simple.

    But that's just the first step of the setup here.  I would suggest that you download and install the "isql" command-line utility on your Vertica systems (also typically available through yum/apt).  It is a simple command-line SQL prompt that works over ODBC.  Then play with isql until you have a working ODBC connection from each of your Vertica servers to your SQL Server installation.  (Note, this isn't Vertica setup; Vertica isn't involved yet.  This is entirely about SQL Server's client drivers and the ODBC subsystem on these machines.  SQL Server's client-driver documentation should help.)  Once you have that working, it should be straightforward to get Vertica and the ODBC Loader to use that link to connect to SQL Server.

    Adam
  • Options
    Navin_CNavin_C Vertica Customer
    Hi Adam,

    I had already used isql and tested it on my node. and it was working fine from 1st and 2nd nodes
    So the scenario is
    We have a 3 node cluster
    On 1 st node I got a different unixODBC manager version
    On 2nd Node I got a different unixODBC manager version
    On 3rd node there is no unixODBC manager.

    I am trying to compiler ODBC loader from 1st node it says 
    libodbc.so.1 not found
    I am trying to compile from 2nd node it says
    libodbc.so.2 not found.

    Can this be the reason , I mean while compiling from node 2  it compiles and gives me a .ODBCLoader.so perfectly , but while creating library, it gives this error
    libodbc.so.2: cannot open shared object file: No such file or directory

    So is it like Vertica tries to spread/install this on other node 1, but it finds a different unixODBC manager there and hence says libodbc.so.2: cannot open shared object file: No such file or directory and the same applies to node 3.

    If this is the reason, what might be the solution/workaround to this.?
    If not the reason, can you please explain this workaround in detail
    "libodbc.so.2" is part of that configuration.  It is available via yum or apt-get on most platforms as part of the "unixodbc" package or similar.  You can also download and install unixODBC directly.  We look for it in the standard Linux library search path -- /lib, /usr/lib, etc.
    You can configure this, if necessary, via /etc/ld.so.conf* .  Or, alternatively (I think), by editing the ODBCLoader Makefile to add "-Wl,-rpath=/path/to/directory/containing/your/libraries/" as an additional argument to "g++".  But these are system libraries; I would encourage you to just install them systemwide.  Keeps things simple.
    Thanks 

Leave a Comment

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