gpt4 book ai didi

c# - 如果 ON HEAP 和 OFF HEAP 内存已满,则逐出磁盘条目 APACHE IGNITE

转载 作者:行者123 更新时间:2023-11-30 22:54:39 33 4
gpt4 key购买 nike

我正在使用 Apache Ignite ver2.7,使用 Config.xml 设置启动 Ignite 服务器。

./ignite.sh $IGNITE_HOME/config/config.xml -J-Xms15g -J-Xmx17g

config.xml 包含

<property name="dataStorageConfiguration">
<bean class="org.apache.ignite.configuration.DataStorageConfiguration">
<property name="defaultDataRegionConfiguration">
<bean class="org.apache.ignite.configuration.DataRegionConfiguration">
<property name="persistenceEnabled" value="true"/>
<property name="name" value="Default_Region"/>
<property name="maxSize" value="#{15L * 1024 * 1024 * 1024}"/>

<property name="initialSize" value="#{10L * 1024 * 1024 * 1024}"/>
<property name="pageEvictionMode" value="RANDOM_2_LRU"/>
</bean>
</property>
</bean>
</property>

现在点燃开始给予

 OS: Linux 3.10.0-957.10.1.el7.x86_64 amd64
[17:37:06] VM information: Java(TM) SE Runtime Environment 1.8.0_211-b12 Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.211-b12
[17:37:06] Please set system property '-Djava.net.preferIPv4Stack=true' to avoid possible problems in mixed environments.
[17:37:06] Configured plugins:
[17:37:06] ^-- None
[17:37:06]
[17:37:06] Configured failure handler: [hnd=StopNodeOrHaltFailureHandler [tryStop=false, timeout=0, super=AbstractFailureHandler [ignoredFailureTypes=[SYSTEM_WORKER_BLOCKED]]]]
[17:37:07] Message queue limit is set to 0 which may lead to potential OOMEs when running cache operations in FULL_ASYNC or PRIMARY_SYNC modes due to message queues growth on sender and receiver sides.
[17:37:07] Security status [authentication=off, tls/ssl=off]
[17:37:07] Automatically adjusted max WAL archive size to 20.0 GiB (to override, use DataStorageConfiguration.setMaxWalArhiveSize)
[17:37:09] Nodes started on local machine require more than 80% of physical RAM what can lead to significant slowdown due to swapping (please decrease JVM heap size, data region size or checkpoint buffer size) [required=36054MB, available=31929MB]

[17:37:10] Automatically adjusted max WAL archive size to 20.0 GiB (to override, use DataStorageConfiguration.setMaxWalArhiveSize)
[17:37:10] ^-- Disable processing of calls to System.gc() (add '-XX:+DisableExplicitGC' to JVM options)
[17:37:10] ^-- Speed up flushing of dirty pages by OS (alter vm.dirty_expire_centisecs parameter by setting to 500)
[17:37:10] Refer to this page for more performance suggestions: https://apacheignite.readme.io/docs/jvm-and-system-tuning
[17:37:10]
[17:37:10] To start Console Management & Monitoring run ignitevisorcmd.{sh|bat}
[17:37:10] Data Regions Configured:
[17:37:10] ^-- Default_Region [initSize=10.0 GiB, maxSize=15.0 GiB, persistence=true]
[17:37:10]
[17:37:10] Ignite node started OK (id=b1fdc603)
[17:37:10] Topology snapshot [ver=1, locNode=b1fdc603, servers=1, clients=0, state=INACTIVE, CPUs=4, offheap=15.0GB, heap=15.0GB]
[17:37:10] ^-- Baseline [id=0, size=1, online=1, offline=0]
[17:37:10] ^-- All baseline nodes are online, will start auto-activation

[17:37:10] Performance suggestions for grid (fix if possible)
[17:37:10] To disable, set -DIGNITE_PERFORMANCE_SUGGESTIONS_DISABLED=true
[17:37:10] ^-- Enable G1 Garbage Collector (add '-XX:+UseG1GC' to JVM options)
[17:37:10] ^-- Set max direct memory size if getting 'OOME: Direct buffer memory' (add '-XX:MaxDirectMemorySize=<size>[g|G|m|M|k|K]' to JVM options)
[17:37:10] ^-- Disable processing of calls to System.gc() (add '-XX:+DisableExplicitGC' to JVM options)
[17:37:10] ^-- Speed up flushing of dirty pages by OS (alter vm.dirty_expire_centisecs parameter by setting to 500)

