Neo4J 3.5版本升级4.X版本变化和升级步骤文档(官方)

1. 配置变更 

Previous nameChangeNew name (if applicable)

dbms.active_database

Renamed

dbms.default_database

dbms.connectors.default_listen_address

Renamed

dbms.default_listen_address

dbms.connectors.default_advertised_address

Renamed

dbms.default_advertised_address

dbms.backup.address

Renamed

dbms.backup.listen_address

dbms.logs.query.enabled

This is no longer a boolean setting. Valid values are: OFFINFO or VERBOSE.

 

causal_clustering.cluster_routing_ttl

Renamed

dbms.routing_ttl

causal_clustering.middleware_logging.level

Renamed
Valid values are: DEBUG,INFOWARNERROR or NONE

causal_clustering.middleware.logging.level

causal_clustering.disable_middleware_logging

Discontinued
Set causal_clustering.middleware.logging.level=OFF to disable middleware logging.

 

metrics.neo4j.logrotation.enabled

Renamed

metrics.neo4j.logs.enabled

metrics.enabled

This setting no longer changes the default values of the individual metrics. Instead it turns off the whole metrics module.

 

2. SSL 变更

v3.xChangev4.x

The configuration settings dbms.security.property_level.enabled and dbms.security.property_level.blacklist are used to disallow properties.

Discontinued

The Cypher DENY command replaces the blocking functionality. Note that the DENY command must be applied while Neo4j is running.

For details, see Cypher Manual v4.0 → Graph and sub-graph access control.

dbms.security.auth_provider

Discontinued

This setting is replaced by two new settings: dbms.security.authentication_providers and dbms.security.authorization_providers.

dbms.connector.https.enabled is set to true by default.

This setting is no longer true by default.

To enable Neo4j to listen for incoming connections on the HTTPS port, you have to configure this setting to true.

The different communication channels are secured independently from each other, using the following configuration settings:

bolt.ssl_policy=<policy name>

https.ssl_policy=<policy name>

causal_clustering.ssl_policy=<policy name>

dbms.backup.ssl_policy=<policy name>

Discontinued

These settings have been replaced by the setting dbms.ssl.policy.<scope>.enabled=true, where <scope> substitutes the communication channel (bolthttpscluster, and backup).

SSL support for Bolt and HTTPS using the legacy SSL system.

Deprecated

It is recommended to use the standard SSL configuration.

The dbms.directories.certificates setting is used to explicitly configure the directory that stores the private key and certificate files.

Discontinued

It is recommended to use the standard SSL configuration.

dbms.ssl.policy.*.allow_key_generation

Discontinued

Neo4j no longer automatically generates a self-signed certificate.

3. 用户认证

3.x 版本用户认证信息保存于 Flat File 中,4.0 开始采用更加复杂和安全的方式存储于特定的数据库system中,并且采用基于角色的管理控制方式。

Authentication and authorization

4. 数据库

从4.0版起,Neo4j支持在同一DBMS中管理多个数据库。这些数据库的元数据(包括相关的安全模型)保存在一个称为system数据库的特殊数据库中。

默认安装完之后,应当有两个数据库

  • system - the system database, containing metadata on the DBMS and security configuration.

  • neo4j - the default database. A different name can be configured before starting Neo4j for the first time.

随着多个数据库的引入,数据库命名规则发生了变化。例如,不再可以在数据库名称中使用下划线

为了支持多个数据库,存储文件、事务文件和日志文件不再存储在基本目录中。每个数据库中的文件被分隔成不同的目录存储

5. 集群变化

集群变化主要是集群发现和REST API endpoints 变化

集群发现由原来的 Hazelcast 实现转为 Akka 实现

REST API endpoints 变化 :

Old endpointNew endpoint

/db/manage/server/causalclustering/writable

/db/<databasename>/cluster/writable

/db/manage/server/causalclustering/read-only

/db/<databasename>/cluster/read-only

/db/manage/server/causalclustering/available

/db/<databasename>/cluster/available

/db/manage/server/causalclustering/status

/db/<databasename>/cluster/status

6. Cypher 语法

变化详情-> Cypher Manual → Removals, deprecations, additions and extensions

从4.0版本开始,参数由 {parameter} 变为 $parameter

7. 程序变化

v3.xv4.xComment

db.awaitIndex (indexId :: INTEGER?, timeOutSeconds = 300 :: INTEGER?) :: VOID

db.awaitIndex (indexName :: STRING?, timeOutSeconds = 300 :: INTEGER?) :: VOID

Indexes are identified by name instead of ID.

