-
H2 Console 设置系统变量 set IGNITE_H2_DEBUG_CONSOLE=true, 启动IGNITE的时候会自动弹出一个h3 console的浏览器, 可以看到建立的索引和具体的数据
参考 https://apacheignite.readme.io/docs/sql-performance-and-debugging
客户端程序可以加 System.setProperty("IGNITE_QUIET", "false"); -
SqlFieldsQuery query = new SqlFieldsQuery("explain [original query]") 可以看到SQL执行计划,主要是索引的使用
-
JMX jconsole 可以看到CACHE的基本信息,JMXBean名字是:org.apache.[cacheId].[gridName].[cacheName] 内存的使用情况: org.apache.[cacheId].MemoryMetrics 需要设置IGNITE_JMX_PORT
-
远程DEBUG 修改ignite.bat/ignite.sh 中的 JVM_OPTS:
set JVM_OPTS=-Xms1g -Xmx1g -server -XX:+AggressiveOpts -XX:MaxMetaspaceSize=256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9527
-
日志级别调整 IGNITE 支持 log4j, log4j2, slf 等等,需要将[ignite_home]/libs/optional目录下的ignite-log4j,ignite-log4j2或者ignite-slf4j 复制到libs目录下, 然后修改spring 配置文件:
<bean class="org.apache.ignite.configuration.IgniteConfiguration"> <property name="gridLogger"> <bean class="org.apache.ignite.logger.log4j.Log4JLogger"> <constructor-arg type="java.lang.String" value="log4j.xml"/> </bean> <bean class="org.apache.ignite.logger.log4j2.Log4J2Logger"> <constructor-arg type="java.lang.String" value="log4j2.xml"/> </bean> </property> <!-- Other Ignite configurations --> ... </bean>
默认使用了java.util.log [ignite_home]/config/java.util.logging.properties. 日志记录在[ignite_home]\work\log\下. 参考:https://apacheignite.readme.io/docs/logging
核心日志:
查询:
客户端 IgniteH2Indexing.queryDistributedSqlFields
if (log.isDebugEnabled())
log.debug("Parsed query: `" + sqlQry + "` into two step query: " + twoStepQry);
服务端 GridQueryProcessor.store
if (log.isDebugEnabled())
log.debug("Store [cache=" + cacheName + ", key=" + key + ", val=" + val + "]");
REBALANCE:
服务端 GridDhtPartitionSupplier.handleDemandMessage
if (log.isDebugEnabled())
log.debug("Starting supplying rebalancing [cache=" + grp.cacheOrGroupName() + ", fromNode=" + node.id() + ", partitionsCount=" + d.partitions().size() + ", topology=" + d.topologyVersion() + ", updateSeq=" + d.updateSequence() + ", idx=" + idx + "]");
if (log.isDebugEnabled())
log.debug("Finished supplying rebalancing [cache=" + grp.cacheOrGroupName() + ", fromNode=" + node.id() + ", topology=" + d.topologyVersion() + ", updateSeq=" + d.updateSequence() + ", idx=" + idx + "]");
NETWORK:
org.apache.ignite.internal.util.nio.GridTcpNioCommunicationClient
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi