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 (204) OVM (29) OVS (19) ZFS Storage Appliance (2)

HTML - HOME - RECENT ARTICLES TITLE


Recent Articles

Tuesday, April 30, 2024

LINUX: How To Check CGroups Version?

LINUX: How To Check CGroups Version?
 
Below command can be used.
 
mount | grep cgroup
 
If you see output like this with type as cgroup, that means it is using cgroups version 1. If you see type as cgroup2 it means cgroups version 2 is being used.

 
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,pids)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,hugetlb)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,freezer)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,rdma)

 

Thursday, April 11, 2024

KUBERNETES: Kubectl Command To Tail CoreDNS Pod Service Logs (Kube-Dns)

Below command can be used.

kubectl logs --follow -n kube-system --selector 'k8s-app=kube-dns'

KUBERNETES: How To Setup Kubectl Environment Variables On Control Node To Run Kubectl Commands?

Login to Kubernetes control node as user using which you want to run kubectl commands. Execute below commands to setup kubectl command

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
export KUBECONFIG=$HOME/.kube/config
echo 'export KUBECONFIG=$HOME/.kube/config' >> $HOME/.bashrc

Validate that the kubectl commands are working. For this you can run below simple command to list the pods.

kubectl get pods -owide 

LINUX: How to Create XFS Filesystem on Linux Hosts?

LINUX: How to Create XFS Filesystem on Linux Hosts?

Below are steps to create XFS filesystem on Linux hosts.

1) Attach the Disk to the Linux Host

2) Verify that the attached disk is shown.

ls -lrt /dev/

It should be shown as sdb

Please note that the name for attached disk may vary. If you are attaching the 2nd disk it will show as sbd, lets assume you are attaching one more disk and creating filesystem is will show as sdc, and any further disks attached it will show as sdd, sde .. and so on.

3) Create partition for attached / extended disk as follows:

sudo fdisk /dev/sdb

Enter inputs in fdisk console prompts as follows as highlighted in bold.

# sudo fdisk /dev/sdb

Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n >>>>> enter n here for new partition
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p   >>>>> enter p here as primary partition
Partition number (1-4, default 1): 1    >>>> enter partition number as 1
First sector (2048-251658239, default 2048):  >>> just enter go with defaults
Last sector, +sectors or +size{K,M,G,T,P} (2048-251658239, default 251658239):  >>>> just enter go with defaults

Created a new partition 1 of type 'Linux' and of size 120 GiB.

Command (m for help): p >>>>> enter p here to print partition.
Disk /dev/sdb: 120 GiB, 128849018880 bytes, 251658240 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x004734fb

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdb1        2048 251658239 251656192  120G 83 Linux

Command (m for help): w    >>>> enter w to write and save the changes.


The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.


4) Format the created partition as xfs using below command.

sudo mkfs.xfs -f /dev/sdb1

Below is sample command output you see when running above command.

meta-data=/dev/sdb1              isize=512    agcount=4, agsize=7864256 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1
data     =                       bsize=4096   blocks=31457024, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=15359, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0


5) Create a directory on which you want to mount the xfs partition. For e.g. lets assume apps

mkdir /apps

6) Mount the newly created xfs partition using below command.

sudo mount -t xfs /dev/sdb1 /apps

7) Run "df -Th" command and verify that the partition is mounted as xfs filesystem. Below is snippet.

/dev/sdb1           xfs       120G  889M  120G   1% /apps

8) Update /etc/fstab and add below entry to have newly created xfs partition automounted during the reboot.

/dev/sdb1  /apps xfs  defaults  0  0

9) Reboot the node. After the reboot you would notice that the XFS filesystem is auto mounted.