# Clear stored data

The data in StackState is divided into three different sets:

* Elasticsearch data
* Kafka Topic data
* StackGraph data

With this much data to store, it's important to have the means to manage it. There is a standard 8 days data retention period set in StackState. This can be configured according to your needs using the StackState CLI or manually on each machine. Find out more about [StackState data retention](/5.1/setup/data-management/data_retention.md).

## Clear data manually

{% hint style="warning" %}
Clearing the data in StackState will **remove any configured permissions from the system**.
{% endhint %}

{% tabs %}
{% tab title="Kubernetes" %}
To clear stored data in StackState running on Kubernetes, it's recommended to run a [clean install](/5.1/setup/install-stackstate/kubernetes_openshift/kubernetes_install.md).
{% endtab %}

{% tab title="Linux" %}
Note that the below instructions are valid for a single node installation type. For a two-node installation, you need to stop the service corresponding to the node. For example, `systemctl stop stackgraph` for a StackGraph node.

1. Stop the StackState and StackGraph services:

   ```
   systemctl stop stackstate
   systemctl stop stackgraph
   ```
2. Remove the directory that holds the files:

   ```
   rm -rf /opt/stackstate/var/lib/*
   ```
3. Start the StackState and StackGraph services:

   ```
   systemctl start stackstate
   systemctl start stackgraph
   ```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://archivedocs.stackstate.com/5.1/setup/data-management/clear_stored_data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