dbms.cluster.overview() :: (id :: STRING?, addresses :: LIST? OF STRING?, role :: STRING?, groups :: LIST? OF STRING?, database :: STRING?)

dbms.cluster.overview() :: (id :: STRING?, addresses :: LIST? OF STRING?, databases :: MAP?, groups :: LIST? OF STRING?)

Show roles for all databases.

dbms.cluster.role() :: (role :: STRING?)

dbms.cluster.role (database :: STRING?) :: (role :: STRING?)

Take database name as a parameter.

dbms.cluster.routing.getRoutingTable(context :: MAP?) :: (ttl :: INTEGER?, servers :: LIST? OF MAP?)

dbms.cluster.routing.getRoutingTable (context :: MAP?, database = null :: STRING?) :: (ttl :: INTEGER?, servers :: LIST? OF MAP?)

Take database name as a parameter.

db.createIndex (index :: STRING?, providerName :: STRING?) :: (index :: STRING?, providerName :: STRING?, status :: STRING?)

db.createIndex (indexName :: STRING?, labels :: LIST? OF STRING?, properties :: LIST? OF STRING?, providerName :: STRING?, config = {} :: MAP?) :: (name :: STRING?, labels :: LIST? OF STRING?, properties :: LIST? OF STRING?, providerName :: STRING?, status :: STRING?)

  • Take labels and properties as separate lists instead of the index pattern ":Label(prop)" as an argument.

  • Those are also yielded as a result.

  • Needs indexName.

  • (Optional) Take index settings as a map.

db.createUniquePropertyConstraint (index :: STRING?, providerName :: STRING?) :: (index :: STRING?, providerName :: STRING?, status :: STRING?)

db.createUniquePropertyConstraint (constraintName :: STRING?, labels :: LIST? OF STRING?, properties :: LIST? OF STRING?, providerName :: STRING?, config = {} :: MAP?) :: (name :: STRING?, labels :: LIST? OF STRING?, properties :: LIST? OF STRING?, providerName :: STRING?, status :: STRING?)

  • Take labels and properties as separate lists instead of the index pattern ":Label(prop)" as an argument.

  • Those are also yielded as a result.

  • Needs constraintName.

  • (Optional) Take index settings as a map.

db.createNodeKey (index :: STRING?, providerName :: STRING?) :: (index :: STRING?, providerName :: STRING?, status :: STRING?)

db.createNodeKey (constraintName :: STRING?, labels :: LIST? OF STRING?, properties :: LIST? OF STRING?, providerName :: STRING?, config = {} :: MAP?) :: (name :: STRING?, labels :: LIST? OF STRING?, properties :: LIST? OF STRING?, providerName :: STRING?, status :: STRING?)

  • Take labels and properties as separate lists instead of the index pattern ":Label(prop)" as an argument.

  • Those are also yielded as a result.

  • Needs constraintName.

  • (Optional) Take index settings as a map.

db.indexes() :: (description :: STRING?, indexName :: STRING?, tokenNames :: LIST? OF STRING?, properties :: LIST? OF STRING?, state :: STRING?, type :: STRING?, progress :: FLOAT?, provider :: MAP?, id :: INTEGER?, failureMessage :: STRING?)

db.indexes() :: (id :: INTEGER?, name :: STRING?, state :: STRING?, populationPercent :: FLOAT?, uniqueness :: STRING?, type :: STRING?, entityType :: STRING?, labelsOrTypes :: LIST? OF STRING?, properties :: LIST? OF STRING?, provider :: STRING?)

  • Rename indexName to name.

  • Rename tokenNames to labelsOrTypes.

  • Rename progress to populationPercent.

  • The field type, which described entity type (node or relationship), uniqueness, and index type, is split up into typeuniqueness, and entityType.

  • The field provider is a string instead of a map.

  • description is removed in favor of db.schemaStatements.

  • failureMessage is moved to procedure db.indexDetails.

db.resampleIndex (index :: STRING?) :: VOID

db.resampleIndex (indexName :: STRING?) :: VOID

Indexes are uniquely identified by name instead of index pattern ":Label(prop)".

 

db.indexDetails (indexName :: STRING?) :: (id :: INTEGER?, name :: STRING?, state :: STRING?, populationPercent :: FLOAT?, uniqueness :: STRING?, type :: STRING?, entityType :: STRING?, labelsOrTypes :: LIST? OF STRING?, properties :: LIST? OF STRING?, provider :: STRING?, indexConfig :: MAP?, failureMessage :: STRING?)

Get all the information for the specified index from db.indexesindexConfig, and failureMessage.

 

db.schemaStatements () :: (name :: STRING?, type :: STRING?, createStatement :: STRING?, dropStatement :: STRING?)

Get all create and drop statements needed to replicate the schema rules (indexes and constraints) for this database.

 

db.ping()

The client-side tooling uses this procedure to test the connection to a database. The procedure is available in all databases and always returns true.

8. 指标变化

在4.x版本,有两类指标,全局指标和数据库本地指标,指标命名相对于3.x版本有所不同,具体查看Operations Manual → Metrics

注意:4.2版本指标默认开启发生变化,任何你想开启的指标必须配置在 metrics.filter 中,此外,在4.2版本中,默认情况下不再通过JMX公开指标。这些可以通过添加metrics.jmx来启用。配置 enabled=true 在neo4j.conf中。

9. 日志变化

从4.0版本开始,Neo4j日志具有日志行所属数据库的名称,打印在常规文本之前。例如,[neo4j]或[system]。

2019-12-02 22:27:41.820+0000 INFO [o.n.k.d.Database] [system] No check point found in transaction log
2019-12-02 22:27:41.820+0000 INFO [o.n.k.d.Database] [system] Recovery required from position LogPosition{logVersion=0, byteOffset=64}
2019-12-02 22:27:41.820+0000 INFO [o.n.k.r.Recovery] [system]   10% completed
2019-12-02 22:27:41.820+0000 INFO [o.n.k.r.Recovery] [system]   20% completed
2019-12-02 22:27:41.820+0000 INFO [o.n.k.r.Recovery] [system]   30% completed

其他日志行可能是DBMS相关联的操作或者更高级别的组件记录

2019-12-02 22:27:41.964+0000 INFO [c.n.c.c.CoreDatabaseManager] Creating 'neo4j' database.
2019-12-02 22:27:41.967+0000 INFO [c.n.c.c.CoreDatabaseManager] Starting 'neo4j' database.

日志参数变化

Configuration settingNeo4j 4.0Neo4j 4.1Neo4j 4.2Neo4j 4.3

causal_clustering.middleware.logging.level

New

     

dbms.directories.transaction.logs.root

New

     

dbms.tx_log.preallocate

New

     

fabric.driver.logging.level

New

     

metrics.neo4j.logs.enabled

New

     

causal_clustering.middleware_logging.level

Removed

     

dbms.logs.timezone

Removed

     

metrics.neo4j.logrotation.enabled

Removed

     

causal_clustering.log_shipping_retry_timeout

 

New

   

dbms.logs.query.early_raw_logging_enabled

 

New

   

dbms.logs.query.parameter_full_entities

 

New

   

dbms.routing.driver.logging.level

 

New

   

dbms.logs.security.rotation.delay

   

Deprecated

 

dbms.logs.user.rotation.delay

   

Deprecated

 

dbms.logs.debug.rotation.delay

   

Deprecated

 

dbms.logs.debug.format

     

New

dbms.logs.default_format

     

New

dbms.logs.query.format

     

New

dbms.logs.query.obfuscate_literals

     

New

dbms.logs.query.plan_description_enabled

     

New

dbms.logs.query.transaction.enabled

     

New

dbms.logs.query.transaction_id.enabled

     

New

dbms.logs.query.transaction.threshold

     

New

dbms.logs.security.format

     

New

dbms.logs.user.format

     

New

10. 工具

主要是 neo4j-admin 命令

从4.0版本开始,neo4j-admin 命令有些变化 :

  • --database 

    新增的参数

    为特定操作指定数据库。如果未指定,则使用默认的neo4j数据库

  • --nodes 

    有变化的参数

    neo4j-admin import --nodes=[<label>[:<label>]…​=]<files>…​

     

  • --relationships

    有变化的参数

    neo4j-admin import --relationships=[<type>=]<files>…​]…​

          当使用 neo4j-admin import导入数据, 你必须在导入数据操作完成之后创建数据库(使用CREATE DATABASE 在 system 数据库) . 否则, 你无法看见导入的数据

11. 备份变化

从Neo4j 4.0开始,每个数据库都是单独备份的。因此,为他们中的每一个计划备份策略非常重要。有关为您的设置设计适当备份策略的详细信息,请参阅 备份和恢复

使用neo4j-admin backup命令的--database选项指定要备份的数据库。有关更多信息,请参阅 备份联机数据库

--name参数已删除。以前使用--backup-dir时,它用于指定路径的最后一部分。路径的最后一部分现在从--database参数中推断出来,该参数指定服务器上的数据库名称。

