multiple computers sharing an index

多Directory 对象,在索引存放目录下,建立临时文件,标志写锁定,进行互斥写操作。

Probably what's happening is: because older versions of Lucene store  
the lock file in the /tmp directory by default, multiple computers  
sharing an index will be able to open multiple writers because they  
have their own /tmp directories.  They don't see each other's lock.

Newer versions of Lucene store the write lock in the directory  
itself, which resolves this.  You can also change the lock directory  
to a shared mount point.

类似问题

Multiple indexers on same storage location in Lucene

被建议使用,解决全部相关工作。

elasticsearch

 If you suspect that this or any other LockFactory is not working properly in your environment, you can easily test it by using VerifyingLockFactory, LockVerifyServer and LockStressTest.