Neo4j安装APOC和图形算法Neo.ClientError.Procedure.ProcedureRegistrationFailed

时间:2018-02-13 18:40:41

标签: neo4j neo4j-apoc neo4j-plugin

我对APOC和图形算法插件有一些问题。 我按照说明将.jars放在{NEO4j_HOME}/plugins中,并更改了{NEO4j_HOME}/conf/neo4j.conf

中的设置
dbms.directories.data=/Users/mlo/neo4j-community-3.3.1/data
dbms.directories.plugins=/Users/mlo/neo4j-community-3.3.1/plugins
dbms.directories.certificates=/Users/mlo/neo4j-community-3.3.1/certificates
dbms.directories.logs=/Users/mlo/neo4j-community-3.3.1/logs
dbms.directories.lib=/Users/mlo/neo4j-community-3.3.1/lib
dbms.directories.run=/Users/mlo/neo4j-community-3.3.1/run

dbms.security.auth_enabled=false
dbms.security.procedures.unrestricted=algo.*
dbms.security.procedures.unrestricted=apoc.*

一些程序有效。

CALL apoc.help('dijkstra')
CALL algo.list()

但是,大多数存储过程根本不起作用。

Neo.ClientError.Procedure.ProcedureRegistrationFailed
algo.unionFind is unavailable because it is sandboxed and has dependencies outside of the sandbox. Sandboxing is controlled by the dbms.security.procedures.unrestricted setting. Only unrestrict procedures you can trust with access to database internals.
algo.pageRank is unavailable because it is sandboxed and has dependencies outside of the sandbox. Sandboxing is controlled by the dbms.security.procedures.unrestricted setting. Only unrestrict procedures you can trust with access to database internals.

有人可以指出我的设置出错吗?感谢。

2 个答案:

答案 0 :(得分:8)

更改这些行:

dbms.security.procedures.unrestricted=algo.*
dbms.security.procedures.unrestricted=apoc.*

为:

dbms.security.procedures.unrestricted=algo.*,apoc.*

并重新启动Neo4j服务。

答案 1 :(得分:2)

关于@ bruno-peres回答,我在Arch Linux上遇到了与Neo4j 3.4.0类似的问题(访问/使用Neo4j APOC /算法)。

我使用APOC (Awesome Procedures for Neo4j)Efficient Graph Algorithms for Neo4j 已下载到我的Neo4j插件目录的适当版本的.jar文件;即,

/mnt/Vancouver/apps/neo4j/neo4j-community-3.4.0/plugins/apoc-3.4.0.1-all.jar
/mnt/Vancouver/apps/neo4j/neo4j-community-3.4.0/plugins/graph-algorithms-algo-3.4.0.0.jar

但是,当我尝试运行此命令时,

CALL algo.pageRank.stream('Metabolism', 'yields',
{iterations:20, dampingFactor:0.85})
YIELD node, score
RETURN node,score order by score desc limit 20

在我的Neo4j浏览器中,我收到了这个错误:

Error: Neo.ClientError.Procedure.ProcedureRegistrationFailed

Neo.ClientError.Procedure.ProcedureRegistrationFailed: algo.pageRank is
unavailable because it is sandboxed and has dependencies outside of the
sandbox. Sandboxing is controlled by the    
dbms.security.procedures.unrestricted setting. Only unrestrict 
procedures you can trust with access to database internals.

根据此处接受的答案(SO 48773505)Neo4j Install APOC and Graph Algorithms...

我需要对我的" neo4j.conf进行以下编辑"文件,

/mnt/Vancouver/apps/neo4j/neo4j-community-3.4.0/conf/neo4j.conf

取消注释此行,

dbms.directories.plugins=plugins

并添加/编辑此行,

dbms.security.procedures.unrestricted=apoc.trigger.*,apoc.*,algo.*

注意(上图),似乎neo4j.conf接受一个

dbms.security.procedures.unrestricted=...

线!有单独的行,例如

dbms.security.procedures.unrestricted=apoc.trigger.*,apoc.*
dbms.security.procedures.unrestricted=algo.*

导致... is unavailable because it is sandboxed and has dependencies outside of the sandbox ...错误!

最后,重启你的Neo4j服务器/实例,

neo4j restart