Saturday, 29 January 2022
KUBERNETES - The kubernetes nodes were reporting in not ready state after restart of ubuntu worker nodes
Kubernetes - The kubernetes nodes were reporting in not ready state after restart of ubuntu worker nodes.
Today after restarting the worker nodes (ubuntu2 and ubuntu3) they were showing in not-ready state.
KUBERNETES - The connection to the server 192.168.181.11:6443 was refused - did you specify the right host or port?
Today when I started by Kubernetes setup (ubuntu1-master node) and ran the command kubectl get nodes I received the below error:-
Error:- The connection to the server 192.168.181.11:6443 was refused - did you specify the right host or port?
In order to solve the issue I ran the below commands on the master node:-
- sudo -i
- swapoff -a
- exit
- strace -eopenat kubectl version
Recommended Books:-
Sunday, 16 January 2022
ANSIBLE - HOW TO DELETE FOLDER FROM REMOTE SERVERS
How to delete folder from Remote Servers
I have created 3 Ubuntu servers with the names:-
Server1 - Installed Ansible
Server2 - Client Node1
Server3- Client Node2
Note:- I installed ansible on Server1.
I have created a file :- vi remove-dir.yml
This will delete the folder /oracle from the app group [Server2 and Server3]
Recommended Books:-
Implementing DevOps with Ansible 2 Paperback
Automation with Ansible Paperback
Ansible for DevOps: Server and configuration management for humans
Ansible: From Beginner to Pro Paperback
Ansible: Up and Running- Automating Configuration Management and Deployment the Easy Way Paperback
ANSIBLE - HOW TO GET THE DISK DETAILS FROM REMOTE SERVERS
How to get the disk details from Remote Servers
I have created 3 Ubuntu servers with the names:-
Server1 - Installed Ansible
Server2 - Client Node1
Server3- Client Node2
Note:- I installed ansible on Server1.
I have created a file :- vi disk-details.yml
This will gather the disk details from the app group [Server2 and Server3]
Recommended Books:-
Implementing DevOps with Ansible 2 Paperback
Automation with Ansible Paperback
Ansible for DevOps: Server and configuration management for humans
Ansible: From Beginner to Pro Paperback
Ansible: Up and Running- Automating Configuration Management and Deployment the Easy Way Paperback
ANSIBLE - HOW TO CREATE A FOLDER AND CREATE A FILE NAMED WELCOME USING ANSIBLE FILE/COPY MODULE
How to create a folder using Ansible File Module and create a file named welcome
I have created 3 Ubuntu servers with the names:-
Server1 - Installed Ansible
Server2 - Client Node1
Server3- Client Node2
Note:- I installed ansible on Server1.
I have created a file :- vi create-file.yml
This will create the directory oracle on the / partition and welcome file under it
for app group [Server2 and Server3]
The above task has been completed successfully. We can validate the folder and file creation.
ANSIBLE - HOW TO RUN THE ANSIBLE PLAYBOOK IN SIMULATION MODE
How to run the ansible playbook in Simulation Mode.
In order to run the playbook in simulation mode, we can run the command - ansible-playbook -C [Name of the playbook].
In my example, I am running it for the playbook - create-dir-oracle.yml
Recommended Books:-
Implementing DevOps with Ansible 2 Paperback
Automation with Ansible Paperback
Ansible for DevOps: Server and configuration management for humans
Ansible: From Beginner to Pro Paperback
Ansible: Up and Running- Automating Configuration Management and Deployment the Easy Way Paperback
ANSIBLE - HOW TO CHECK THE SYNTAX/ERRORS IN ANSIBLE PLAYBOOK
How to check the syntax/errors in Ansible Playbook
In order to check the syntax for the playbook, we can run the command - ansible-playbook --syntax-check [Name of the playbook].
In my example, I am checking the errors for the playbook - create-dir-oracle.yml.
ANSIBLE - HOW TO CREATE A FOLDER USING FILE MODULE
How to create a folder using File Module
I have created 3 Ubuntu servers with the names:-
Server1 - Installed Ansible
Server2 - Client Node1
Server3- Client Node2
Note:- I installed ansible on Server1.
I have created a file :- vi create-dir-oracle.yml
ANSIBLE - HOW TO SETUP ANSIBLE ENVIRONMENT
Ansible - How to setup Ansible Environment
In my example, I will should you how to setup your ansible environment and run the ping module.
1) I have created 3 Ubuntu servers with the names:-
Server1 - Installed Ansible
Server2 - Client Node1
Server3- Client Node2
Note:- I installed ansible on Server1 by running the below commands on ubuntu:-
sudo apt-add-repository ppa:ansible/ansible
sudo apt update
sudo apt install ansible
Once ansible is installed on the server1, we can check it by running the command:- ansible --version
2) Then I generated ssh-keys on the server1 by running the command:= ssh-keygen -t rsa
This is to make sure, we can run the ansible playbooks from the ansible server. I will be using root user to execute the playbooks.
5) Then I created my inventory file in the same folder as inv
LINUX - HOW TO VIEW THE LAST FILE ENTRIES USING THE TAIL COMMAND
How to view the last file entries using the last command
In linux we can view the top file entries using the command: head
For example:-
1) Command:- tail /test1/file1 - This will show the top 10 lines of the file
2) Command:- tail -1 /test1/file1 - This will show the last line of the file
3) Command:- tail -3 /test1/file1 - This will show the last 3 lines of the file
LINUX - HOW TO VIEW THE FILE ENTRIES USING THE HEAD COMMAND
How to view the top file entries using the head command
In linux we can view the top file entries using the command: head
For example:-
1) Command:- head /test1/file1 - This will show the top 10 lines of the file
2) Command:- head -1 /test1/file1 - This will show the top 1 line of the file
3) Command:- head -3 /test1/file1 - This will show the top 3 lines of the file
LINUX - HOW TO CHANGE IP ADDRESS IN UBUNTU
How to change IP address in ubuntu.
In order to change IP address in ubuntu, we can use the command:- nmtui
And choose the interface for which the IP address is required to be changed