Replication: Master/slave fails to replicate or only replicates a few documents in local dev environment

218 views
Skip to first unread message

billba...@gmail.com

unread,
May 30, 2015, 10:14:21 AM5/30/15
to rav...@googlegroups.com

I'm running RavenDB 2951 from the console for local development.  From the same RavenDB console based server, I’ve enabled replication on a existing master db after db creation by adding "Raven/ActiveBundles": "PeriodicBackup;Replication" in Settings.  I then created a new slave db with replication configured. And set up replication from the master to the slave within Settings (e.g. Url:http://localhost:9020 and Database: MySlave, Skip Failover - checked. Changed and replicated selected) After several trying several times at disabling replication, deleting/recreating the slave db entirely and turning on replication again. Occasionally, a small quantity of the 74000 docs are replicated but never all of them.

 

A review of the logs has a few entries such as below which may or may not be significant.

 

2015-05-29 18:30:57.0966,Raven.Bundles.Replication.Tasks.ReplicationTask,Warn,eLtss,"Replication bundle is installed, but there is no destination in 'Raven/Replication/Destinations'.

Replication results in NO-OP",


I found the following: https://groups.google.com/forum/#!topic/ravendb/HetydYrjvFE that describes deleting/recreating the slave; which I have done repeatedly.
Should the described setup work?  What are some methodical steps that can be taken to get replication working?

Thanks

billba...@gmail.com

unread,
May 30, 2015, 10:20:30 AM5/30/15
to rav...@googlegroups.com


On Saturday, May 30, 2015 at 10:14:21 AM UTC-4, billba...@gmail.com wrote:

I'm running RavenDB 2951 from the console for local development.  From the same RavenDB console based server, I’ve enabled replication on a existing master db after db creation by adding "Raven/ActiveBundles": "PeriodicBackup;Replication" in Settings.  I then created a new slave db with replication configured. And set up replication from the master to the slave within Settings (e.g. Url:http://localhost:9020 and Database: MySlave, Skip Failover - checked. Changed and replicated selected) After several trying several times at disabling replication, deleting/recreating the slave db entirely and turning on replication again. Occasionally, a small quantity of the 74000 docs are replicated but never all of them.

 

A review of the logs has a few entries such as below which may or may not be significant.

 

2015-05-29 18:30:57.0966,Raven.Bundles.Replication.Tasks.ReplicationTask,Warn,eLtss,"Replication bundle is installed, but there is no destination in 'Raven/Replication/Destinations'.

Replication results in NO-OP",


