升级到 Neo4j 3.0 企业版分步指南 - Linux
Neo4j 3.0 是一次重要的发布,包含目录结构重新组织以及配置文件/参数名称的大幅变更。这意味着升级到该版本需要额外的注意事项和几个额外步骤。为了为您提供最佳的升级体验,我们将在每个受支持的操作系统平台上逐步演示升级过程。
| 本文示例假设只有单实例。对于集群升级,请参考相同的步骤,并结合产品文档中列出的附加步骤。 |
使用 tar.gz 包在 Linux 上升级
假设条件
-
Neo4j 2.3.7 已经安装在
/var/lib/neo4j/neo4j-enterprise-2.3.7 -
Neo4j 2.3.7 是由
neo4j操作系统用户安装、配置和管理的
步骤
-
进入 NEO4J_HOME 目录
$ cd /var/lib/neo4j/ -
获取 3.0 软件
$ wget http://www.neo4j.com/customer/download/neo4j-enterprise-3.0.4-unix.tar.gz -
备份现有的 Neo4j 2.3.7 安装
$ ./neo4j-enterprise-2.3.7/bin/neo4j-backup -to /tmp/neo4j_2.3.7_backup -host 127.0.0.1 -
解压 3.0 软件
$ tar -xzf neo4j-enterprise-3.0.4-unix.tar.gz -
更改 3.0 目录的所有者
$ chown -R neo4j:neo4j ./neo4j-enterprise-3.0.4 -
停止 Neo4j 2.3.7 服务器
$ ./neo4j-enterprise-2.3.7/bin/neo4j stop -
切换到 Neo4j 3.0 主目录
$ cd neo4j-enterprise-3.0.4 -
使用新的配置迁移工具,将 Neo4j 2.3.7 安装的配置迁移到新的 Neo4j 3.0
$ java -jar config-migrator.jar /var/lib/neo4j/neo4j-enterprise-2.3.7 . -
使用
neo4j-admin将数据存储从 2.3.7 的位置迁移到 3.0$ ./bin/neo4j-admin import --mode=database --database=graph.db --from=/var/lib/neo4j/neo4j-enterprise-2.3.7/data/graph.db $ ls data/databases/ graph.db -
编辑
conf/neo4j.conf文件,并-
取消注释以下行:
dbms.allow_format_migration=true -
取消注释以下行:
dbms.active_database=graph.db注意:如果数据库不是 graph.db,请改为相应的名称
-
-
将 2.3.7 安装中的认证信息复制到 3.0(如果已启用认证)
$ cp -R /var/lib/neo4j/neo4j-enterprise-2.3.7/conf/ssl ./conf/ssl -
将插件从 2.3.7 安装复制到 3.0(如果有的话)
$ cp /var/lib/neo4j/neo4j-enterprise-2.3.7/plugins/* ./plugins -
启动 Neo4j:
./bin/neo4j start或./bin/neo4j console$ ./bin/neo4j start Starting Neo4j. Started neo4j (pid 39823). By default, it is available at https://:7474/ There may be a short delay until the server is ready. See /var/lib/neo4j/neo4j-enterprise-3.0.4/logs/neo4j.log for current status. -
跟踪
neo4j.log以查看存储升级进度,并确保数据库成功上线2016-04-15 19:58:20.310+0000 INFO Starting... 2016-04-15 19:58:21.568+0000 INFO Initiating metrics... 2016-04-15 19:58:21.898+0000 INFO Starting upgrade of database 2016-04-15 19:58:21.939+0000 INFO Migrating Indexes (1/3): 2016-04-15 19:58:21.946+0000 INFO 10% completed 2016-04-15 19:58:21.946+0000 INFO 20% completed 2016-04-15 19:58:21.951+0000 INFO 30% completed 2016-04-15 19:58:21.951+0000 INFO 40% completed 2016-04-15 19:58:21.951+0000 INFO 50% completed 2016-04-15 19:58:21.951+0000 INFO 60% completed 2016-04-15 19:58:21.951+0000 INFO 70% completed 2016-04-15 19:58:21.951+0000 INFO 80% completed 2016-04-15 19:58:21.951+0000 INFO 90% completed 2016-04-15 19:58:21.952+0000 INFO 100% completed 2016-04-15 19:58:21.952+0000 INFO Migrating Legacy indexes (2/3): 2016-04-15 19:58:21.997+0000 INFO 10% completed 2016-04-15 19:58:21.998+0000 INFO 20% completed 2016-04-15 19:58:21.999+0000 INFO 30% completed 2016-04-15 19:58:21.999+0000 INFO 40% completed 2016-04-15 19:58:21.999+0000 INFO 50% completed 2016-04-15 19:58:22.000+0000 INFO 60% completed 2016-04-15 19:58:22.000+0000 INFO 70% completed 2016-04-15 19:58:22.000+0000 INFO 80% completed 2016-04-15 19:58:22.001+0000 INFO 90% completed 2016-04-15 19:58:22.002+0000 INFO 100% completed 2016-04-15 19:58:22.002+0000 INFO Migrating Store files (3/3): 2016-04-15 19:58:22.727+0000 INFO Initiating metrics... 2016-04-15 19:58:23.552+0000 INFO 10% completed 2016-04-15 19:58:23.553+0000 INFO 20% completed 2016-04-15 19:58:23.553+0000 INFO 30% completed 2016-04-15 19:58:23.553+0000 INFO 40% completed 2016-04-15 19:58:23.553+0000 INFO 50% completed 2016-04-15 19:58:23.553+0000 INFO 60% completed 2016-04-15 19:58:23.553+0000 INFO 70% completed 2016-04-15 19:58:23.554+0000 INFO 80% completed 2016-04-15 19:58:23.554+0000 INFO 90% completed 2016-04-15 19:58:23.554+0000 INFO 100% completed 2016-04-15 19:58:23.682+0000 INFO Successfully finished upgrade of database 2016-04-15 19:58:28.447+0000 INFO Started. 2016-04-15 19:58:28.844+0000 INFO Mounted REST API at: /db/manage 2016-04-15 19:58:30.920+0000 INFO Remote interface available at https://:7474/
使用 Debian (apt-get) 在 Linux 上升级
假设条件
-
您已熟悉位于 http://debian.neo4j.org/ 的说明
-
Neo4j Enterprise 2.3.7(或其他 2.x 版本)已通过 Debian 包安装
步骤
-
使用 apt-get 更新
$ sudo apt-get update -
安装 neo4j-enterprise=3.0.4
$ sudo apt-get install neo4j-enterprise=3.0.4 -
提示时选择 N 选项,因为我们稍后会修正
Configuration file '/etc/neo4j/neo4j-wrapper.conf' ==> Modified (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** neo4j-wrapper.conf (Y/I/N/O/D/Z) [default=N] ? N -
停止 neo4j
$ service neo4j stop -
运行随 Neo4j 3.0 附带的 config-migrator.jar 工具
$sudo java -jar /usr/share/neo4j/bin/tools/config-migrator.jar /var/lib/neo4j/ . -
将新的配置文件复制到 /etc/conf,随后将旧的文件移走,或在确认新生成的配置文件正确后删除它们
$ mkdir /etc/neo4j_archive $ mv /etc/neo4j/* /etc/neo4j_archive/ $ cp /var/lib/neo4j/conf/* /etc/neo4j -
如适用,复制认证信息(实际需要测试)
-
在 /etc/neo4j/neo4j.conf 中将 allow_format_migration 设置为 true,以及其他所需的设置。
-
启动数据库
$ service neo4j start
Debian 安装后的文件位置
/var/lib/neo4j-
数据,证书
/var/log/neo4j-
日志
/usr/share/neo4j/-
bin,lib,tools
/etc/neo4j-
conf 文件
此页面有帮助吗?