我正在使用Restinpress 0.10.4中嵌入的Infinispan 7.2.5。我已经在3台虚拟机中部署了我的RestExpress应用程序。但我看不到任何与infinispan相关的日志(org.infinispan,org.jboss,org.jgroups)。
2016-03-07 01:00:42 DEBUG logging:15 - Logging Provider: infinispan.org.jboss.logging.Log4jLoggerProvider
2016-03-07 01:00:42 DEBUG ServiceFinder:61 - Loading service impl: JpaStoreLifecycleManager
2016-03-07 01:00:42 DEBUG ServiceFinder:52 - No service impls found: ModuleMetadataFileFinder
2016-03-07 01:00:42 DEBUG ServiceFinder:52 - No service impls found: ModuleCommandExtensions
2016-03-07 01:00:42 DEBUG ModuleProperties:80 - No module command extensions to load
2016-03-07 01:00:42 DEBUG DefaultCacheManager:631 - Started cache manager test-cluster on null
当我在3台虚拟机中设置Infinispan时,它运行正常。
01:10:55,376 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
01:10:55,741 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
01:10:55,884 INFO [org.jboss.as] (MSC service thread 1-7) JBAS015899: JBoss Infinispan Server 7.2.5.Final (WildFly 8.2.0.Final) starting
...........
我的缓存配置如下。
GlobalConfigurationBuilder global = GlobalConfigurationBuilder.defaultClusteredBuilder();
global.transport().clusterName("test-cluster");
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.clustering().cacheMode(CacheMode.DIST_SYNC);
// Initialize the cache manager
DefaultCacheManager cacheManager = new DefaultCacheManager(global.build(), builder.build());
我的log4j配置如下。
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true"
xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - $
</layout>
</appender>
<appender name="file" class="org.apache.log4j.RollingFileAppender">
<param name="append" value="false" />
<param name="maxFileSize" value="10MB" />
<param name="maxBackupIndex" value="10" />
<param name="file" value="/var/log/caceh-restservice-test.log" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - $
</layout>
</appender>
<logger name="com">
<level value="INFO" />
</logger>
<logger name="org">
<level value="INFO" />
</logger>
<logger name="org.infinispan">
<level value="DEBUG"/>
</logger>
<logger name="org.jboss">
<level value="DEBUG"/>
</logger>
<logger name="com.xxxxx.test.infinispandistributed">
<level value="DEBUG" />
</logger>
<root>
<level value="DEBUG" />
<appender-ref ref="console" />
<!-- appender-ref ref="file" /-->
</root>
</log4j:configuration>
任何帮助都会受到赞赏。
答案 0 :(得分:2)
我会回答我自己的问题。
节点似乎注意到加入群集,或者在收到第一个请求之前,缓存不会启动。
将值放入缓存后,会按预期生成日志。
2016-03-07 23:53:53 INFO JGroupsTransport:186 - ISPN000078: Starting JGroups channel test-cluster
2016-03-07 23:53:53 WARN UDP:536 - JGRP000015: the send buffer of socket DatagramSocket was set to 1MB, but the OS only allocated 131.07KB. This might lead to performance problems. Please set your max send buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
2016-03-07 23:53:53 WARN UDP:548 - JGRP000015: the receive buffer of socket DatagramSocket was set to 20MB, but the OS only allocated 131.07KB. This might lead to performance problems. Please set your max receive buffer in the OS correctly (e.g. net.core.rmem_max on Linux)