使用Java的Neo4j企业版1.8.3(嵌入式)在线备份

时间:2013-12-14 06:57:25

标签: java neo4j database-backups

我正在使用Neo4j 1.8.3企业版。我尝试使用Java进行在线备份,如下所示

val backupPath: File = new File("D:/neo4j-enterprise-1.8.3/data/backup/")
val backup = OnlineBackup.from( "127.0.0.1" )
if(backupPath.list().length > 0)
{
    backup.incremental( backupPath.getPath() , false )
}
else
{
    backup.full( backupPath.getPath() );
}

由于备份仅在版本1.9之后默认启用,因此我将下面的行添加到neo4j属性文件中

# Port to listen to for incoming backup requests.
online_backup_server=127.0.0.1:6362

我可以使用Neo4j 1.9.4企业版进行备份。但是,当我尝试使用Neo4j 1.8.3企业版时,我得到了例外情况。

Exception in thread "main" org.neo4j.com.ComException: Client could not connect to /127.0.0.1:6362
    at org.neo4j.com.Client$1.create(Client.java:119)
    at org.neo4j.com.Client$1.create(Client.java:101)
    at org.neo4j.com.ResourcePool.acquire(ResourcePool.java:104)
    at org.neo4j.com.Client.getChannel(Client.java:304)
    at org.neo4j.com.Client.sendRequest(Client.java:191)
    at org.neo4j.com.Client.sendRequest(Client.java:180)
    at org.neo4j.backup.BackupClient.fullBackup(BackupClient.java:50)
    at org.neo4j.backup.BackupService.doFullBackup(BackupService.java:98)
    at org.neo4j.backup.OnlineBackup.full(OnlineBackup.java:57)
    at Saddahaq.User_node$.backup_data(User_node.scala:1652)
    at Saddahaq.User_node$.main(User_node.scala:2313)
    at Saddahaq.User_node.main(User_node.scala)
    at Saddahaq.Fun.main(Fun.java:16)

我哪里出错了?

0 个答案:

没有答案