Persistence store

classic Classic list List threaded Threaded
7 messages Options
slut_hunter slut_hunter
Reply | Threaded
Open this post in threaded view
|

Persistence store

This post was updated on .
Good afternoon. Help me please. I use a cluster of 3 nodes 2,7,6 with the
settings <property name = "persistenceEnabled" value = "true" />
but if I turn off 1 node and turn it back on, the cluster does not restore
the cache from the storage
There is 1 warning in the logs Persistence store is configured, but both
read-through and write-through are disabled.
Tell me how to properly restore the cache from storage.

Full config:
<? 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 = "gridLogger">
            <bean class = "org.apache.ignite.logger.log4j.Log4JLogger">
                <constructor-arg type = "java.lang.String" value = "log4j.xml" />
            </bean>
        </property>
        <property name = "peerClassLoadingEnabled" value = "true" />
        <property name = "dataStorageConfiguration">
            <bean class = "org.apache.ignite.configuration.DataStorageConfiguration">
                <property name = "pageSize" value = "4096" />
                <property name = "defaultDataRegionConfiguration">
                    <bean class = "org.apache.ignite.configuration.DataRegionConfiguration">
                        <property name = "name" value = "Default_Region" />
                        <property name = "maxSize" value = "# {4L * 1024 * 1024 * 1024}" />
                        <property name = "metricsEnabled" value = "true" />
                        <property name = "persistenceEnabled" value = "true" />
                    </bean>
                </property>
            </bean>
        </property>
        <property name = "discoverySpi">
            <bean class = "org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name = "ipFinder">
                    <bean class = "org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder">
                        <property name = "serviceName" value = "cc-ignite" />
                        <property name = "namespace" value = "cc-blue" />
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>

Java client example:
  String cacheName = ContactRepository.prepareCacheName(orgId);
        CacheConfiguration cacheConfig = new CacheConfiguration(cacheName);
        cacheConfig.setCacheMode(CacheMode.PARTITIONED);
        cacheConfig.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);

        cacheConfig.setBackups(0);
        ContactCassandraCacheStoreExFactory factory = new
ContactCassandraCacheStoreExFactory();
        factory.setDataSource(cassandraSource);
        factory.setThreadsCount(4);
        factory.setCacheName(cacheName);
        factory.setLoadCacheConfig(new LoadCacheConfig(keyspace, table));
        cacheConfig.setCacheStoreFactory(factory);
        cacheConfig.setIndexedTypes(Integer.class, ContactDto.class);
                IgniteConfiguration cfg = new IgniteConfiguration();
        // Ignite persistence configuration.
        DataStorageConfiguration storageCfg = new
DataStorageConfiguration();
       
storageCfg.getDefaultDataRegionConfiguration().setPersistenceEnabled(true);
        cfg.setDataStorageConfiguration(storageCfg);
        cfg.setIgniteInstanceName("springDataNode");
        cfg.setWorkDirectory("/tmp/ignite");

        cfg.setClientMode(clientMode);
        cfg.setPeerClassLoadingEnabled(true);

        cfg.setMetricsLogFrequency(0);
        cfg.setFailureDetectionTimeout(560_000);



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Persistence store

Hello!

Since you have two storages (Persistent store and Cassandra) I would like to ask which one you are expecting to be restored from?

Regards,
--
Ilya Kasnacheev


ср, 6 нояб. 2019 г. в 12:23, slut_hunter <[hidden email]>:
Good afternoon. Help me please. I use a cluster of 3 nodes 2,7,6 with the
settings <property name = "persistenceEnabled" value = "true" />
but if I turn off 1 node and turn it back on, the cluster does not restore
the cache from the storage
There is 1 warning in the logs Persistence store is configured, but both
read-through and write-through are disabled.
Tell me how to properly restore the cache from storage.

Full config:


Java client example:
                String cacheName = ContactRepository.prepareCacheName(orgId);
        CacheConfiguration cacheConfig = new CacheConfiguration(cacheName);
        cacheConfig.setCacheMode(CacheMode.PARTITIONED);
        cacheConfig.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);

        cacheConfig.setBackups(0);
        ContactCassandraCacheStoreExFactory factory = new
ContactCassandraCacheStoreExFactory();
        factory.setDataSource(cassandraSource);
        factory.setThreadsCount(4);
        factory.setCacheName(cacheName);
        factory.setLoadCacheConfig(new LoadCacheConfig(keyspace, table));
        cacheConfig.setCacheStoreFactory(factory);
        cacheConfig.setIndexedTypes(Integer.class, ContactDto.class);
                IgniteConfiguration cfg = new IgniteConfiguration();
        // Ignite persistence configuration.
        DataStorageConfiguration storageCfg = new
DataStorageConfiguration();

storageCfg.getDefaultDataRegionConfiguration().setPersistenceEnabled(true);
        cfg.setDataStorageConfiguration(storageCfg);
        cfg.setIgniteInstanceName("springDataNode");
        cfg.setWorkDirectory("/tmp/ignite");

        cfg.setClientMode(clientMode);
        cfg.setPeerClassLoadingEnabled(true);

        cfg.setMetricsLogFrequency(0);
        cfg.setFailureDetectionTimeout(560_000);



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
slut_hunter slut_hunter
Reply | Threaded
Open this post in threaded view
|

Re: Persistence store

From Persistent store.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Persistence store

Hello!

It should be restored from persistent store. Can you provide logs from nodes? Are you sure you don't clear persistence dirs between restarts?

Regards,
--
Ilya Kasnacheev


ср, 6 нояб. 2019 г. в 15:09, slut_hunter <[hidden email]>:
From Persistent store.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
slut_hunter slut_hunter
Reply | Threaded
Open this post in threaded view
|

Re: Persistence store

ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Persistence store

Hello!

[2019-11-06 13:18:39,466][INFO ][main][GridCacheDatabaseSharedManager] Checking memory state [lastValidPos=FileWALPointer [idx=0, fileOff=0, len=0], lastMarked=FileWALPointer [idx=0, fileOff=0, len=0], lastCheckpointId=00000000-0000-0000-0000-000000000000]
[2019-11-06 13:18:39,483][INFO ][main][GridCacheDatabaseSharedManager] Applying lost cache updates since last checkpoint record [lastMarked=FileWALPointer [idx=0, fileOff=0, len=0], lastCheckpointId=00000000-0000-0000-0000-000000000000]
[2019-11-06 13:18:39,484][INFO ][main][GridCacheDatabaseSharedManager] Finished applying WAL changes [updatesApplied=0, time=0ms]

I think this means you did not have any pre-existing persistence data on that node after restart. Moreover, it seems that page store directory is different. Are you sure that you did not clear  /opt/ignite/apache-ignite/work between restarts? What does it contain currently?

Regards,
--
Ilya Kasnacheev


ср, 6 нояб. 2019 г. в 16:28, slut_hunter <[hidden email]>:
In this screenshot, we see 3 nodes with a full cache.
<http://apache-ignite-users.70518.x6.nabble.com/file/t2666/befor_stop.png>

In this screenshot, we see 3 nodes after restarting one.
<http://apache-ignite-users.70518.x6.nabble.com/file/t2666/after_start.png>


Node log before restart
befor_stop.log
<http://apache-ignite-users.70518.x6.nabble.com/file/t2666/befor_stop.log


Node log after restart
after_start.log
<http://apache-ignite-users.70518.x6.nabble.com/file/t2666/after_start.log



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
slut_hunter slut_hunter
Reply | Threaded
Open this post in threaded view
|

Re: Persistence store

The problem was that instead StatefulSet I used Deployment

Thanks for the help



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/