并连接到使用以下 c# 代码在 dotnet 应用程序中创建的客户端

 if (igniteClient == null)
{
var client = new IgniteClientConfiguration
{
Host = IP
};
igniteClient = Ignition.StartClient(client);
for(int i=0;i<n;i++)
{
igniteClient.GetOrCreateCache<int, HISTORICALDATAWithOHLC>(CacheConf);
/*HISTORICALDATAWithOHLC is a structure of OHLC*/
}
}

和创建多个缓存...在创建 n 个缓存后...客户端崩溃。

错误显示服务器端

[17:43:25,974][SEVERE][exchange-worker-#43][CacheAffinitySharedManager] Failed to initialize cache. Will try to rollback cache start routine. [cacheName=FOSECOINDOHLC]
class org.apache.ignite.IgniteCheckedException: Requested DataRegion is not configured: defaultRegion
at org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager.dataRegion(IgniteCacheDatabaseSharedManager.java:688)
at org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.initForCache(FilePageStoreManager.java:514)
at org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.initializeForCache(FilePageStoreManager.java:310)
at org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:2115)
at org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.processCacheStartRequests(CacheAffinitySharedManager.java:898)
at org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.onCacheChangeRequest(CacheAffinitySharedManager.java:798)
at org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.onCacheChangeRequest(GridDhtPartitionsExchangeFuture.java:1231)
at org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:738)
at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body0(GridCachePartitionExchangeManager.java:2667)
at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:2539)
at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
at java.lang.Thread.run(Thread.java:748)
[17:43:25,979][SEVERE][client-connector-#98][ClientListenerNioListener] Failed to process client request [req=o.a.i.i.processors.platform.client.cache.ClientCacheGetOrCreateWithConfigurationRequest@6c99a7f8]
javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: Requested DataRegion is not configured: defaultRegion
at org.apache.ignite.internal.processors.cache.GridCacheUtils.convertToCacheException(GridCacheUtils.java:1337)
at org.apache.ignite.internal.IgniteKernal.getOrCreateCache0(IgniteKernal.java:3023)
at org.apache.ignite.internal.IgniteKernal.getOrCreateCache(IgniteKernal.java:2992)
at org.apache.ignite.internal.processors.platform.client.cache.ClientCacheGetOrCreateWithConfigurationRequest.lambda$process$0(ClientCacheGetOrCreateWithConfigurationRequest.java:57)
at org.apache.ignite.internal.processors.platform.client.ClientRequest.runWithSecurityExceptionHandler(ClientRequest.java:70)
at org.apache.ignite.internal.processors.platform.client.cache.ClientCacheGetOrCreateWithConfigurationRequest.process(ClientCacheGetOrCreateWithConfigurationRequest.java:57)
at org.apache.ignite.internal.processors.platform.client.ClientRequestHandler.handle(ClientRequestHandler.java:57)
at org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:162)
at org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:45)
at org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279)
at org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)
at org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97)
at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
at org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: class org.apache.ignite.IgniteCheckedException: Requested DataRegion is not configured: defaultRegion
at org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager.dataRegion(IgniteCacheDatabaseSharedManager.java:688)
at org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.initForCache(FilePageStoreManager.java:514)
at org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.initializeForCache(FilePageStoreManager.java:310)
at org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:2115)
at org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.processCacheStartRequests(CacheAffinitySharedManager.java:898)
at org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.onCacheChangeRequest(CacheAffinitySharedManager.java:798)
at org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.onCacheChangeRequest(GridDhtPartitionsExchangeFuture.java:1231)
at org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:738)
at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body0(GridCachePartitionExchangeManager.java:2667)
at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:2539)
at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
... 1 more

我在网上搜索得到Ignite official website

<bean class="org.apache.ignite.configuration.CacheConfiguration">
...
<!-- Enable swap. -->
<property name="swapEnabled" value="true"/>
...
</bean>

通过这个设置点燃服务器不启动

我申请了

var cacheCfg = new CacheConfiguration
{
EnableSwap = true
};

此代码到我的 c# 代码,但 EnableSwap 属性不存在

我想要的是--

如果堆上和堆外内存已满,则条目将逐出到磁盘,堆上和堆外内存管理新条目的空间。

最佳答案

在启用持久化的情况下,Ignite 会自动将数据从内存中逐出到磁盘,您不需要配置 pageEvictionMode 属性。

至于您遇到的异常,我认为从异常消息中可以很清楚地看出:

Requested DataRegion is not configured: defaultRegion

看起来您在 CacheConfiguration 中选择了错误的区域名称(因为您更改了默认区域的名称)。如果只使用一个默认区域,您可以只删除该区域的名称,根本不为缓存配置区域名称。

关于c# - 如果 ON HEAP 和 OFF HEAP 内存已满,则逐出磁盘条目 APACHE IGNITE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56059937/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com