Clear stored data
StackState Self-hosted v5.0.x
The data in StackState is divided into three different sets:
  • Elasticsearch data
  • Kafka Topic data
  • StackGraph data
With this much data to store, it is 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.

Clear data using the stac CLI

Clearing the data in StackState will remove any configured permissions from the system.
The stac CLI needs access to the Admin API (default port 7071) to issue the command used below.
Running the stac CLI delete command will:
  • Stop all necessary services.
  • Delete all topology and telemetry data. Note that, the Kafka topics folder needs to be deleted manually from the StackState server. The Kafka topics folder is located in /opt/stackstate/var/lib/ and is named kafka.
  • Start StackState.
CLI: stac
CLI: sts (new)
1
# Delete all topology and telemetry data
2
stac graph delete --all
3
​
4
# The Kafka topics folder needs to be deleted manually from the StackState server:
5
# /opt/stackstate/var/lib/kafka
Copied!
Not running the stac CLI yet?
Command not available in the new sts CLI. Use the stac CLI.

Clear data manually

Clearing the data in StackState will remove any configured permissions from the system.
Kubernetes
Linux
To clear stored data in StackState running on Kubernetes, it is recommended to run a clean install.
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. 1.
    Stop the StackState and StackGraph services:
    1
    systemctl stop stackstate
    2
    systemctl stop stackgraph
    Copied!
  2. 2.
    Remove the directory that holds the files:
    1
    rm -rf /opt/stackstate/var/lib/*
    Copied!
  3. 3.
    Start the StackState and StackGraph services:
    1
    systemctl start stackstate
    2
    systemctl start stackgraph
    Copied!