Skip to content
Snippets Groups Projects
user avatar
utkubayguven authored
622bca10
History

COBRA CLI FOR MANAGING ETCD CLUSTER

This project is a COBRA-based CLI tool designed to manage etcd clusters. It allows you to easily perform tasks such as stopping nodes, reconfiguring them, rejoining nodes to the cluster, and other cluster management operations. The tool is aimed at developers and system administrators looking for a simpler and more efficient way to manage etcd clusters.

Table of Contents

Installation And Clustering

git clone https://gitlab.btsgrp.com/utku.bayguven/etcd-go-project

go build -o myapp

scp myapp root@xxx.btsgrp.com:/opt/myappfiles


cd .../config

scp config.json etcd_config.json etcd_endpoint.json root@xxx.btsgrp.com:/opt/myappfiles/config

scp start_etcd.sh root@xxx.btsgrp.com:/opt/myappfiles/script

scp etcd.service root@xxx.it.btsgrp.com:/etc/systemd/system/

Important Note: The first node listed in the "nodes" array (node1 in this example) contains the information specific to the current node where the configuration is applied. Ensure that this node's details (name and IP) match the local node's configuration to avoid misconfiguration.

All Server Side Command

sudo systemctl stop etcd.service
sudo systemctl daemon-reload
sudo systemctl enable etcd.service
sudo systemctl start etcd.service
sudo systemctl status etcd.service

Clustering

Usage

cd /opt/myappfiles

./myapp commandName [arguments]

Command

last_etcd_rebuilder

The last_etcd_rebuilder project is a specialized CLI tool designed to manage and restore an etcd cluster when only one healthy node remains operational. It’s particularly useful in scenarios where a majority of the etcd cluster nodes have failed, and you need to restore the cluster using the last available node.

last_etcd_builder  <serviceName> (etcd)

last_etcd_rebuilder Diagram

etcd_memberAdd

The etcd_memberAdd command is a CLI (Command Line Interface) tool designed to add a new node to an existing etcd cluster. This command is used to seamlessly and efficiently integrate new nodes into the cluster, especially in large-scale distributed systems.

etcd_memberAdd <mainNode> <nodeName> <containerName>

mainNode: The name of the main node in the cluster.

nodeName: The name of the node to be added.

containerName: The name of the container running the etcd instance

etcd_memberAdd