No replication happening

Topics: Developer Forum
Oct 14, 2010 at 4:31 PM

Hi,

I am trying to get replicated cache working with an NHibernate application and am not seeing any replication occurring, I am getting a number of errors appearing in my log files.

For now I am testing this very simply with just two servers, I have configured the SharedCache.WinService.exe.config like this:

<replicatedSharedCache defaultProvider="ServerSharedCacheProvider">
    <serverSetting
ServiceCacheIpAddress="127.0.0.1"
ServiceCacheIpPort="48888"
SharedCacheVersionNumber="3.0.5.1"
LoggingEnable="1"
ServiceFamilyMode="1"
CacheAmountOfObjects="256"
CacheAmountFillFactorInPercentage="90"
ServiceCacheCleanup="LFU"
ServiceCacheCleanupThreadJob="3600000"
TcpServerMaxThreadToSet="-1"
TcpServerMinThreadToSet="-1"
SocketPoolMinAvailableSize="5"
SocketPoolValidationInterval="00:02:00"
SocketPoolTimeout="00:02:00"
/>
    <replicatedServers>
      <!--<add key="dcd1vend204" ipaddress="127.0.0.1" port="48888" />-->
      <add key="dcd1vend205" ipaddress="192.168.101.89" port="48888" />
    </replicatedServers>
    <providers>
      <add name="ServerSharedCacheProvider" type="SharedCache.WinServiceCommon.Provider.Server.IndexusServerSharedCacheProvider, SharedCache.WinServiceCommon">
      </add>
    </providers>
  </replicatedSharedCache>

I have applied the same config to both servers although obviously changing the replicated server in each case as per the documentation I was able to find on this site.
While using the sharedcache test app I am seeing no replication occurring between the two servers as app1 will have some 400 keys in its cache while app2 is empty.
On both servers I am getting errors occurring at VERY regular intervals, e.g:

2010-10-14 15:37:59.0434|FATAL||DCD1VEND204: Unhandled Exception appears: The type initializer for 'SharedCache.WinServiceCommon.Provider.Cache.IndexusDistributionCache' threw an exception.    at SharedCache.WinServiceCommon.CacheUtil.HandleProtocol(IndexusMessage msg, String lastUsedServerNodeIp)||CacheUtil.HandleProtocol => LogHandler.Fatal => LoggerImpl.Write
2010-10-14 15:37:59.0718|FATAL||DCD1VEND204: Unhandled Exception appears: The type initializer for 'SharedCache.WinServiceCommon.Provider.Cache.IndexusDistributionCache' threw an exception.    at SharedCache.WinServiceCommon.CacheUtil.HandleProtocol(IndexusMessage msg, String lastUsedServerNodeIp)||CacheUtil.HandleProtocol => LogHandler.Fatal => LoggerImpl.Write
2010-10-14 15:37:59.0874|FATAL||DCD1VEND204: Unhandled Exception appears: The type initializer for 'SharedCache.WinServiceCommon.Provider.Cache.IndexusDistributionCache' threw an exception.    at SharedCache.WinServiceCommon.CacheUtil.HandleProtocol(IndexusMessage msg, String lastUsedServerNodeIp)||CacheUtil.HandleProtocol => LogHandler.Fatal => LoggerImpl.Write
2010-10-14 15:37:59.0874|FATAL||DCD1VEND204: Unhandled Exception appears: The type initializer for 'SharedCache.WinServiceCommon.Provider.Cache.IndexusDistributionCache' threw an exception.    at SharedCache.WinServiceCommon.CacheUtil.HandleProtocol(IndexusMessage msg, String lastUsedServerNodeIp)||CacheUtil.HandleProtocol => LogHandler.Fatal => LoggerImpl.Write
2010-10-14 15:37:59.1225|FATAL||DCD1VEND204: Unhandled Exception appears: The type initializer for 'SharedCache.WinServiceCommon.Provider.Cache.IndexusDistributionCache' threw an exception.    at SharedCache.WinServiceCommon.CacheUtil.HandleProtocol(IndexusMessage msg, String lastUsedServerNodeIp)||CacheUtil.HandleProtocol => LogHandler.Fatal => LoggerImpl.Write

A second set of errors I definitely don't understand are as follows:

2010-10-14 15:44:57.7831|FATAL||DCD1VEND204: Client could NOT reconnect to host 192.168.212.50 and keeps this node disabled||ManageTcpSocketConnectionPool.ValidateConnectionPools => TcpSocketConnectionPool.Validate => LoggerImpl.Write
2010-10-14 15:46:57.7692|FATAL||DCD1VEND204: Client tried to disable host 192.168.212.50. during this step an exception appeared.|The type initializer for 'SharedCache.WinServiceCommon.Provider.Cache.IndexusDistributionCache' threw an exception.|CacheUtil.Ping => CacheUtil.HandleProtocol => ManageTcpSocketConnectionPool.Disable

Nowhere in any of my configs is 192.168.212.50 referenced.

Any help you can give with this would be very much appreciated.

Many thanks.

Jon

Oct 15, 2010 at 11:33 AM

when i search the source code for 192.168.212.50 I found the following results which are all commented.

C:\Dev\WS2008\Codeplex02\SharedCache\SharedCache.WinService\App.config(33): <!--<add key="SrvZh02" ipaddress="192.168.212.50" port="48888" />-->

C:\Dev\WS2008\Codeplex02\SharedCache\SharedCache.WinServiceTestClient\App.config(24): <!--<add key="srvzh02" ipaddress="192.168.212.50" port="48888"/>-->

C:\Dev\WS2008\Codeplex02\SharedCache\SharedCache.Notify\App.config(44): <!--<add key="srvzh02" ipaddress="192.168.212.50" port="48888"/>-->

C:\Dev\WS2008\Codeplex02\SharedCache\SharedCache.Testing\SharedCache.WinServiceTestClient.exe.config(29): <!-- <add key="srvzh02" ipaddress="192.168.212.50" port="48888"/> -->

C:\Dev\WS2008\Codeplex02\SharedCache\SharedCache.Testing\singleInstance.SharedCache.WinService.exe.config(33): <!--<add key="SrvZh02" ipaddress="192.168.212.50" port="48888" />-->

 

 

 

Oct 15, 2010 at 12:13 PM

Thanks for your reply.

I assume you are searching the most up to date code, I am using the 3.0.5.1 version of SharedCache which I believe is changeset 25909, is it possible that there is something in this older version?

Would it likely be beneficial for me to download and use the latest source?

I am most concerned about the type initializer error as I think this may very well be what is preventing the replication from happening.

Thanks again,

Jon

Oct 18, 2010 at 4:36 PM

I have now updated to the latest code and seem to have run into the same issue as previous posters in that replication only occurs in one direction, from most recently started instance to least recently started instance. :(

Oct 20, 2010 at 9:29 AM

currently i do not have time to analyze fix code. if you wish you can download the code and share with us your results or even get access on code level.

 

regards, roni