11

我对 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.

有人能指出我的设置哪里出了问题吗?谢谢。

4

2 回答 2

23

更改这些行:

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

到:

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

并重启 Neo4j 服务。

于 2018-02-13T18:45:05.847 回答
5

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

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

/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 安装 APOC 和图形算法...

我需要对我的“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
于 2018-05-31T21:15:48.980 回答