我正在启用持久性的Kubernetes集群中运行Ignite。每台机器都有一个24 GB的Java堆,其中20 GB专门用于持久内存,内存限制为110 GB。我相关的JVM选项是-XX:+AlwaysPreTouch -XX:+UseG1GC -XX:+ScavengeBeforeFullGC。在每个节点上运行DataStreamers几个小时后,群集中的节点达到k8s内存限制,触发了OOM终止。运行Java NMT后,我惊讶地发现分配给内部存储器的大量空间。
Java Heap (reserved=25165824KB, committed=25165824KB)
(mmap: reserved=25165824KB, committed=25165824KB)
Internal (reserved=42425986KB, committed=42425986KB)
(malloc=42425954KB #614365)
(mmap: reserved=32KB, committed=32KB)
Run Code Online (Sandbox Code Playgroud)
Kubernetes指标证实了这一点:
“点燃缓存”是内核页面缓存。最后一个面板“堆+持久+缓冲区”是点火指标HeapMemoryUsed+ PhysicalMemorySize+ 的总和CheckpointBufferSize。
我知道这不是数据积累的结果,因为DataStreamer在读取每个文件后都会刷新(最大约250MB),并且没有节点一次读取4个以上的文件。在排除了其他问题之后,我尝试设置-XX:MaxDirectMemorySize=10G并调用了手动GC,但是除了定期关闭所有pod并重新启动它们之外,似乎没有任何影响。
我不确定从这里去哪里。Ignite中是否有一种解决方法不强迫我使用第三方数据库?
编辑:我的DataStorageConfiguration
<property name="dataStorageConfiguration">
<bean class="org.apache.ignite.configuration.DataStorageConfiguration">
<property name="metricsEnabled" value="true"/>
<property name="checkpointFrequency" value="300000"/>
<property name="storagePath" value="/var/lib/ignite/data/db"/>
<property name="walFlushFrequency" value="10000"/>
<property name="walMode" value="LOG_ONLY"/>
<property name="walPath" value="/var/lib/ignite/data/wal"/>
<property name="walArchivePath" value="/var/lib/ignite/data/wal/archive"/>
<property name="walSegmentSize" value="2147483647"/>
<property name="maxWalArchiveSize" value="4294967294"/>
<property name="walCompactionEnabled" value="false"/>
<property name="writeThrottlingEnabled" value="False"/>
<property name="pageSize" value="4096"/>
<property name="defaultDataRegionConfiguration"> …Run Code Online (Sandbox Code Playgroud) 我正在使用OData Web API for Version 4,当我尝试使用$top参数查询OData web Api时,它会返回以下异常消息.
URI中指定的查询无效.已超出Top查询的限制"0".传入请求的值为"10"
我使用Apache Ignite dotNet LINQ作为数据源而不是Entity Framework,我的OData控制器操作方法如下:
[EnableQuery]
public IQueryable<Productioncurvepnl> GetProductioncurvepnl()
{
Console.WriteLine("Starting query to ignite");
var q = AIgniteClient.IgniteClient.Instance.ProductionCurvePnLCache.AsCacheQueryable().Select(c => c.Value);
return q;
}
Run Code Online (Sandbox Code Playgroud) 我使用数据网格作为我的主要"数据库".我注意到Hazelcast和Ignite查询性能之间存在巨大差异.我通过适当的自定义序列化和索引优化了我的数据网格使用情况,但差异仍然是明显的IMO.
由于没有人在这里问过,我将回答我自己的问题以供将来参考.这不是一个抽象(学习)练习,而是一个真实的基准测试,用于模拟大型SaaS系统中的数据网格使用 - 主要用于显示已排序和过滤的分页列表.我主要想知道,与原始无框架Hazelcast和Ignite使用相比,我的通用JDBC-ish数据网格访问层增加了多少开销.但由于我比较苹果和苹果,所以这里是基准.
我们在grails应用程序中使用apache ignite v2.2作为hibernate二级缓存.我们有4个节点集群,每个集群有10G RAM.第一个节点启动正常.但随后挂起了.有时第二次有时是第三或第四次 同样成功的创业公司也会发生但非常罕见 应用程序始终挂在同一个地方:
"host-startStop-1" #45 daemon prio=5 os_prio=0 tid=0x00007f7cac004800 nid=0x3d44 waiting on condition [0x00007f7cfdd81000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:338)
at org.apache.ignite.internal.util.future.GridFutureAdapter.get0(GridFutureAdapter.java:216)
at org.apache.ignite.internal.util.future.GridFutureAdapter.get(GridFutureAdapter.java:158)
at org.apache.ignite.internal.util.future.GridFutureAdapter.get(GridFutureAdapter.java:150)
at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager.onKernalStart(GridCachePartitionExchangeManager.java:551)
at org.apache.ignite.internal.processors.cache.GridCacheProcessor.onKernalStart(GridCacheProcessor.java:843)
at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1040)
at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1896)
at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1648)
- locked <0x00000007890a1198> (a org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance)
at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1076)
at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:596)
at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:520)
at org.apache.ignite.Ignition.start(Ignition.java:322)
Run Code Online (Sandbox Code Playgroud)
在此过程中,所有其他节点都被锁定.组态:
IgniteConfiguration configuration = new IgniteConfiguration()
List<CacheConfiguration> cacheConfigurations = []
for (String name : caches) {
CacheConfiguration cacheConfiguration = new CacheConfiguration<>()
cacheConfiguration.setCacheMode(CacheMode.REPLICATED)
cacheConfiguration.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
cacheConfiguration.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_ASYNC)
cacheConfiguration.setName(name)
cacheConfiguration.onheapCacheEnabled …Run Code Online (Sandbox Code Playgroud) 我正在使用apache点火来做PoC.这是我正在测试的场景:
步骤6和7有一些麻烦.如果我在两者之间等待足够长的时间,一切正常.但是,如果尝试将6和7太靠近,那么我在客户端上得到此错误并在节点上出现此错误.
我看到错误IgniteClientDisconnectedException: Failed to wait for topology update, client disconnected. 但有没有办法避免这个问题?设置较长的等待拓扑更新的时间实际上并不是一种选择,因为客户端可能会随时尝试连接.是否与我的群集配置有关?我看到这个文档建议无限尝试连接,这似乎只会让人犯错误.
此外,我们需要能够动态增长/收缩群集.这可能吗?内存备份是否会修复功能?
注意,如果我省略步骤6,我没有看到它失败.
群集节点配置
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<!--<import resource="./cache.xml"/>-->
<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="peerClassLoadingEnabled" value="true"/>
<property name="cacheConfiguration">
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set a cache name. -->
<property name="name" value="recordData"/>
<!--<property name="rebalanceMode" value="SYNC"/>-->
<!-- Set cache mode. -->
<property name="cacheMode" …Run Code Online (Sandbox Code Playgroud) 这就是我的代码中的全部内容。这只是使用 Ignite 的典型方式:
Ignite ignite = Ignition.ignite();
Run Code Online (Sandbox Code Playgroud)
我看到的错误消息是:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.ignite.internal.util.GridUnsafe$2 (file:/C:/Users/.../.m2/repository/org/apache/ignite/ignite-core/2.7.0/ignite-core-2.7.0.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of org.apache.ignite.internal.util.GridUnsafe$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.ignite.internal.util.IgniteUtils.<clinit>(IgniteUtils.java:795)
at org.apache.ignite.internal.IgnitionEx.<clinit>(IgnitionEx.java:209)
at org.apache.ignite.Ignition.ignite(Ignition.java:489)
at distributedjobexecutor.App.<init>(App.java:19)
at distributedjobexecutor.App.main(App.java:39)
Caused by: java.lang.RuntimeException: jdk.internal.misc.JavaNioAccess class …Run Code Online (Sandbox Code Playgroud) Apache Ignite的索引如何工作?我没有在文档中找到这些技术细节.
我使用自动持久性创建了一个缓存,连接到Mysql数据库.启动时会在该节点中填充100万行.节点处于PARTITIONED模式
当我尝试使用SQL查询从该缓存中检索数据时,它总是返回空数组.我使用"CacheTypeMetadata"索引了缓存.
请有人指出我错过了什么,或做错了什么.我一直在关注这些教程,但我无法弄清楚为什么我的查询不能正常工作.
提前致谢!
缓存:
CacheConfiguration<Dataloadermd5Key, DataLoaderMd5> cfg =
CacheConfigMd5.cache("DataMd5Cache",
new JDBCFactory<Dataloadermd5Key, DataLoaderMd5>());
Run Code Online (Sandbox Code Playgroud)
DataLoaderMd5Key:
public class Dataloadermd5Key implements Serializable {
/** */
private static final long serialVersionUID = 0L;
/** Value for idClient. */
private int idClient;
/** Value for clientPropId. */
private String clientPropId;
//...
}
Run Code Online (Sandbox Code Playgroud)
DataLoaderMd5:
public class DataLoaderMd5 implements Serializable {
/** */
private static final long serialVersionUID = 0L;
/** Value for idClient. */
private int idClient;
/** Value for clientPropId. */
private String clientPropId;
/** …Run Code Online (Sandbox Code Playgroud) Apache Ignite和Apache Storm在很多方面都是两种截然不同的技术 - 特别是因为Storm有一个非常具体的用例,而Ignite在同一个屋檐下有相当多的工具.据我了解,Ignite的核心是它的内存存储.建立在它的数据局部敏感计算.建立在各种酷玩具上.我感兴趣的是Streaming功能,它基本上是对内存缓存不断变化的查询监听器.
如果我将滑动窗口设置为一个元组,Ignite会像Storm一样提供一次一元组的功能.Ignite将数据存储在内存中.Storm不会在内存中"存储"数据,但是元组当然也存储在内存中.所以在这两种情况下我都有流媒体,我在内存中有数据,我能够分配我的计算.
我觉得,由于两种技术的抽象,编写执行许多数据转换步骤的程序可能更容易在Storm中编写.对此有何意见?
第二个问题:性能如何?我猜Ignite的数据位置可能会给它一个优势.另一方面,我认为在Storm中可以更好地分配多个步骤(在各种机器上使用不同的螺栓),而Ignite程序可能不会那么容易分割.
如果我仍然想要分发流(不仅是每个数据,还有不同机器上的步骤).我想我必须编写多个Ignite流媒体,通过缓存进行通信,对吗?这听起来比在Storm中更难(让我们回到第一个问题).
ignite ×10
java ×3
apache-spark ×1
apache-storm ×1
benchmarking ×1
c# ×1
grails ×1
grails-2.0 ×1
hazelcast ×1
kubernetes ×1
memory-leaks ×1
odata ×1
sql ×1