无法启动Neo4j,因为数据库文件需要升级,而配置中禁用了升级

izkcnapc  于 2022-11-05  发布在  其他
关注(0)|答案(2)|浏览(179)

当我尝试通过Java驱动程序连接neo4j时,出现错误“Neo4j无法启动,因为数据库文件需要升级,而升级在配置中被禁用。请在配置文件中将”dbms.allow_upgrade "设置为“true”。
尽管我在neo4j.conf文件中将属性dbms.allow_upgrade设置为true,但没有任何更改。

9udxz4iz

9udxz4iz1#

这对我很有效,升级到3.3.1 neo4j Docker镜像!我尝试了以下方法,但这对3.0也不起作用:

docker run \
  --publish=7474:7474 --publish=7687:7687 \
  --volume=$HOME/neo4j/data:/data \
  --volume=$HOME/neo4j/logs:/logs \
  --env=NEO4J_dbms_allow_upgrade=true \
  --env=NEO4J_dbms_allow_format_migration=true \
  neo4j:3.0

===============================================================

fflintstone@OPTIPLEX790 MINGW64 /c/Users/fflintstone
$ docker run \
>     --publish=7474:7474 --publish=7687:7687 \
>     --volume=$HOME/neo4j/data:/data \
>     --volume=$HOME/neo4j/logs:/logs \
>     --env=NEO4J_dbms_allow_upgrade=true \
>     --env=NEO4J_dbms_allow_format_migration=true \
>     neo4j:3.0
Starting Neo4j.
2017-12-26 06:47:03.172+0000 INFO  ======== Neo4j 3.0.12 ========
2017-12-26 06:47:03.228+0000 INFO  No SSL certificate found, generating a self-signed certificate..
2017-12-26 06:47:04.204+0000 INFO  Starting...
2017-12-26 06:47:05.140+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2017-12-26 06:47:05.560+0000 ERROR Neo4j cannot be started, because the database files require upgrading and upgrades ar
e disabled in configuration. Please set 'dbms.allow_format_migration' to 'true' in your configuration file and try again
.

fflintstone@OPTIPLEX790 MINGW64 /c/Users/fflintstone
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
neo4j               3.0                 39739226e15b        13 days ago         606MB

fflintstone@OPTIPLEX790 MINGW64 /c/Users/fflintstone
$ docker run     --publish=7474:7474 --publish=7687:7687     --volume=$HOME/neo4j/data:/data     --volume=$HOME/neo4j/l
ogs:/logs     neo4j:3.3.1
Unable to find image 'neo4j:3.3.1' locally
3.3.1: Pulling from library/neo4j
2fdfe1cd78c2: Pull complete
82630fd6e5ba: Pull complete
119d364c885d: Pull complete
46f8fad107ee: Pull complete
fe7f5c604f04: Pull complete
6fd4ca7c99ff: Pull complete
d242a75fec77: Pull complete
Digest: sha256:baeb76f0d4785817c2a3608796ff0104a8f87ed89fe3391ef467eb6f0a1fc40e
Status: Downloaded newer image for neo4j:3.3.1
Active database: graph.db
Directories in use:
  home:         /var/lib/neo4j
  config:       /var/lib/neo4j/conf
  logs:         /logs
  plugins:      /var/lib/neo4j/plugins
  import:       /var/lib/neo4j/import
  data:         /var/lib/neo4j/data
  certificates: /var/lib/neo4j/certificates
  run:          /var/lib/neo4j/run
Starting Neo4j.
2017-12-26 06:51:42.867+0000 WARN  Unknown config option: causal_clustering.discovery_listen_address
2017-12-26 06:51:42.872+0000 WARN  Unknown config option: causal_clustering.raft_advertised_address
2017-12-26 06:51:42.872+0000 WARN  Unknown config option: causal_clustering.raft_listen_address
2017-12-26 06:51:42.872+0000 WARN  Unknown config option: ha.host.coordination
2017-12-26 06:51:42.872+0000 WARN  Unknown config option: causal_clustering.transaction_advertised_address
2017-12-26 06:51:42.873+0000 WARN  Unknown config option: causal_clustering.discovery_advertised_address
2017-12-26 06:51:42.873+0000 WARN  Unknown config option: ha.host.data
2017-12-26 06:51:42.874+0000 WARN  Unknown config option: causal_clustering.transaction_listen_address
2017-12-26 06:51:42.917+0000 INFO  ======== Neo4j 3.3.1 ========
2017-12-26 06:51:42.995+0000 INFO  Starting...
2017-12-26 06:51:45.790+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2017-12-26 06:51:52.936+0000 INFO  Started.
2017-12-26 06:51:55.374+0000 INFO  Remote interface available at http://localhost:7474/
qij5mzcb

qij5mzcb2#

在我的例子中,问题是配置文件不是我所想的那个。
根据this documentation,它应该在<neo4j-home>/conf/neo4j.conf以下
但是,运行neo4j stop,然后运行neo4j start,会打印出几个密钥路径。
Directories in use: home: /var/lib/neo4j config: /etc/neo4j logs: /var/log/neo4j plugins: /var/lib/neo4j/plugins import: /var/lib/neo4j/import data: /var/lib/neo4j/data certificates: /var/lib/neo4j/certificates run: /var/run/neo4j
因此,编辑在/etc/neo4j下找到的配置工作正常。

相关问题