Main Menu

Search

HTML - Home - ABOUT TARBOTS


Welcome to tarbots.com

This site has articles which provides information on everyday commands, procedures & scripts for DevOps & Infrastructure technologies which will be very useful for System Admin, DevOps, CloudOps, Network Admins and any teams or individuals working on Infrastructure technologies.

CLICK HERE to learn more about tarbots.com


Infrastructure Products Covered In This Site

EMOC (2) Exalogic (20) Hardware (3) Infiniband (53) Linux (222) OVM (29) OVS (19) ZFS Storage Appliance (2)

HTML - HOME - RECENT ARTICLES TITLE


Recent Articles

Monday, January 6, 2025

LINUX: DNF Command Search & List All Versions Of A Particular Package That Are Available In Repository

DNF command to search and list all versions of a package which is available.

Below command can be used.


dnf --showduplicates list <package name>


For e.g. below command will list all the available olcne-agent* packages


dnf --showduplicates list olcne-agent*

Last metadata expiration check: 1:10:58 ago on Mon 06 Jan 2025 07:32:27 PM UTC.

Installed Packages

olcne-agent.x86_64                                  1.7.2-3.el8                                   @ol8_olcne17

Available Packages

olcne-agent.x86_64                                  1.7.0-8.el8                                   ol8_olcne17 

olcne-agent.x86_64                                  1.7.2-3.el8                                   ol8_olcne17 

olcne-agent.x86_64                                  1.7.3-1.el8                                   ol8_olcne17 

olcne-agent.x86_64                                  1.7.4-2.el8                                   ol8_olcne17 

olcne-agent.x86_64                                  1.7.5-17.el8                                  ol8_olcne17 

olcne-agent.x86_64                                  1.7.6-5.el8                                   ol8_olcne17 

olcne-agent.x86_64                                  1.7.7-2.el8                                   ol8_olcne17 

olcne-agent.x86_64                                  1.7.8-2.el8                                   ol8_olcne17

Tuesday, December 31, 2024

Tuesday, October 29, 2024

KUBERNETES: How to Change ETCD Leader From One Control Node To Other Using ETCDCTL Commands?

 1. Identify which Kubernetes Control Node has the leader. For his run below etcdctl command. In below command for —endpoints give the https client address endpoint of each control node.

sudo ETCDCTL_API=3 etcdctl --endpoints=https://10.0.0.182:2379,https://10.0.0.236:2379,https://10.0.0.4:2379,https://10.0.0.155:2379,https://10.0.0.96:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt   --cert=/etc/kubernetes/pki/etcd/server.crt   --key=/etc/kubernetes/pki/etcd/server.key endpoint status -w table

Below is the sample output.

+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
|        ENDPOINT         |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| https://10.0.0.182:2379 |  d5907367f2bc466 |   3.5.3 |  9.7 MB |     false |      false |         9 |     110761 |             110761 |        |
| https://10.0.0.236:2379 | e1c82ddedc10c490 |   3.5.3 |  9.7 MB |     false |      false |         9 |     110761 |             110761 |        |
|   https://10.0.0.4:2379 | 86d10b822621f9cf |   3.5.3 |  9.7 MB |      true |      false |         9 |     110761 |             110761 |        |
| https://10.0.0.155:2379 | 9869473a238b9297 |   3.5.3 |  9.6 MB |     false |      false |         9 |     110761 |             110761 |        |
|  https://10.0.0.96:2379 | c4438cde3e1e5536 |   3.5.3 |  9.5 MB |     false |      false |         9 |     110761 |             110761 |        |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+

2. Run below etcdctl command to change the leader to new control node.

sudo ETCDCTL_API=3 etcdctl --endpoints=<end-points> --cacert=/etc/kubernetes/pki/etcd/ca.crt   --cert=/etc/kubernetes/pki/etcd/server.crt   --key=/etc/kubernetes/pki/etcd/server.key move-leader <member ID>

For example, below is the example command.

In below command for —endpoints give the https client address endpoint of each control node, Replace the leader ID in this case d5907367f2bc466  with the leader ID of the Control Node you wish to change the Leader to.

sudo ETCDCTL_API=3 etcdctl --endpoints=https://10.0.0.182:2379,https://10.0.0.236:2379,https://10.0.0.4:2379,https://10.0.0.155:2379,https://10.0.0.96:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt   --cert=/etc/kubernetes/pki/etcd/server.crt   --key=/etc/kubernetes/pki/etcd/server.key move-leader d5907367f2bc466

Below is the sample console output you would see.

Leadership transferred from 86d10b822621f9cf to d5907367f2bc466

3. Run above command in step (1) to check if the leader moved to new control node.

Below is example output. As you can see leader is changed now to member ID d5907367f2bc466


+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
|        ENDPOINT         |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| https://10.0.0.182:2379 |  d5907367f2bc466 |   3.5.3 |  9.7 MB |      true |      false |        10 |     111728 |             111728 |        |
| https://10.0.0.236:2379 | e1c82ddedc10c490 |   3.5.3 |  9.7 MB |     false |      false |        10 |     111728 |             111728 |        |
|   https://10.0.0.4:2379 | 86d10b822621f9cf |   3.5.3 |  9.7 MB |     false |      false |        10 |     111728 |             111728 |        |
| https://10.0.0.155:2379 | 9869473a238b9297 |   3.5.3 |  9.6 MB |     false |      false |        10 |     111728 |             111728 |        |
|  https://10.0.0.96:2379 | c4438cde3e1e5536 |   3.5.3 |  9.5 MB |     false |      false |        10 |     111728 |             111728 |        |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+