See attached, which we use in our AWS ECS containers. Note that beside WAL and data, the work directory needs persistence, because it has all the typeID mappings.
On Tue, Dec 18, 2018 at 7:32 AM Павлухин Иван <[email protected]> wrote: > Hi Rahul, > > Could you please share an ignite configuration and how do you launch a > docker container with Ignite? > Do you see something in your ignitedata/persistence ignitedata/wal > ignitedata/wal/archive after container stop? > I guess you can configure a consistentId by configuring > IgniteConfiguration bean property: > <bean id="ignite.cfg" > class="org.apache.ignite.configuration.IgniteConfiguration"> > <property name="consistentId" value="12345"/> > ... > </bean> > вт, 18 дек. 2018 г. в 12:57, RahulMetangale <[email protected]>: > > > > Hi All, > > > > I followed following steps for persistence in docker but i am observing > that > > cache is not retained after restart. From documentation i see that > > consisitentID need to be set to retain cache after restart but i am not > sure > > how it can set in configuration xml file. Any help is greatly > appreciated. > > > > Here are the steps i followed: > > 1. Created following folder on docker host in var directory > > mkdir -p ignitedata/persistence ignitedata/wal ignitedata/wal/archive > > 2. Updated default-config.xml > > > > > > 3. Ran following command to deploy ignite docker container. I updated > > default-config.xml inside container hence i did not pass the CONFIG_URI. > > > > > > > > > > > > -- > > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ > > > > -- > Best regards, > Ivan Pavlukhin > > Disclaimer The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful. This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more visit the Mimecast website.
<?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 class="org.apache.ignite.configuration.IgniteConfiguration"> <property name="igniteInstanceName" value="#{systemEnvironment['IGNITE_CLUSTER_NAME']}"/> <!-- Set to true to enable distributed class loading, default is false. --> <property name="peerClassLoadingEnabled" value="true"/> <!-- Set to false to set this node to be a client. --> <property name="clientMode" value="#{systemEnvironment['IGNITE_CLIENT_MODE']}"/> <!-- Set deployment mode. In CONTINUOUS mode, the classes do not get un-deployed when master nodes leave the grid. Un-deployment only happens when a class user version changes. --> <property name="deploymentMode" value="#{systemEnvironment['IGNITE_DEPLOYMENT_MODE']}"/> <!-- Sets failure detection timeouts to use in discoverySpi and communicationSpi. --> <property name="failureDetectionTimeout" value="45000"/> <property name="clientFailureDetectionTimeout" value="42000"/> <property name="networkTimeout" value="20000"/> <!-- Sets flag indicating whether the cluster is enabled to activate automatically after all nodes joined of the pre-defined baseline topology. This value should be the same on all nodes in the cluster. --> <property name="autoActivationEnabled" value="true"/> <!-- As default, Ignite creates a unique id for the node by generating a UUID. It is used part of the persistent storage folder path. E. g. persistent storage folder /opt/jobcase/db/node00-49755452-fa53-41d4-82d3-cfff0b830a57. It is recommended that the consistent id is set from the outside instead using generated value. --> <property name="consistentId" value="#{systemEnvironment['IGNITE_CONSISTENT_ID']}"/> <property name="dataStreamerThreadPoolSize" value="#{systemEnvironment['IGNITE_DATA_STREAMER_POOL_SIZE']}"/> <!-- use Ignite default --> <property name="systemThreadPoolSize" value="70"/> <!-- property name="publicThreadPoolSize" value="24"/ --> <!-- Use different sizes so we can predict which pool is saturated --> <!-- property name="igfsThreadPoolSize" value="80"/ --> <property name="stripedPoolSize" value="#{systemEnvironment['IGNITE_STRIPED_POOL_SIZE']}"/> <property name="asyncCallbackPoolSize" value="#{systemEnvironment['IGNITE_ASYNC_CALLBACK_POOL_SIZE']}"/> <!-- Set 4 threads for rebalancing. --> <property name="rebalanceThreadPoolSize" value="#{systemEnvironment['IGNITE_REBALANCE_THREAD_POOL_SIZE']}"/> <property name="executorConfiguration"> <list> <bean class="org.apache.ignite.configuration.ExecutorConfiguration"> <property name="name" value="affinityCallPool"/> <property name="size" value="#{systemEnvironment['IGNITE_DATA_STREAMER_POOL_SIZE']}"/> </bean> </list> </property> <!-- We need to get the binary object schema stored on volume that is part of the snapshot --> <property name="workDirectory" value="#{systemEnvironment['IGNITE_PERSISTENT_STORE']}/work"/> <!-- Enabling Apache Ignite native persistence. Details https://apacheignite.readme.io/docs/distributed-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="true"/> <!-- Increasing the buffer size to 4 GB. --> <property name="checkpointPageBufferSize" value="#{4096L * 1024 * 1024}"/> <property name="name" value="Default_Region"/> <!-- Enable metrics for this data region --> <property name="metricsEnabled" value="true"/> <!-- Setting the size of the default region to 2GB. --> <property name="maxSize" value="#{systemEnvironment['IGNITE_DEFAULT_REGION_SIZE']}"/> </bean> </property> <!-- Enable metrics for Ignite persistence --> <property name="metricsEnabled" value="true"/> <!-- Set the page size to 4 KB --> <property name="pageSize" value="4096"/> <!-- Set concurrency level --> <property name="concurrencyLevel" value="128"/> <!-- Path to the root directory where the Persistent Store will persist data and indexes. --> <property name="storagePath" value="#{systemEnvironment['IGNITE_PERSISTENT_STORE']}/store"/> <!-- <property name="storagePath" value="/opt/jobcase/db"/> --> <!-- Sets a path to the directory where WAL is stored. --> <property name="walPath" value="#{systemEnvironment['IGNITE_PERSISTENT_STORE']}/wal"/> <!-- Sets a path for the WAL archive directory. Every WAL segment will be fully copied to this directory before it can be reused for WAL purposes. --> <property name="walArchivePath" value="#{systemEnvironment['IGNITE_PERSISTENT_STORE']}/wal/archive"/> </bean> </property> <!-- Explicitly configure JDBC connector communication --> <property name="clientConnectorConfiguration"> <bean class="org.apache.ignite.configuration.ClientConnectorConfiguration"> <property name="port" value="#{systemEnvironment['IGNITE_JDBC_PORT']}"/> <property name="portRange" value="1"/> </bean> </property> <!-- Explicitly configure TCP connector communication --> <property name="connectorConfiguration"> <bean class="org.apache.ignite.configuration.ConnectorConfiguration"> <!-- Binary Client Protocol port --> <property name="port" value="#{systemEnvironment['IGNITE_SERVER_PORT']}"/> <property name="portRange" value="1"/> <!-- Path to Jetty configuration file (REST API configuration). --> <property name="jettyPath" value="#{systemEnvironment['JOBCASE_CONFIG']}/jetty-config.xml"/> </bean> </property> <!-- Explicitly configure TCP server communication --> <property name="communicationSpi"> <bean class="org.apache.ignite.spi.communication.tcp.NodeAddressFilterTcpCommunicationSpi"> <constructor-arg> <set value-type="java.lang.String"> <value>172.17.0.1</value> <!-- Filter out the Docker bridge network. --> </set> </constructor-arg> <property name="localPort" value="#{systemEnvironment['IGNITE_COMMUNICATION_PORT']}"/> <!-- These break visor when run using -cfg=$CONFIG_URI <property name="localPortRange" value="1"/> --> <property name="messageQueueLimit" value="0"/> <property name="socketWriteTimeout" value="20000"/> <!-- Maintain connection for outgoing and incoming messages separately. Default is false. --> <property name="usePairedConnections" value="true"/> </bean> </property> <property name="includeEventTypes"> <list> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CHECKPOINT_SAVED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_REBALANCE_STARTED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_REBALANCE_STOPPED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_REBALANCE_PART_LOADED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_REBALANCE_PART_UNLOADED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_TIMEDOUT"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FAILED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FAILED_OVER"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_REJECTED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_CANCELLED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CLASS_DEPLOY_FAILED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_DEPLOY_FAILED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_DEPLOYED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_UNDEPLOYED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_REBALANCE_STARTED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_REBALANCE_STOPPED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_NODE_JOINED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_NODE_LEFT"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_NODE_FAILED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_NODE_SEGMENTED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CLIENT_NODE_DISCONNECTED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CLIENT_NODE_RECONNECTED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CLASS_DEPLOYED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CLASS_UNDEPLOYED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CLASS_DEPLOY_FAILED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_DEPLOYED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_UNDEPLOYED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_DEPLOY_FAILED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_STARTED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_STOPPED"/> <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_NODES_LEFT"/> </list> </property> <!-- Logger to use. --> <property name="gridLogger"> <bean class="org.apache.ignite.logger.log4j2.Log4J2Logger"> <constructor-arg type="java.lang.String" value="#{systemEnvironment['JOBCASE_CONFIG']}/ignite-log4j2.xml"/> </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="localPort" value="#{systemEnvironment['IGNITE_DISCOVERY_PORT']}"/> <!-- These break visor when run using -cfg=$CONFIG_URI <property name="localPortRange" value="1"/> --> <property name="ipFinder"> <!-- S3 bucket approach for discovery of cluster nodes --> <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder"> <property name="bucketName" value="#{systemEnvironment['IGNITE_DISCOVERY_S3_BUCKETNAME']}"/> <!-- Ideally we would use awsCredentialsProvider here, and use the CredentialsProviderChain below but Ignite comes with an old AWS library that does not include the latter --> <property name="awsCredentialsProvider" ref="aws.creds"/> <property name="clientConfiguration"> <bean class="com.amazonaws.ClientConfiguration"> <!-- the default is 3, and in test we had issues where this was not enough to reliably start an instance The S3 SLA talks about error rate per 5 minute period. Circumstantial evidence points to 20s/try timeout --> <property name="maxErrorRetry" value="20"/> </bean> </property> </bean> </property> </bean> </property> <property name="cacheConfiguration"> <list> <bean id="cache-template-bean" abstract="true" class="org.apache.ignite.configuration.CacheConfiguration"> <property name="name" value="JobcaseDefaultCacheConfig*"/> <property name="cacheMode" value="PARTITIONED" /> <property name="backups" value="1" /> <property name="affinity"> <bean class="org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction"> <property name="affinityBackupFilter"> <bean class="org.apache.ignite.cache.affinity.rendezvous.ClusterNodeAttributeAffinityBackupFilter"> <constructor-arg> <array value-type="java.lang.String"> <!-- Backups must go to different AZs --> <value>DOCKER_HOST_AZ</value> </array> </constructor-arg> </bean> </property> </bean> </property> </bean> </list> </property> </bean> <!-- The S3 buckets used allow access to Ignite nodes themselves, so we don't need additional credentials --> <bean id="aws.creds" class="com.amazonaws.auth.DefaultAWSCredentialsProviderChain"/> </beans>
