0

我正在尝试设置 Arango 的主从模型。能够进行第一批更新,但实时同步应用程序不起作用。它在索引约束上一直失败,这在 master 中工作得很好,并且没有重复键问题。

require("@arangodb/replication").setupReplication({
...>   endpoint: "tcp://master:8529",
...>   username: “name”,
...>   password:  “pass”,
...>   autoStart: true,
...>  incremental:true,
...>  verbose:true,
...> });

应用程序状态。

{ 
  "state" : { 
    "started" : "2020-12-08T07:21:50Z", 
    "running" : false, 
    "phase" : "inactive", 
    "lastAppliedContinuousTick" : null, 
    "lastProcessedContinuousTick" : null, 
    "lastAvailableContinuousTick" : null, 
    "safeResumeTick" : null, 
    "progress" : { 
      "time" : "2020-12-09T07:07:44Z", 
      "message" : "applier shut down", 
      "failedConnects" : 0 
    }, 
    "totalRequests" : 4, 
    "totalFailedConnects" : 0, 
    "totalEvents" : 0, 
    "totalDocuments" : 0, 
    "totalRemovals" : 0, 
    "totalResyncs" : 3, 
    "totalOperationsExcluded" : 0, 
    "totalApplyTime" : 0, 
    "averageApplyTime" : 0, 
    "totalFetchTime" : 0, 
    "averageFetchTime" : 0, 
    "lastError" : { 
      "errorNum" : 0 
    }, 
    "time" : "2020-12-09T07:13:02Z" 
  }, 
  "server" : { 
    "version" : "3.6.4", 
    "serverId" : "237391144398597" 
  }, 
  "endpoint" :


我尝试了(同步,异步)一切。它只是进行第一批更新,并没有进行实时更新。不知何故,应用程序刚刚关闭。请帮忙

4

1 回答 1

0

你可以试试吗

require("@arangodb/replication").setupReplication({ 
   endpoint: "tcp://master:8529",
   username: “name”,
   password:  “pass”,
   autoStart: true,
   incremental:true,
   verbose:true,
   includeSystem: true 
});

用于在当前数据库上启动应用程序,或者,以下用于为所有数据库/整个服务器启动应用程序

require("@arangodb/replication").setupReplicationGlobal({ 
   endpoint: "tcp://master:8529",
   username: “name”,
   password:  “pass”,
   autoStart: true,
   incremental:true,
   verbose:true
});

在后一种情况下 ( setupReplicationGlobal),您可以稍后通过以下方式检查应用程序的状态

require("@arangodb/replication").globalApplier.state();

(注意globalApplier这里与只是applier

于 2020-12-09T08:56:31.217 回答