Neo4j插件安装

Neo4j插件安装

Author:wss

Date:2022.6.9

Topic:Neo4j插件安装

一、前言

昨天再次安装Apoc插件,又去找之前看的教程,有些地方不够清晰要几个教程对比着看,想到可以把常用插件的安装过程整理一下,尽量方便自己和更多人查看。所以这篇博客会不定时更新。。

二、准备

操作系统:win10

neo4j版本:neo4j-community-4.x


插件安装的主要流程如下:

  1. 根据自己的Neo4j版本确定插件版本。
  2. 下载插件,放到/plugins/下。
  3. 修改neo4j.conf文件相应参数,并保存修改。
  4. 重启neo4j,并测试安装结果。

1 Apoc

1.1 插件介绍

可以查看官方手册,里面有比较详细介绍、案例和使用手册。

1.2 版本匹配

我的是4.x版本,目前更新到4.4,可以通过最新版本的界面看到更全的版本映射关系。

Installation - APOC Documentation (neo4j.com)

The version compatibility matrix explains the mapping between Neo4j and APOC versions:

apoc version neo4j version
4.4.0.1 4.4.0 (4.3.x)
4.3.0.4 4.3.7 (4.3.x)
4.2.0.9 4.2.11 (4.2.x)
4.1.0.10 4.1.11 (4.1.x)
4.0.0.18 4.0.12 (4.0.x)
3.5.0.15 3.5.30 (3.5.x)
3.4.0.8 3.4.18 (3.4.x)
3.3.0.4 3.3.9 (3.3.x)
3.2.3.6 3.2.14 (3.2.x)
3.1.3.9 3.1.9 (3.1.x)
3.0.8.6 3.0.12 (3.0.x)
3.5.0.0 3.5.0-beta01
3.4.0.2 3.4.5
3.3.0.3 3.3.5
3.2.3.5 3.2.3
3.1.3.8 3.1.5

1.3 下载地址

确定apoc版本后直接下载对应jar包即可,如果官方地址较慢可以试试国内地址:

官方下载地址

国内地址

  • 找到对应的版本号,一般来说下载apoc-版本号-all.jar即可。

  • 下载完,把jar包放到放到/plugins/下。

1.4 conf修改

这里是很多教程不同的地方,文件地址$NEO4J_HOME/conf/neo4j.conf

我们直接参考官方教程:

Installation - APOC Documentation (neo4j.com)

For security reasons, procedures that use internal APIs are disabled by default. They can be enabled by specifying config in $NEO4J_HOME/conf/neo4j.conf e.g. dbms.security.procedures.unrestricted=apoc.*

出于安全原因,默认情况下禁用使用内部 API 的过程。它们可以通过在 $NEO4J _ HOME/conf/NEO4J.conf 中指定 config 来启用,例如dbms.security.procedures.unrestricted=apoc.*

If you want to do this when using the Neo4j Docker container, you need to amend -e NEO4J_dbms_security_procedures_unrestricted=apoc.\\\* to your docker run … command. The three backslashes are necessary to prevent wildcard expansions.

如果您希望在使用 NEO4J Docker 容器时执行此操作,则需要修改-e NEO4J _ dbms _ security _ process _ unlimited = apoc。* to your docker run... command.三个反斜杠是防止通配符扩展所必需的。

You can also whitelist procedures and functions in general to be loaded using: dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*

还可以使用 dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*将过程和函数加载白名单。

对于4.x版本,如果不是在docker中,在neo4j.conf文件最后加上这两句即可:

dbms.security.procedures.unrestricted=apoc.*
dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*

1.5 重启neo4j并测试

我一般是在修改conf文件之前在终端ctrl+c停止neo4j;修改完直接neo4j console启动:

  • 如果报错,校对一下apoc版本conf参数有没有弄错。

  • 如果正常启动,在可视化界面(browser)运行:return apoc.version(),如果出现对应的版本号,证明安装成功。

2022年6月9日16:55:34

(未完待续~)

posted @ 2022-06-09 17:03  王拾叁  阅读(330)  评论(0编辑  收藏  举报