{
  "Destinations": [
    {
      "Url": "http://localhost:9020",
      "Username": null,
      "Password": null,
      "Domain": null,
      "ApiKey": null,
      "Database": "MySlave",
      "TransitiveReplicationBehavior": "Replicate",
      "IgnoredClient": true,
      "Disabled": false,
      "ClientVisibleUrl": null
    }
  ],
  "Source": "c4c74271-e33f-43d4-aaef-c1a264a72722"

Oren Eini (Ayende Rahien)

unread,
May 31, 2015, 1:21:34 AM5/31/15
to ravendb
That is not a supported operation: " I’ve enabled replication on a existing master db after db creation "

You need to export the db and import it into a new db that was created with replication enabled.

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

billba...@gmail.com

unread,
May 31, 2015, 5:18:28 PM5/31/15
to rav...@googlegroups.com
I created a new master db with replication enabled. Imported data from another database (existing data would not re-import). Deleted and recreated the slave db with replication enable. Set up replication per document. Slave name verified as the same. Url verified as valid. Still no documents replicated.

{
  "Destinations": [
    {
      "Url": "http://localhost:9020",
      "Username": null,
      "Password": null,
      "Domain": null,
      "ApiKey": null,
      "Database": "MySlave",
      "TransitiveReplicationBehavior": "Replicate",
      "IgnoredClient": true,
      "Disabled": false,
      "ClientVisibleUrl": null
    }
  ],
  "Source": "c4c74271-e33f-43d4-aaef-c1a264a72722"
}

Michael Yarichuk

unread,
May 31, 2015, 5:43:45 PM5/31/15
to rav...@googlegroups.com
The field "IgnoredClient": true  means that replication is disabled for that destination. Try changing it to false
--
Best regards,

 

Michael Yarichuk

RavenDB Core Team

Tel: 972-4-6227811

Fax:972-153-4-6227811

Email : michael....@hibernatingrhinos.com

 

RavenDB paving the way to "Data Made Simple" http://ravendb.net/  

billba...@gmail.com

unread,
May 31, 2015, 8:02:35 PM5/31/15
to rav...@googlegroups.com
Replication of a single manually added document works. It appears that the issue is that imported documents are not replicated. Is it possible to replicate imported documents?

billba...@gmail.com

unread,
May 31, 2015, 8:06:27 PM5/31/15
to rav...@googlegroups.com
Another issue is that the data export already has a Raven/Replication/Destination document pointing to the original server. Not sure if I can just delete it.

billba...@gmail.com

unread,
May 31, 2015, 8:28:22 PM5/31/15
to rav...@googlegroups.com
Below is the Alert in SystemDocuments. Both the imported replication doc and newly created doc indicate errors in failure count. So is replication documents that are imported even supported?
{
  "Alerts": [
    {
      "Title": "Wrong replication source: c4c74271-e33f-43d4-aaef-c1a264a72722 instead of 2e25a7c2-7566-4fbf-b100-e967f60d44c7 in database eLtss",
      "CreatedAt": "2015-06-01T00:20:45.5002681Z",
      "Observed": false,
      "Message": "Source of the ReplicationDestinations document is not the same as the database it is located in",
      "AlertLevel": "Error",
      "Exception": null,
      "UniqueKey": "Wrong source: c4c74271-e33f-43d4-aaef-c1a264a72722, 2e25a7c2-7566-4fbf-b100-e967f60d44c7"
    }
  ]

Grisha Kotler

unread,
Jun 1, 2015, 10:37:28 AM6/1/15
to rav...@googlegroups.com
This is by design.
This prevents the replication from working on a new server after an import.
Delete this document and re-enter your replication details.

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Grisha Kotler l RavenDB Core Team Developer Mobile: +972-54-586-8647

RavenDB paving the way to "Data Made Simplehttp://ravendb.net/

billba...@gmail.com

unread,
Jun 1, 2015, 7:00:42 PM6/1/15
to rav...@googlegroups.com
I deleted the replication document on the master that was imported along with the data from the data source. Recreated the replication in the master. Created the slave with replication enabled.
There are still no documents replicated to the slave. Below is the Replication destinations. What else needs to be done?

{
  "Destinations": [
    {
      "Url": "http://localhost:9020",
      "Username": null,
      "Password": null,
      "Domain": null,
      "ApiKey": null,
      "Database": "MySlave",
      "TransitiveReplicationBehavior": "None",
      "IgnoredClient": false,

      "Disabled": false,
      "ClientVisibleUrl": null
    }
  ],
  "Source": "c4c74271-e33f-43d4-aaef-c1a264a72722"
}

Oren Eini (Ayende Rahien)

unread,
Jun 2, 2015, 3:19:20 AM6/2/15
to ravendb
Try importing the data with strip replication information. what happens then?

billba...@gmail.com

unread,
Jun 2, 2015, 8:13:03 AM6/2/15
to rav...@googlegroups.com
Created an export of the database with previous replication docs stripped out. Tried to import the "cleaned" database. Indexes read successfully. Began reading documents and receive "Exception of type 'System.OutOfMemoryException' was thrown. So the import attempt fails.

Oren Eini (Ayende Rahien)

unread,
Jun 2, 2015, 8:14:14 AM6/2/15
to ravendb
Can you send us the db in question?
Are you running in 32bits mode?

billba...@gmail.com

unread,
Jun 4, 2015, 7:43:21 AM6/4/15
to rav...@googlegroups.com
Attached db privately to you

Oren Eini (Ayende Rahien)

unread,
Jun 4, 2015, 7:46:26 AM6/4/15
to ravendb
Will continue discussion there, then

billba...@gmail.com

unread,
Jun 5, 2015, 9:40:47 AM6/5/15
to rav...@googlegroups.com
After restarting my workstation, I was able to create a new master database with replication and import the "clean" database. I recreated the slave database. No documents are replicated.
System docs below. The alert looked like it might have something to do with a database unique key issue so I recreated the replication configuration. Still no replicated docs to the slave.

{
  "Destinations": [
    {
      "Url": "http://localhost:9020",
      "Username": null,
      "Password": null,
      "Domain": null,
      "ApiKey": null,
      "Database": "eLtssAppReport",
      "TransitiveReplicationBehavior": "None",
      "IgnoredClient": false,
      "Disabled": false,
      "ClientVisibleUrl": null
    }
  ],
  "Source": "c4c74271-e33f-43d4-aaef-c1a264a72722"
}
{
  "Alerts": [
    {
      "Title": "Wrong replication source: c4c74271-e33f-43d4-aaef-c1a264a72722 instead of 2e25a7c2-7566-4fbf-b100-e967f60d44c7 in database eLtss",
      "CreatedAt": "2015-06-02T12:05:31.4308287Z",
      "Observed": false,
      "Message": "Source of the ReplicationDestinations document is not the same as the database it is located in",
      "AlertLevel": "Error",
      "Exception": null,
      "UniqueKey": "Wrong source: c4c74271-e33f-43d4-aaef-c1a264a72722, 2e25a7c2-7566-4fbf-b100-e967f60d44c7"
    },
    {
      "Title": "Wrong replication source: c4c74271-e33f-43d4-aaef-c1a264a72722 instead of 7cbbc5fb-f8fb-4440-942e-5523bc265ce8 in database eLtss",
      "CreatedAt": "2015-06-04T17:42:57.2938650Z",
      "Observed": false,
      "Message": "Source of the ReplicationDestinations document is not the same as the database it is located in",
      "AlertLevel": "Error",
      "Exception": null,
      "UniqueKey": "Wrong source: c4c74271-e33f-43d4-aaef-c1a264a72722, 7cbbc5fb-f8fb-4440-942e-5523bc265ce8"
    }
  ]
}

Oren Eini (Ayende Rahien)

unread,
Jun 8, 2015, 7:34:08 AM6/8/15
to ravendb
Okay, that make sense. When you are importing, we disable replication, to avoid the scenario where you import to a secondary database, and suddenly you have another replicating node in the network.
Remove the   "Source": "c4c74271-e33f-43d4-aaef-c1a264a72722"
And it will start replicating.

billba...@gmail.com

unread,
Jun 8, 2015, 9:42:21 AM6/8/15
to rav...@googlegroups.com
Removed  "Source": "c4c74271-e33f-43d4-aaef-c1a264a72722" from Raven/Replication/Destinations.  "Source": "7cbbc5fb-f8fb-4440-942e-5523bc265ce8" was inserted (per doc below)
Replication still has not occurred to the slave.

{
  "Destinations": [
    {
      "Url": "http://locahost:9020",

      "Username": null,
      "Password": null,
      "Domain": null,
      "ApiKey": null,
      "Database": "eLtssAppReport",
      "TransitiveReplicationBehavior": "None",
      "IgnoredClient": false,
      "Disabled": false,
      "ClientVisibleUrl": null
    }
  ],
  "Source": "7cbbc5fb-f8fb-4440-942e-5523bc265ce8"

Oren Eini (Ayende Rahien)

unread,
Jun 8, 2015, 11:37:36 AM6/8/15
to ravendb
Anything in the log?

billba...@gmail.com

unread,
Jun 9, 2015, 8:44:49 AM6/9/15
to rav...@googlegroups.com

Machine name had to be used. Looks like localhost resolution would need to be setup before it can used as in http://ravendb.net/docs/article-page/2.0/csharp/studio/bundles/replication-walkthrough.
Thanks

2015-06-08 00:00:23.4551,Raven.Bundles.Replication.Tasks.ReplicationTask,Warn,eLtss,Failed to contact replication destination: http://locahost:9020/databases/myDB,"System.Net.WebException: The remote name could not be resolved: 'locahost'

Grisha Kotler

unread,
Jun 9, 2015, 9:06:03 AM6/9/15
to rav...@googlegroups.com
It should be localhost and not locahost.

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Grisha Kotler l RavenDB Core Team Developer Mobile: +972-54-586-8647

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

RavenDB paving the way to "Data Made Simplehttp://ravendb.net/


Reply all
Reply to author
Forward
0 new messages