I think maybe the problem is you are using LocalReplicator on the replicas? I think you should only use that on the master. I think e.g. you should use HttpReplicator on the clients? Or, your own implementation that moves the files its own way.
Have you seen Shai's blog post about this? http://shaierera.blogspot.com/2013/05/the-replicator.html Mike McCandless http://blog.mikemccandless.com On Thu, Mar 13, 2014 at 12:21 PM, Roberto Franchini <ro.franch...@gmail.com> wrote: > Hi to all, > I'm trying to use the Replicator > (http://lucene.apache.org/core/4_7_0/replicator/index.html?org/apache/lucene/replicator/package-summary.html) > to backup my indexes while indexing. > > > We have a lot of writer opened at the same time committed every 5 minutes. > > So for each writer I associated a localreplicator: > > writer = new IndexWriter(directory, config); > replicator = new LocalReplicator(); > > then, when I do a commit > > writer.commit(); > replicator.publish(new IndexRevision(writer)); > > On the other side, I've a service running on a separate thread that > for each IndexDir creates this: > > private final List<ReplicationClient> replicators; > > > public void initialize() { > Directory dir = getDirFromConf) ; //internal > Replicator replicator = new LocalReplicator(); > Callable<Boolean> callback = null; > ReplicationHandler handler = new IndexReplicationHandler(dir, callback); > > File workDir = new File("/mnt/storage/backup/" + card.getId()); > SourceDirectoryFactory factory = new PerSessionDirectoryFactory(workDir); > ReplicationClient client = new ReplicationClient(replicator, handler, > factory); > > replicators.add(client); //a list of client > } > > Then it is called by a schedule to to replication: > > public void doBackup() { > for (ReplicationClient client : replicators) { > log.info("activating client:: " + client); > client.updateNow(); > } > } > > This is not working. > I'm doing it wrong, but I don't know where. > The java doc and the old blog abut replicator aren't helping me. > > Regards, > RF > > -- > Roberto Franchini > "L'impossibile รจ inevitabile" > jabber:ro.franch...@gmail.com skype:ro.franchini > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org