-
Neo4j version : 3.3.0
-
性能问题
image.png
批量CSV文件导入时,发现neo4j只使用了一个核,official也没有关于CPU调优的说法,待填坑。
提交csv文件加载入库的过程中,发现包含正确路径的Cql语句在被neo4j 提取时,原路径被莫名的添加了一段绝对路径。
Input:
LOAD CSV WITH HEADERS FROM 'file:/tmp/<csv_filename>.csv'
AS line CREATE (:<NodeName> { <property_name>:line.<property_name>, <property_name1>:line.<property_name1>})
Outputs
[T] 2018-05-08 12:19:44 999 neo4j_jober.go:104
&{[{Neo.ClientError.Statement.ExternalResourceFailed Couldn't load the external resource at:
file:/data/neo4j/import/tmp/<csv_filename>.csv }] [] 0}
Solution
编辑neo4j.conf,将其中
19 # This setting constrains all `LOAD CSV` import files to be under the `import` directory. Remove or comment it out to
20 # allow files to be loaded from anywhere in the filesystem; this introduces possible security problems. See the
21 # `LOAD CSV` section of the manual for details.
22 dbms.directories.import=/var/lib/neo4j/import
dbms.directories.import注释即可