如果以前使用--name自定义备份路径,例如,通过包含时间戳,现在可以使用--backup-dir

12. JMX变化

在3.x中,Neo4j公开了几个JMX MBean,以便除了Neo4j所公开的指标之外,还提供一些监控信息。在某些情况下,提供的数据不完整或不正确,在某些情况中,不同的bean甚至提供了冲突信息。所有以前的JMX端点(org.neo4j:*)都已被删除,并被一组新的bean(neo4j.metrics:*)所取代,这些bean暴露的信息与相应的neo4j指标完全相同。

JMX MBean仅在Enterprise Edition中可用。

13. Neo4J API变化

Neo4j 4.0是第一个需要JDK 11的主要版本。现在可以为JDK 11编译自定义扩展和过程,例如-target 11。通常建议使用最新的JDK 11来访问所有可用的修复和性能改进。

详细信息请查看

14. REST API 变化

Neo4j 4.0中删除了REST API。必须使用Cypher命令和程序,也可以通过使用官方驱动程序的Bolt

以下 HTTP endpoints 已经在Neo4j 3.4 版本过期,并且现在已经移除了

  • /db/data/branch

  • /db/data/cypher

  • /db/data/index/node

  • /db/data/index/relationship

  • /db/data/labels

  • /db/data/node

  • /db/data/relationship

  • /db/data/relationship/types

  • /db/data/schema/constraint

  • /db/data/schema/index

  • /db/data/schema/relationship/constraint

15.  HTTP API endpoints

The HTTP API endpoints 支持多数据库功能 . 比如开启一个事务从 http://localhost:7474/db/data/transaction 变化为 http://localhost:33471/db/neo4j/tx.
其他更多的, the HTTP API endpoints 遵循以下规则: http://localhost:33471/db/<database_name>/tx.

16. 外部依赖

Neo4J 4.x 版本

Group IDArtifact IDVersion

com.fasterxml.jackson.core

jackson-annotations

2.10.0

com.fasterxml.jackson.core

jackson-core

2.10.0

com.fasterxml.jackson.core

jackson-databind

2.10.0

com.fasterxml.jackson.jaxrs

jackson-jaxrs-base

2.10.0

com.fasterxml.jackson.jaxrs

jackson-jaxrs-json-provider

2.10.0

com.fasterxml.jackson.module

jackson-module-jaxb-annotations

2.10.0

com.github.ben-manes.caffeine

caffeine

2.8.0

com.github.luben

zstd-jni

1.4.3-1

commons-beanutils

commons-beanutils

1.9.4

commons-collections

commons-collections

3.2.2

commons-configuration

commons-configuration

1.10

commons-io

commons-io

2.6

commons-lang

commons-lang

2.6

commons-logging

commons-logging

1.2

com.profesorfalken

jPowerShell

3.0

com.profesorfalken

WMI4Java

1.6.3

com.sun.activation

jakarta.activation

1.2.1

com.sun.istack

istack-commons-runtime

3.0.8

com.sun.xml.fastinfoset

FastInfoset

1.2.16

com.typesafe.akka

akka-actor_2.12

2.5.22

com.typesafe.akka

akka-cluster_2.12

2.5.22

com.typesafe.akka

akka-cluster-tools_2.12

2.5.22

com.typesafe.akka

akka-coordination_2.12

2.5.22

com.typesafe.akka

akka-distributed-data_2.12

2.5.22

com.typesafe.akka

akka-protobuf_2.12

2.5.22

com.typesafe.akka

akka-remote_2.12

2.5.22

com.typesafe.akka

akka-stream_2.12

2.5.22

com.typesafe

config

1.3.3

com.typesafe

ssl-config-core_2.12

0.3.7

info.picocli

picocli

4.0.4

io.aeron

aeron-client

1.15.1

io.aeron

aeron-driver

1.15.1

io.dropwizard.metrics

metrics-core

4.1.0

io.dropwizard.metrics

metrics-graphite

4.1.0

io.dropwizard.metrics

metrics-jmx

4.1.0

io.netty

netty-all

4.1.35.Final

io.netty

netty

3.10.6.Final

io.projectreactor

reactor-core

3.2.10.RELEASE

io.prometheus

simpleclient_common

0.7.0

io.prometheus

simpleclient_dropwizard

0.7.0

io.prometheus

simpleclient_httpserver

0.7.0

io.prometheus

simpleclient

0.7.0

jakarta.activation

jakarta.activation-api

1.2.1

