APOC 仅在 neo4j 中部分安装其扩展(一个过程)
APOC is only partially installing its extension in neo4j (one procedure)
我下载了 apoc-3.1.0.3-all.jar 并将其放入我的 windows7 Neo4J 3.1.1 系统的插件中。
C:\Users>java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
杀掉电脑上的Neo4J进程,然后重启服务器。
我只看到列出了一个 apoc 程序,其他程序给出了有关缺少程序的错误。 neo4j 日志中没有错误迹象。我尝试解锁 jar,然后重新启动服务器。运气不好。
我做的没问题
Call db.schema()
但是像这样简单的事情:
CALL apoc.help("help")
将导致
There is no procedure with the name `apoc.help` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.
我哪里做错了,我猜一定是我!)
$call dbms.procedures
apoc.schema.assert apoc.schema.assert(indexes :: MAP?, constraints :: MAP?) :: (label :: STRING?, key :: LIST? OF STRING?, unique :: BOOLEAN?, action :: STRING?) (empty)
db.awaitIndex db.awaitIndex(index :: STRING?, timeOutSeconds = 300 :: INTEGER?) :: VOID Wait for an index to come online (for example: CALL db.awaitIndex(":Person(name)")).
db.constraints db.constraints() :: (description :: STRING?) List all constraints in the database.
db.indexes db.indexes() :: (description :: STRING?, state :: STRING?, type :: STRING?) List all indexes in the database.
db.labels db.labels() :: (label :: STRING?) List all labels in the database.
db.propertyKeys db.propertyKeys() :: (propertyKey :: STRING?) List all property keys in the database.
db.relationshipTypes db.relationshipTypes() :: (relationshipType :: STRING?) List all relationship types in the database.
db.resampleIndex db.resampleIndex(index :: STRING?) :: VOID Schedule resampling of an index (for example: CALL db.resampleIndex(":Person(name)")).
db.resampleOutdatedIndexes db.resampleOutdatedIndexes() :: VOID Schedule resampling of all outdated indexes.
db.schema db.schema() :: (nodes :: LIST? OF NODE?, relationships :: LIST? OF RELATIONSHIP?) Show the schema of the data.
dbms.changePassword dbms.changePassword(password :: STRING?) :: VOID Change the current user's password. Deprecated by dbms.security.changePassword.
dbms.components dbms.components() :: (name :: STRING?, versions :: LIST? OF STRING?, edition :: STRING?) List DBMS components and their versions.
dbms.functions dbms.functions() :: (name :: STRING?, signature :: STRING?, description :: STRING?) List all user functions in the DBMS.
dbms.procedures dbms.procedures() :: (name :: STRING?, signature :: STRING?, description :: STRING?) List all procedures in the DBMS.
dbms.queryJmx dbms.queryJmx(query :: STRING?) :: (name :: STRING?, description :: STRING?, attributes :: MAP?) Query JMX management data by domain and name. For instance, "org.neo4j:*"
dbms.security.changePassword dbms.security.changePassword(password :: STRING?) :: VOID Change the current user's password.
dbms.security.createUser dbms.security.createUser(username :: STRING?, password :: STRING?, requirePasswordChange = true :: BOOLEAN?) :: VOID Create a new user.
dbms.security.deleteUser dbms.security.deleteUser(username :: STRING?) :: VOID Delete the specified user.
dbms.security.listUsers dbms.security.listUsers() :: (username :: STRING?, flags :: LIST? OF STRING?) List all local users.
dbms.security.showCurrentUser dbms.security.showCurrentUser() :: (username :: STRING?, flags :: LIST? OF STRING?) Show the current user.STRING?)
问题是您使用了 windows neo4j 安装程序,这似乎不适用于插件。所以你必须使用工作正常的 neo4j 二进制文件。
这意味着您必须下载 windows 安装的 zip 版本并按照此处的说明进行操作:
http://neo4j.com/docs/operations-manual/current/installation/windows/
编辑:
如果不是
根据我的记忆,您必须在 graph.db 目录中创建一个 plugins
目录,放入 apoc jar,然后重新启动服务器。
否则您可以在 neo4j.conf
文件中指定 dbms.directories.plugins
。
使用 安装程序 (最常见)与从 zip 或 tar 文件安装 neo4j 之间的区别很少见。
(A) 当您使用 安装程序 安装 neo4j 时,安装程序将 neo4j 服务器配置为在 数据库中查找 plugins
文件夹文件夹(即在default.graphdb
文件夹下)。
(B) 当您从 zip 或 tar 文件安装 neo4j 时,neo4j 服务器将在 neo4j 安装文件夹中查找 plugins
文件夹(例如,plugins
文件夹应该是 neo4j bin
文件夹的同级文件夹)。
听起来 (A) 适用于您。
@cybersam 和@logisima 的回答完全正确。但是,由于我使用的是 Red Hat Linux 特别是 Oracle-7,因此我还必须向它添加一个额外的步骤。这就是我让它工作的方式
- 将
apoc-<version>.jar
下载到/var/lib/neo4j/plugins
目录
chown neo4j:neo4j apoc-<version>.jar
chmod 755 apoc-<version>.jar
- 打开
/etc/neo4j/neo4j.conf
处的 neo4j.conf 并将行 #dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*
替换为 dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*,apoc.*
并保存。
- 通过发出命令
systemctl restart neo4j
重新启动 Neo4j 服务
注意:确保您下载了正确版本的 apoc jar。我使用的是 neo4j version 3.5.5
,我使用的 apoc jar 版本是 apoc-3.5.0.3-all.jar
。另外请确保您在 /etc/neo4j/neo4j.conf
中取消注释 dbms.directories.plugins=/var/lib/neo4j/plugins
我下载了 apoc-3.1.0.3-all.jar 并将其放入我的 windows7 Neo4J 3.1.1 系统的插件中。
C:\Users>java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
杀掉电脑上的Neo4J进程,然后重启服务器。
我只看到列出了一个 apoc 程序,其他程序给出了有关缺少程序的错误。 neo4j 日志中没有错误迹象。我尝试解锁 jar,然后重新启动服务器。运气不好。
我做的没问题
Call db.schema()
但是像这样简单的事情:
CALL apoc.help("help")
将导致
There is no procedure with the name `apoc.help` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.
我哪里做错了,我猜一定是我!)
$call dbms.procedures
apoc.schema.assert apoc.schema.assert(indexes :: MAP?, constraints :: MAP?) :: (label :: STRING?, key :: LIST? OF STRING?, unique :: BOOLEAN?, action :: STRING?) (empty)
db.awaitIndex db.awaitIndex(index :: STRING?, timeOutSeconds = 300 :: INTEGER?) :: VOID Wait for an index to come online (for example: CALL db.awaitIndex(":Person(name)")).
db.constraints db.constraints() :: (description :: STRING?) List all constraints in the database.
db.indexes db.indexes() :: (description :: STRING?, state :: STRING?, type :: STRING?) List all indexes in the database.
db.labels db.labels() :: (label :: STRING?) List all labels in the database.
db.propertyKeys db.propertyKeys() :: (propertyKey :: STRING?) List all property keys in the database.
db.relationshipTypes db.relationshipTypes() :: (relationshipType :: STRING?) List all relationship types in the database.
db.resampleIndex db.resampleIndex(index :: STRING?) :: VOID Schedule resampling of an index (for example: CALL db.resampleIndex(":Person(name)")).
db.resampleOutdatedIndexes db.resampleOutdatedIndexes() :: VOID Schedule resampling of all outdated indexes.
db.schema db.schema() :: (nodes :: LIST? OF NODE?, relationships :: LIST? OF RELATIONSHIP?) Show the schema of the data.
dbms.changePassword dbms.changePassword(password :: STRING?) :: VOID Change the current user's password. Deprecated by dbms.security.changePassword.
dbms.components dbms.components() :: (name :: STRING?, versions :: LIST? OF STRING?, edition :: STRING?) List DBMS components and their versions.
dbms.functions dbms.functions() :: (name :: STRING?, signature :: STRING?, description :: STRING?) List all user functions in the DBMS.
dbms.procedures dbms.procedures() :: (name :: STRING?, signature :: STRING?, description :: STRING?) List all procedures in the DBMS.
dbms.queryJmx dbms.queryJmx(query :: STRING?) :: (name :: STRING?, description :: STRING?, attributes :: MAP?) Query JMX management data by domain and name. For instance, "org.neo4j:*"
dbms.security.changePassword dbms.security.changePassword(password :: STRING?) :: VOID Change the current user's password.
dbms.security.createUser dbms.security.createUser(username :: STRING?, password :: STRING?, requirePasswordChange = true :: BOOLEAN?) :: VOID Create a new user.
dbms.security.deleteUser dbms.security.deleteUser(username :: STRING?) :: VOID Delete the specified user.
dbms.security.listUsers dbms.security.listUsers() :: (username :: STRING?, flags :: LIST? OF STRING?) List all local users.
dbms.security.showCurrentUser dbms.security.showCurrentUser() :: (username :: STRING?, flags :: LIST? OF STRING?) Show the current user.STRING?)
问题是您使用了 windows neo4j 安装程序,这似乎不适用于插件。所以你必须使用工作正常的 neo4j 二进制文件。
这意味着您必须下载 windows 安装的 zip 版本并按照此处的说明进行操作:
http://neo4j.com/docs/operations-manual/current/installation/windows/
编辑:
如果不是
根据我的记忆,您必须在 graph.db 目录中创建一个 plugins
目录,放入 apoc jar,然后重新启动服务器。
否则您可以在 neo4j.conf
文件中指定 dbms.directories.plugins
。
使用 安装程序 (最常见)与从 zip 或 tar 文件安装 neo4j 之间的区别很少见。
(A) 当您使用 安装程序 安装 neo4j 时,安装程序将 neo4j 服务器配置为在 数据库中查找 plugins
文件夹文件夹(即在default.graphdb
文件夹下)。
(B) 当您从 zip 或 tar 文件安装 neo4j 时,neo4j 服务器将在 neo4j 安装文件夹中查找 plugins
文件夹(例如,plugins
文件夹应该是 neo4j bin
文件夹的同级文件夹)。
听起来 (A) 适用于您。
@cybersam 和@logisima 的回答完全正确。但是,由于我使用的是 Red Hat Linux 特别是 Oracle-7,因此我还必须向它添加一个额外的步骤。这就是我让它工作的方式
- 将
apoc-<version>.jar
下载到/var/lib/neo4j/plugins
目录 chown neo4j:neo4j apoc-<version>.jar
chmod 755 apoc-<version>.jar
- 打开
/etc/neo4j/neo4j.conf
处的 neo4j.conf 并将行#dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*
替换为dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*,apoc.*
并保存。 - 通过发出命令
systemctl restart neo4j
重新启动 Neo4j 服务
注意:确保您下载了正确版本的 apoc jar。我使用的是 neo4j version 3.5.5
,我使用的 apoc jar 版本是 apoc-3.5.0.3-all.jar
。另外请确保您在 /etc/neo4j/neo4j.conf
dbms.directories.plugins=/var/lib/neo4j/plugins