用于管理和修复锡拉集群的python脚本
scylla-cli的Python项目详细描述
锡拉cli
用于管理和修复(以智能方式)锡拉集群的python脚本。 它使用 advanced repair techniques。
先决条件
- python>;=3.5
- 应该可以通过ssh连接或直接访问群集中的每个锡拉主机
- 锡拉rest api监听
<localhost|IP>:10000
上的每个锡拉主机
可以设置以下env变量以使您的生活更轻松:
export SCYLLA_HOST='10.210.92.46' # initial endpoint for obtaining cluster topology
export SCYLLA_USERNAME='root' # ssh user on Scylla host
export SCYLLA_PKEY='/home/USER/.ssh/id_rsa' # Defaults to ~/.ssh/id_rsa
export SCYLLA_CONNECTION_METHOD='ssh' # or 'direct'
安装
pip3 install scylla-cli
开发
virtualenv -p python3 scylla-cli
pip3 install --editable .
检查群集状态
scli status
修复锡拉星团
# connect to the cluster via 10.210.92.46 with root credentials and repair
# sync keyspace on every endpoint in local DC only
$ scli -u root -p repair sync --local
# connect to the cluster via 10.210.92.46 with root credentials and repair
# sync keyspace on 10.210.92.46 only
$ scli -u root -p repair sync --local --hosts 10.210.92.46
# connect to the cluster via 10.210.92.46 with root credentials and repair
# sync keyspace on every host except 10.210.92.46
$ scli -u root -p repair sync --local --exclude 10.210.92.46