【问题标题】:Apache Ignite autoscaling in AWS (linux)AWS (linux) 中的 Apache Ignite 自动缩放
【发布时间】:2021-03-23 12:49:53
【问题描述】:

目前,我们在 AWS 中使用 Apache Ignite Image 和 16 RAM 托管 Apache Ignite 节点。 我们希望在缓存负载增加的同时动态添加新节点。 为此,我们需要以某种方式触发该节点将很快耗尽内存,我们需要添加额外的节点。有什么方法可以追踪吗? 我尝试使用随机数据加载缓存,当 java 进程占用 30-40% 的 RAM 时,缓存失败并出现 OutOfMemoryException。 这是来自 {IGNITE_HOME}\config:

的 default-config.xml
<?xml version="1.0" encoding="UTF-8"?>
...
<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">
    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="cacheConfiguration">
            <list>
                <!-- Partitioned cache example configuration (Atomic mode). -->
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="default"/>
                    <property name="atomicityMode" value="ATOMIC"/>
                    <property name="backups" value="1"/>
                </bean>
            </list>
        </property>

        <!-- Enabling Apache Ignite Persistent Store. -->
        <property name="dataStorageConfiguration">
            <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
                <property name="defaultDataRegionConfiguration">
                    <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
                        <property name="persistenceEnabled" value="false"/>
                                                <property name="metricsEnabled" value="true"/>
                        <property name="maxSize" value="#{10L * 1024 * 1024 * 1024}"/>
                    </bean>
                </property>
            </bean>
        </property>

        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
        <property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder">
                        <property name="awsCredentialsProvider" ref="aws.creds"/>
                        <property name="bucketName" value="dev-apache-ignite"/>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>

    <!-- AWS credentials. Provide your access key ID and secret access key. -->
    <bean id="aws.creds" class="com.amazonaws.auth.InstanceProfileCredentialsProvider">
        <constructor-arg value="false" />
    </bean>

</beans>

很抱歉,如果文档中已经回答了这个问题。 是否有任何预定义的准则来为 ignite 配置 AWS 自动缩放?

【问题讨论】:

  • 这里有两个问题,第一个是你需要调整你的 Java 内存设置,如果它内存不足而只使用了 40% 的 RAM。第二个是您需要在内存使用量超过某个阈值时配置 AWS 自动扩展。这是否直接在 AWS EC2 上运行?还是 EC2 上的 ECS? Fargate 上的 ECS? EKS?

标签: amazon-web-services ignite


【解决方案1】:

JVM 占用的 RAM 量不相关。当您用完数据区域时,您将看到 IgniteOutOfMemoryException - 在您的情况下为 10G。

您可以将DataRegionMetrics.getOffheapUsedSize() 除以数据区域大小,以了解您还剩下多少跑道。

然后您或许可以使用 GridGain K8S Operator 来扩展您的集群: https://www.gridgain.com/docs/latest/installation-guide/operator/how-tos

【讨论】:

  • alamar,谢谢您的回答。是否可以从 .NET 这个客户端获取这些数据指标?在 IIgniteClient (Apache.Ignote.Core 2.10.0) 中没有找到合适的方法
  • 您可能会运行一个计算任务,该任务将运行一些代码,这些代码将为您获取此指标。这些指标应该在服务器端收集。也许也可以通过系统视图。
猜你喜欢
  • 2017-12-02
  • 2012-06-19
  • 2021-04-07
  • 2014-05-06
  • 2020-11-04
  • 2020-11-20
  • 1970-01-01
  • 2021-05-30
  • 2019-10-09
相关资源
最近更新 更多