ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evans, Charlie" <Charlie.Ev...@vimpelcom.com>
Subject Re: Creating cache on client node in xml not working
Date Fri, 11 Nov 2016 17:26:08 GMT
Hi,


No the server does not. I was hoping the bean would be added to the server automatically somehow.
I guess not?


If I had multiple nodes as servers would they all need access to the bean xml. So the same
xml file on each node?


Thanks

________________________________
From: Andrey Gura <agura@apache.org>
Sent: 11 November 2016 18:05:30
To: user@ignite.apache.org
Subject: Re: Creating cache on client node in xml not working

Hi,

Does your Ignite server have cassandraAdminDataSource and other Cassandra related beans in
classpath?

On Fri, Nov 11, 2016 at 7:53 PM, Evans, Charlie <Charlie.Evans@vimpelcom.com<mailto:Charlie.Evans@vimpelcom.com>>
wrote:

Hi all,


I've been trying to create a cache in my application with Cassandra as the persistent storage.


My current setup is:

- starting Ignite on the server with default configs.

- application connects to the ignite server as a client and attempts to load the cache configuration
and create the cache

- the cache configuration uses CassandraCacheStoreFactory.


I'm aware I cannot do this programmatically because DataSource is not serializable (until
1.8) so have been trying to use xml files.


When my application starts it seems to create the cache (

[17:30:44,732][INFO][main][GridCacheProcessor] Started cache [name=ctntimestamp, mode=PARTITIONED])
but later just gets stuck with "[WARNING][main][GridCachePartitionExchangeManager] Still waiting
for initial partition map exchange" every 40 seconds. In the logs for the server I see the
error message

"class org.apache.ignite.IgniteCheckedException: Spring bean with provided name doesn't exist
, beanName=cassandraAdminDataSource]".

My xml file is below and is in the src/main/resources folder. It is loaded with Ignition.start(getClass.getResource("/ignite-cass.xml"))

Any ideas what the problem could be?

P.S. When will 1.8 be released? I tried doing it all programmatically with 1.8 SNAPSHOT and
it works fine.


<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/util
        http://www.springframework.org/schema/util/spring-util.xsd">

    <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>

    <util:list id="contactPoints" value-type="java.lang.String">
        <value>127.0.0.1</value>
    </util:list>

    <bean id="cassandraAdminDataSource" class="org.apache.ignite.cache.store.cassandra.datasource.DataSource">
        <property name="contactPoints" ref="contactPoints"/>
        <property name="readConsistency" value="ONE"/>
        <property name="writeConsistency" value="ONE"/>
        <property name="loadBalancingPolicy" ref="loadBalancingPolicy"/>
    </bean>

    <bean id="cache1_persistence_settings" class="org.apache.ignite.cache.store.cassandra.persistence.KeyValuePersistenceSettings">
        <constructor-arg type="java.lang.String">
            <value><![CDATA[
<persistence keyspace="test1" table="primitive_test1">
    <keyPersistence class="java.lang.String" strategy="PRIMITIVE" column="key"/>
    <valuePersistence class="java.lang.Long" strategy="PRIMITIVE" column="value"/>
</persistence>]]>
            </value>
        </constructor-arg>
    </bean>

    <!-- Ignite configuration -->
    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="clientMode" value="true"/>

        <property name="metricsLogFrequency" value="0"/>

        <property name="cacheConfiguration">
            <list>
                <!-- Configuring persistence for "cache1" cache -->
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="ctntimestamp"/>
                    <property name="readThrough" value="true"/>
                    <property name="writeThrough" value="true"/>
                    <property name="cacheStoreFactory">
                        <bean class="org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory">
                            <property name="dataSourceBean" value="cassandraAdminDataSource"/>
                            <property name="persistenceSettingsBean" value="cache1_persistence_settings"/>
                        </bean>
                    </property>
                </bean>
            </list>
        </property>
        <!-- Configuring remote ignite cluster connections -->
        <property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                        <property name="addresses">
                            <list>
                                <value>127.0.0.1</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>




Mime
View raw message