A CLI tool to manage Patroni cluster, elect new leaders, and perform switchover.
Project description
Patroni CLI
Patroni CLI is a command-line tool that allows you to manage a Patroni PostgreSQL cluster. You can use it to view cluster status, elect new leaders, and perform switchovers between nodes.
Features
- View Cluster Status: List all cluster members and their roles.
- Elect New Leader: Trigger a failover and elect a new leader for the cluster.
- Switchover: Perform a switchover to a specified node or any healthy node.
Installation
You can install the Patroni CLI via pip after packaging:
pip install patroni-cli
Usage
Here are the available commands:
Check Cluster Status
patroni-cli --url http://localhost:8008 --username admin --password admin status
Elect a New Leader
patroni-cli --url http://localhost:8008 --username admin --password admin elect new_leader_name
Perform a Switchover
patroni-cli --url http://localhost:8008 --username admin --password admin switchover target_leader_name
If you want to perform a switchover without specifying a target leader, use:
patroni-cli --url http://localhost:8008 --username admin --password admin switchover
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
patroni_cli-0.1.0.tar.gz
(2.6 kB
view details)
Built Distribution
File details
Details for the file patroni_cli-0.1.0.tar.gz
.
File metadata
- Download URL: patroni_cli-0.1.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e9c3fb4bdd8501f7077ecf8092f38ce1aab7a708fd1775df62ed0621354c92e |
|
MD5 | 51a1f383ec5d760752523757d602d205 |
|
BLAKE2b-256 | 59e3d9a84fb7f464c56520650692d812483889b631f78eb06a960dd930e0022e |
File details
Details for the file patroni_cli-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: patroni_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0bbb1af0f8d9aab2662d91d36fafcffa5d6826f89e20e9a7d47ab14a470adf2 |
|
MD5 | ab4a17609fe95123e5a1fe88ce35bdbf |
|
BLAKE2b-256 | 79d66f0679fcd34d5370cdb9783e6509d8cc178339ab152c0dcfcf04f39b1d3b |