Search code examples
ignite

Ignite: Configuring persistence to a custom directory


I want to provide a custom directory to persist the data. My persistence configuration is:

<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"/>
                </bean>
            </property>
        </bean>
</property>

As mentioned in the documentation, by default it persists under ${IGNITE_HOME}/work/db directory on each node. I can change the directory by calling setStoragePath() method. But how do I configure it through xml.

I have searched but couldn't find in the documentation. Please help to find the right xml key for modifying this configuration.

Thanks!!


Solution

  • The correct one would be the property of DataStorageConfiguration:

    <property name="storagePath" value="$ENV_VAR/relative/path"/>
    

    Javadoc link: https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/configuration/DataStorageConfiguration.html#getStoragePath--