blob: 5da2f19f161e429084da08a53e89f6107a13461d [file] [log] [blame]
---
title: Configure Region Persistence and Overflow
---
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
Plan persistence and overflow for your data regions and configure them accordingly.
<a id="storing_data_on_disk__section_E253562A46114CF0A4E47048D8143999"></a>
Use the following steps to configure your data regions for persistence and overflow:
1. Configure your disk stores as needed. See [Designing and Configuring Disk Stores](../../managing/disk_storage/using_disk_stores.html#defining_disk_stores). The cache disk store defines where and how the data is written to disk.
``` pre
<disk-store name="myPersistentStore" . . . >
<disk-store name="myOverflowStore" . . . >
```
2. Specify the persistence and overflow criteria for the region. If you are not using the default disk store, provide the disk store name in your region attributes configuration. To write asynchronously to disk, specify `disk-synchronous="false"`.
- For overflow, specify the overflow criteria in the region's `eviction-attributes` and name the disk store to use.
Example:
``` pre
<region name="overflowRegion" . . . >
<region-attributes disk-store-name="myOverflowStore" disk-synchronous="true">
<eviction-attributes>
<!-- Overflow to disk when 100 megabytes of data reside in the
region -->
<lru-memory-size maximum="100" action="overflow-to-disk"/>
</eviction-attributes>
</region-attributes>
</region>
```
gfsh:
You cannot configure `lru-memory-size` using gfsh.
- For persistence, set the `data-policy` to `persistent-replicate` and name the disk store to use.
Example:
``` pre
<region name="partitioned_region" refid="PARTITION_PERSISTENT">
<region-attributes disk-store-name="myPersistentStore">
. . .
</region-attributes>
</region>
```
When you start your members, overflow and persistence will be done automatically, with the disk stores and disk write behaviors.
**Note:**
You can also configure Regions and Disk Stores using the gfsh command-line interface. See [Region Commands](../../tools_modules/gfsh/quick_ref_commands_by_area.html#topic_EF03119A40EE492984F3B6248596E1DD) and [Disk Store Commands](../../tools_modules/gfsh/quick_ref_commands_by_area.html#topic_1ACC91B493EE446E89EC7DBFBBAE00EA).
<a id="storing_data_on_disk__section_0D825566F508444C98DFE57527962FED"></a>
| Related Topics |
|---------------------------------------------------------------------------------------|
| `org.apache.geode.cache.RegionAttributes` for data region persistence information |
| `org.apache.geode.cache.EvictionAttributes` for data region overflow information |
| `org.apache.geode.cache.server.ClientSubscriptionConfig` |