【问题标题】:How to integrate Apache Ignite with Cassandra as third party persistence?如何将 Apache Ignite 与 Cassandra 集成为第三方持久性?
【发布时间】:2021-04-28 09:24:52
【问题描述】:

我尝试了以下配置,但我得到了ClassNotFoundException for org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory。我正在使用 apache ignite 的 docker 镜像来实现相同的功能,它的版本是2.9.1

 <?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>
            <!-- Configuring persistence for "cache1" cache -->
            <bean class="org.apache.ignite.configuration.CacheConfiguration">
                <property name="name" value="cache1"/>
                <!-- Tune on Read-Through and Write-Through mode -->
                <property name="readThrough" value="true"/>
                <property name="writeThrough" value="true"/>
                <!-- Specifying CacheStoreFactory -->
                <property name="cacheStoreFactory">
                    <bean class="org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory">
                        <!-- Datasource configuration bean which is responsible for Cassandra connection details -->
                        <property name="dataSourceBean" value="cassandraDataSource"/>
                        <!-- Persistent settings bean which is responsible for the details of how objects will be persisted to Cassandra -->
                        <property name="persistenceSettingsBean" value="primitive_csndra_cache"/>
                    </bean>
                </property>
            </bean>
        </list>
          </property>
      </bean>
      
      
      <bean id="loadBalancingPolicy" class="com.datastax.driver.core.policies.TokenAwarePolicy">
              <constructor-arg type="com.datastax.driver.core.policies.LoadBalancingPolicy">
                  <bean class="com.datastax.driver.core.policies.RoundRobinPolicy"/>
              </constructor-arg>
          </bean>
      
      <bean id="cassandraAdminDataSource"
          class="org.apache.ignite.cache.store.cassandra.datasource.DataSource">
          <property name="port" value="9042" />
          <property name="contactPoints" value="mycassandra.default.svc.cluster.local" />
          <property name="readConsistency" value="ONE" />
          <property name="writeConsistency" value="ONE" />
          <property name="loadBalancingPolicy" ref="loadBalancingPolicy" />
      </bean>
      
      
      <bean id="primitive_csndra_cache" class="org.apache.ignite.cache.store.cassandra.persistence.KeyValuePersistenceSettings">
          <constructor-arg type="java.lang.String">
              <value><![CDATA[
                  <persistence keyspace="hello" table="primitive_xyz">
                      <keyPersistence class="java.lang.String" strategy="PRIMITIVE" column="key"/>
                      <valuePersistence class="java.lang.String" strategy="PRIMITIVE" column="value"/>
                  </persistence>]]>
              </value>
          </constructor-arg>
      </bean>
 </beans>

谁能帮我解决这个问题?任何类型的示例 github 项目或博客参考也对我有用。

【问题讨论】:

    标签: kubernetes cassandra ignite


    【解决方案1】:
    猜你喜欢
    • 2018-10-04
    • 1970-01-01
    • 2018-05-19
    • 2019-11-15
    • 1970-01-01
    • 2020-02-05
    • 1970-01-01
    • 2022-01-15
    • 2018-07-04
    相关资源
    最近更新 更多