Neo4j 安装 APOC 和图形算法 Neo.ClientError.Procedure.ProcedureRegistrationFailed
Neo4j Install APOC and Graph Algorithms Neo.ClientError.Procedure.ProcedureRegistrationFailed
我在使用 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.
谁能指出我的设置哪里出了问题?谢谢。
更改这些行:
dbms.security.procedures.unrestricted=algo.*
dbms.security.procedures.unrestricted=apoc.*
至:
dbms.security.procedures.unrestricted=algo.*,apoc.*
并重启 Neo4j 服务。
根据@bruno-peres 的回答,我在 Arch Linux 和 Neo4j 3.4.0 上遇到了类似的问题(accessing/using Neo4j APOC/Algorithms)。
我使用 APOC (Awesome Procedures for Neo4j) and the 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.conf" 文件进行以下编辑,
/mnt/Vancouver/apps/neo4j/neo4j-community-3.4.0/conf/neo4j.conf
取消注释这一行,
dbms.directories.plugins=plugins
和add/edit这一行,
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 server/instance,
neo4j restart
我在使用 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.
谁能指出我的设置哪里出了问题?谢谢。
更改这些行:
dbms.security.procedures.unrestricted=algo.*
dbms.security.procedures.unrestricted=apoc.*
至:
dbms.security.procedures.unrestricted=algo.*,apoc.*
并重启 Neo4j 服务。
根据@bruno-peres 的回答,我在 Arch Linux 和 Neo4j 3.4.0 上遇到了类似的问题(accessing/using Neo4j APOC/Algorithms)。
我使用 APOC (Awesome Procedures for Neo4j) and the 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.conf" 文件进行以下编辑,
/mnt/Vancouver/apps/neo4j/neo4j-community-3.4.0/conf/neo4j.conf
取消注释这一行,
dbms.directories.plugins=plugins
和add/edit这一行,
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 server/instance,
neo4j restart