docs-site/content/0.13.0/api/cluster-operations.md
Creates a point-in-time snapshot of a Typesense node's state and data in the specified directory.
You can then backup the snapshot directory that gets created and later restore it as a data directory, as needed.
<Tabs :tabs="['JavaScript','Python','Ruby','Shell']"> <template v-slot:JavaScript>client.operations.perform('snapshot', {'snapshot_path': '/tmp/typesense-data-snapshot'})
client.operations.perform('snapshot', {'snapshot_path': '/tmp/typesense-data-snapshot'})
client.operations.perform('snapshot', {'snapshot_path': '/tmp/typesense-data-snapshot'})
curl "http://localhost:8108/operations/snapshot?snapshot_path=/tmp/typesense-data-snapshot" -X POST \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}"
{
"success": true
}
POST ${TYPESENSE_HOST}/operations/snapshot
| Parameter | Required | Description |
|---|---|---|
| snapshot_path | yes | The directory on the server where the snapshot should be saved. |
Triggers a follower node to initiate the raft voting process, which triggers leader re-election.
The follower node that you run this operation against will become the new leader, once this command succeeds.
<Tabs :tabs="['JavaScript','Python','Ruby','Shell']"> <template v-slot:JavaScript>client.operations.perform('vote')
client.operations.perform('vote')
client.operations.perform('vote')
curl "http://localhost:8108/operations/vote" -X POST \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}"
{
"success": true
}
POST ${TYPESENSE_HOST}/operations/vote