cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

LOAD CSV from a shared folder?

Hi all!

I have a cluster of servers and I have an ETL process that imports multiple files. The issue I am having is that the leader of the cluster is changing and LOAD CSV is looking for the import files on c:\neo4j\import. And I don't want to copy all of the files to each server.

The idea solution would be to have a shared folder like: \sharedFolder\import where all servers can point to and LOAD CSV could load from that URL.

I've tried but with no success.

Is this possible?

6 REPLIES 6

You can either symlink it into your import folder.

Or disable the security restriction that Neo4j has to limit only to importing from import folders.

# This setting constrains all `LOAD CSV` import files to be under the `import` directory. Remove or comment it out to
# allow files to be loaded from anywhere in the filesystem; this introduces possible security problems. See the
# `LOAD CSV` section of the manual for details.
dbms.directories.import=import

I have removed the constraint in the config file:

# The name of the database to mount. Note that this is *not* to be confused with
# the causal_clustering.database setting, used to specify a logical database
# name when creating a multi-clustering deployment.
#dbms.active_database=graph.db

I then created a Symlink to a remote folder:
2X_5_56cd2181ed4e2c3ce8b5a29120681ab9556ce921.jpeg

But I am still not able to load the file from the remote folder:

(I am using windows servers)

Hi Daniel,

Neo4j server will be using the local client account, does it have permissions to go to that location?

Thanks!

given the error of Couldn't load the external resource at: file:/c:/symlink......... can you please provide the LOAD CSV command. When using a file: typically it is file:///......... with 3 /

https://neo4j.com/docs/cypher-manual/3.5/clauses/load-csv/#query-load-csv-introduction states

CSV files can be stored on the database server and are then accessible 
using a file:/// URL. Alternatively, LOAD CSV also supports accessing CSV files via HTTPS, 
HTTP, and FTP.

Thanks everyone for helping out!

The command was at the top of the second image and that command is:

LOAD CSV WITH HEADERS FROM "file:///c:/symlink/archive/file.csv" AS row RETURN row LIMIT 10

Regarding permissions, "Everyone" has read and write permissions as seen below:
2X_9_96b97cfd37941ae673b6f90cc51402b5c8c03007.jpeg

Hi!

Just to double-check, could you please see that one of the servers that is running Neo4j is able to access the path under the role level that Neo4j runs on? Perhaps do this via command prompt?

Thanks!