dCache / dcache

dCache - a system for storing and retrieving huge amounts of data, distributed among a large number of heterogenous server nodes, under a single virtual filesystem tree with a variety of standard access methods
https://dcache.org
290 stars 136 forks source link

support DB connections using UNIX sockets #3626

Open calestyo opened 7 years ago

calestyo commented 7 years ago

Hi.

We had this already much earlier... when I asked in RT for supporting UNIX socket connections to postgresql (which should be faster and better to authenticate, i.e. based on unix user)...

There seems to be now support in pgjdbc for it: https://github.com/pgjdbc/pgjdbc/issues/56

Would be nice if anything further that is necessary for this, could be added to dCache, and if it's just some documentation that tells people they can do this as well :)

Cheers, Chris.

calestyo commented 7 years ago

See pull request #3628.

paulmillar commented 6 years ago

I may have misunderstood, but the patches that were added in pgjdbc add support for an arbitrary socketfactory. They don't add support for UNIX socket-based communication.

Put another way: what should the JDBC connection string be, in order to use UNIX sockets?

calestyo commented 6 years ago

Uhm… I'm not an expert in Java and it's class libs.... looking at https://jdbc.postgresql.org/documentation/head/connect.html there is:

socketFactory = String

The provided value is a class name to use as the SocketFactory when establishing a socket connection. This may be used to create unix sockets instead of normal sockets. The class name specified by socketFactory must extend javax.net.SocketFactory and be available to the driver's classloader. This class must have a zero argument constructor or a single argument constructor taking a String argument. This argument may optionally be supplied by socketFactoryArg.

socketFactoryArg = String

This value is an optional argument to the constructor of the socket factory class provided above.

But I have no idea whether Java provides already such factory that extends javax.net.SocketFactory or whether one would need to write this first...

:-(