Neo4j 3.0.5 备份到 Azure 失败

Neo4j 3.0.5 backup to Azure failing

当 运行 在 Neo4j ent 3.0.5 上备份时,它失败并显示以下内容:

2017-11-03 14:52:43.512+0000 INFO [o.n.c.s.StoreCopyClient] Done, copied 114 
files
2017-11-03 14:52:43.923+0000 INFO [o.n.b.BackupService] Start recovering 
store
command failed: Backup failed: Unexpected Exception

当我检查/var/log/neo4j/debug.log时,似乎认为一切正常。

2017-11-03 14:52:07.423+0000 INFO [o.n.k.i.t.l.c.CheckPointerImpl] Check 
Pointing triggered by full backup [2012424]:  Starting check pointing...
2017-11-03 14:52:07.423+0000 INFO [o.n.k.i.t.l.c.CheckPointerImpl] Check 
Pointing triggered by full backup [2012424]:  Starting store flush...
2017-11-03 14:52:08.260+0000 INFO [o.n.k.i.t.l.c.CheckPointerImpl] Check 
Pointing triggered by full backup [2012424]:  Store flush completed
2017-11-03 14:52:08.260+0000 INFO [o.n.k.i.t.l.c.CheckPointerImpl] Check 
Pointing triggered by full backup [2012424]:  Starting appending check point 
entry into the tx log...
2017-11-03 14:52:08.303+0000 INFO [o.n.k.i.t.l.c.CheckPointerImpl] Check 
Pointing triggered by full backup [2012424]:  Appending check point entry 
into the tx log completed
2017-11-03 14:52:08.303+0000 INFO [o.n.k.i.t.l.c.CheckPointerImpl] Check 
Pointing triggered by full backup [2012424]:  Check pointing completed
2017-11-03 14:52:11.582+0000 INFO [o.n.b.BackupImpl] BackupServer:6362-6: 
Full backup finished.

我正在运行执行以下命令:

sudo mkdir -m +x -p /backuptoazure
sudo mount -t cifs //xxxx.file.core.windows.net/neo4jbackup /backuptoazure -o vers=3.0,username=xxxx,password=xxxx,dir_mode=0777,file_mode=0777,sec=ntlmssp
sudo neo4j-admin backup --backup-dir=/backuptoazure --name="graph.db-backup.$(date +%Y-%m-%d)"

/backuptoazure 是位于 Azure 文件上的挂载点

注意事项;

-当我执行备份命令时,文件被写入 Azure 到一个 temp-copy 文件中(即它具有访问权限),但文件在失败后被删除

-如果我 运行 将备份命令发送到本地 FS (/tmp),它会毫无问题地完成

-我可以 CP 备份到挂载点,证明它可以访问

如有任何关于下一步的建议,我们将不胜感激。特别是 Neo4j 是什么 Start recovering store 很有趣

经过一些挖掘,似乎在备份过程中,neo4j 在 CIFS 挂载点上启动了一个备份数据库的实例,并且在这样做时它试图使用 'byte range lock',我的假设是它Azure 文件不支持。

将选项 'nobrl' 添加到挂载选项会执行以下操作:

Do not send byte range lock requests to the server. This is necessary for certain applications that break with cifs style mandatory byte range locks (and most cifs servers do not yet support requesting advisory byte range locks).

所以最后的挂载命令应该是:

sudo mount -t cifs //xxxx.file.core.windows.net/neo4jbackup /backuptoazure -o vers=3.0,username=xxxx,password=xxxx,dir_mode=0777,file_mode=0777,sec=ntlmssp,nobrl

这应该有效。虽然未明确列出,但有关 Azure 文件限制的更多信息,请参阅:

https://docs.microsoft.com/en-us/rest/api/storageservices/features-not-supported-by-the-azure-file-service