Post

3 followers Follow
0
Avatar

Error running quickstart examples

After setting up GemFire and starting 2 servers from the same directory according to the "Getting Started" guide I'm trying to run a few quickstart examples. The first example I happen to select was a combination of BenchmarkAckConsumer/Producer. Consumer started OK but when running Producer I got the following IOException:

Exception in thread "main" com.gemstone.gemfire.cache.DiskAccessException: For DiskStore: DEFAULT: Could not lock ".\DRLK_IFDEFAULT.lk". Other JVMs might have created diskstore with same name using the same directory., caused by java.io.IOException: The file ".\DRLK_IFDEFAULT.lk" is being used by another process.
at com.gemstone.gemfire.internal.cache.DiskStoreImpl.createLockFile(DiskStoreImpl.java:1858)

My gemfire.properties file is simple and contains only 2 entries: log-level and locators.
I'm new to this and maybe missing some simple stuff here. Any help will be greatly appreciated.

Michael

Please sign in to leave a comment.

3 comments

0
Avatar

Hello Michael,

At a first glance it seems that both servers are trying to use the same working directory and that's the reason why you receive the exception above. Could you try to use different disk stores for both members?.
In summary, make sure that the "-dir" parameter is different for both servers, and if you are using disk stores in the "cache.xml" file, make sure they don't point to the same directory in your local box.
Best regards.

Juan Ramos 0 votes
0
Avatar

Juan,
I apologize for maybe not being very clear in the description of my environment. Here it is: I have 1 region (regionA), 1 locator (locator1) and 2 servers (server1 and server2) setup and started on the Linux box. I'm trying to run the first 2 examples (BenchmarkAckConsumer and BenchmarkAckProducer) in the tutorial on my Windows computer. If I run them on the same Linux box using 2 terminal windows they run fine. However, when I run them on Windows starting as 2 separate applications in my Eclipse, the second app (Producer) throws the following exception:

java.io.IOException: The file ".\DRLK_IFDEFAULT.lk" is being used by another process.
at com.gemstone.gemfire.internal.cache.DiskStoreImpl.createLockFile(DiskStoreImpl.java:1844)

I have modified the related xml files to use the remote cache on my Linux box. The xml contains the following entry:
<cache>
<pool name="client" subscription-enabled="true">
<locator port="1099" host="myHostName"/>
</pool>
<region name="regionA" refid="REPLICATE"/>
</cache>

I tried adding the <disk-store> section to the Producer xml file but it didn't help:
<disk-store name="someName"
allow-force-compaction="true">
<disk-dirs>
<disk-dir>/BenchmarkData</disk-dir>
</disk-dirs>
</disk-store>
<region name="regionA" refid="REPLICATE"/>

I understand it is something related to configuration but can't find enough materials as to what this may be.

Michael 0 votes
0
Avatar

Hi Michael,

Please make sure you are running each server in different directory. GemFire is designed to use a shared nothing approach to disk storage. If you just start the servers from separate directories that should be sufficient to work around this.
Other option is to specify the location of the disk store on the cache.xml .

Server1
<disk-store name="someName"
allow-force-compaction="true">
<disk-dirs>
<disk-dir>server1/BenchmarkData</disk-dir>
</disk-dirs>
</disk-store>

server2
<disk-store name="someName"
allow-force-compaction="true">
<disk-dirs>
<disk-dir>server2/BenchmarkData</disk-dir>
</disk-dirs>
</disk-store>

Please let us know if this works.

Shuvro Das 0 votes