jakarta.annotation

jakarta.annotation-api

1.3.4

jakarta.ws.rs

jakarta.ws.rs-api

2.1.5

jakarta.xml.bind

jakarta.xml.bind-api

2.3.2

javax.activation

activation

1.1.1

javax.servlet

javax.servlet-api

3.1.0

javax.validation

validation-api

2.0.1.Final

javax.ws.rs

javax.ws.rs-api

2.1.1

javax.xml.bind

jaxb-api

2.3.0

jline

jline

2.14.3

net.java.dev.jna

jna

5.4.0

net.jpountz.lz4

lz4

1.3.0

org.agrona

agrona

0.9.31

org.apache.commons

commons-compress

1.19

org.apache.commons

commons-lang3

3.9

org.apache.commons

commons-text

1.7

org.apache.lucene

lucene-analyzers-common

8.2.0

org.apache.lucene

lucene-codecs

8.2.0

org.apache.lucene

lucene-core

8.2.0

org.apache.lucene

lucene-queryparser

8.2.0

org.apache.shiro

shiro-cache

1.4.1

org.apache.shiro

shiro-config-core

1.4.1

org.apache.shiro

shiro-config-ogdl

1.4.1

org.apache.shiro

shiro-core

1.4.1

org.apache.shiro

shiro-crypto-cipher

1.4.1

org.apache.shiro

shiro-crypto-core

1.4.1

org.apache.shiro

shiro-crypto-hash

1.4.1

org.apache.shiro

shiro-event

1.4.1

org.apache.shiro

shiro-lang

1.4.1

org.bitbucket.inkytonik.kiama

kiama_2.12

2.1.0

org.bouncycastle

bcpkix-jdk15on

1.63

org.bouncycastle

bcprov-jdk15on

1.63

org.eclipse.collections

eclipse-collections-api

10.0.0

org.eclipse.collections

eclipse-collections

10.0.0

org.eclipse.jetty

jetty-client

9.4.17.v20190418

org.eclipse.jetty

jetty-http

9.4.17.v20190418

org.eclipse.jetty

jetty-io

9.4.17.v20190418

org.eclipse.jetty

jetty-security

9.4.17.v20190418

org.eclipse.jetty

jetty-server

9.4.17.v20190418

org.eclipse.jetty

jetty-servlet

9.4.17.v20190418

org.eclipse.jetty

jetty-util

9.4.17.v20190418

org.eclipse.jetty

jetty-webapp

9.4.17.v20190418

org.eclipse.jetty

jetty-xml

9.4.17.v20190418

org.glassfish.hk2.external

jakarta.inject

2.5.0

org.glassfish.hk2

hk2-api

2.5.0

org.glassfish.hk2

hk2-locator

2.5.0

org.glassfish.hk2

hk2-utils

2.5.0

org.glassfish.jaxb

jaxb-runtime

2.3.2

org.glassfish.jaxb

txw2

2.3.2

org.glassfish.jersey.containers

jersey-container-servlet-core

2.29

org.glassfish.jersey.containers

jersey-container-servlet

2.29

org.glassfish.jersey.core

jersey-client

2.29

org.glassfish.jersey.core

jersey-common

2.29

org.glassfish.jersey.core

jersey-server

2.29

org.glassfish.jersey.inject

jersey-hk2

2.29

org.glassfish.jersey.media

jersey-media-jaxb

2.29

org.javassist

javassist

3.22.0-CR2

org.jprocesses

jProcesses

1.6.5

org.jvnet.staxex

stax-ex

1.8.1

org.neo4j.licensing-proxy

zstd-proxy

4.0.0-SNAPSHOT

org.ow2.asm

asm-analysis

7.2

org.ow2.asm

asm

7.2

org.ow2.asm

asm-tree

7.2

org.ow2.asm

asm-util

7.2

org.parboiled

parboiled-core

1.2.0

org.parboiled

parboiled-scala_2.12

1.2.0

org.reactivestreams

reactive-streams

1.0.2

org.rogach

scallop_2.12

2.1.1

org.scala-lang.modules

scala-java8-compat_2.12

0.8.0

org.scala-lang.modules

scala-parser-combinators_2.12

1.1.1

org.scala-lang

scala-library

2.12.7

org.scala-lang

scala-reflect

2.12.7

org.slf4j

slf4j-api

1.7.25

org.slf4j

slf4j-nop

1.7.25

服务升级步骤以及官方文档

 

posted @ 2022-11-28 15:28  衰草寒烟  阅读(861)  评论(0编辑  收藏  举报