0

I am trying to setup a master-slave model of Arango. Able to do a first batch update but applier for live sync is not working. It keeps failing on indexing constraint which works perfectly fine in master and does not have a duplicate key issue.

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

applier state.

{ 
  "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" :


I tried (sync, async) everything. It is just doing the first batch update and live updates are not happening. Somehow applier is just shutting down. Please help

user2449952
  • 581
  • 1
  • 7
  • 21

1 Answers1

0

Can you try either

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

for starting the applier on the current database, or, the following for starting the applier for all databases/the entire server

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

In the latter case (setupReplicationGlobal) you can later check the state of the applier via

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

(mind the globalApplier here vs. just applier)

stj
  • 9,037
  • 19
  • 33
  • Thanks for quick reply. I think I have tried including system collections as well will give it a shot again. In fact I tried complete global and without global for replication and applier. I don't get any issue in this form but when I run require("@arangodb/replication").syncGlobal({. or require("@arangodb/replication").sync({. I get constraint issue for key I have created hasIndex. This only happenes when Master is continuously consuming data from event system. When I took copy of master not consuming event this ran without issue. – user2449952 Dec 10 '20 at 09:43
  • - I had a finding recently. A unique index is not working properly in Arango. it's having "" empty string for multiple documents somehow. This is the reason its failing while creating slave. No idea how it got placed in the first place. i have upgraded it to latest version as well for same. Not of much help. – user2449952 Jan 19 '21 at 07:03