The latest version of Linux operation and maintenance interview questions in 2023 (1)

  • About the author: A cloud computing network operation and maintenance personnel, sharing network and operation and maintenance technology and useful information every day. 

  • Public account: Netdou Cloud Computing School

  •  Motto: Keep your head down and be respectful

  • Personal homepage:  Internet Bean’s homepage

write in front

Hello everyone, I am Wangdou, a blogger focusing on the field of operation and maintenance. Today, I bring you a special topic: operation and maintenance interview questions. Today, as the IT industry continues to develop, interviews for operations and maintenance positions are no longer limited to the examination of basic knowledge, but pay more attention to candidates' practical experience, problem-solving abilities, and attitude toward continuous learning. Therefore, this article will share with you some common operation and maintenance interview questions to help you better prepare for interviews and improve your competitiveness.

With the popularization of cloud computing, big data and other technologies, operation and maintenance positions are becoming more and more important in the IT field. An excellent operation and maintenance engineer must not only have a solid technical foundation, but also need to have good problem-solving skills, teamwork spirit and learning ability. Therefore, the interview is a key step in selecting excellent operation and maintenance engineers.

During the interview process, the interviewer usually examines aspects such as basic knowledge, practical experience, teamwork, and learning ability. Below, I will introduce the interview questions in these aspects one by one, and give corresponding answer ideas and techniques. I hope that this article can help you better prepare for the operation and maintenance interview and get your favorite position.

Please note that these questions are just one of the common interview questions, and other aspects may be covered in the actual interview. Therefore, it is recommended that when preparing for interviews, in addition to mastering these questions, you should also focus on comprehensively improving your technical capabilities and overall quality.

Table of contents

1. Disk usage detection (using shell script)

2.What are the strategies for LVS load balancing?

3. Tell us about your understanding of LVS?

 4. What is the principle of load balancing?

5. What two parts does LVS consist of?

6. What are the terms related to LVS?

7. Principle of LVS-NAT mode

8. Characteristics of LVS-NAT model

9. Principle of LVS-DR mode

10. Characteristics of LVS-DR model


1. Disk usage detection (using shell script)

root@ecs-c13b ~]# cat fdisk.sh
#!/bin/bash
# 截取IP
IP=`ifconfig eth0 |awk -F " " 'NR==2{print $2}'`
# 定义使用率,并转换为数字
SPACE=`df -Ph |awk '{print int($5)}'`
for i in $SPACE
do
if [ $i -ge 90 ]
then
 echo "$IP的磁盘使用率已经超过了90%,请及时处理"
fi
done

2.What are the strategies for LVS load balancing?

LVS has three working modes: DR, Tunnel, NAT

3. Tell us about your understanding of LVS?

LVS is a virtual server cluster system that implements load balancing functions under Unix systems; it is implemented using IP load balancing technology and opportunistic content request distribution technology.

LVS adopts a three-layer structure, which are:
first layer: load scheduler;
second layer: service pool;
third layer: shared storage

The load balancer/Director is the general agent of the entire cluster. It has two network cards, one of which faces the access network.

On the client side of the station, one network card faces the entire cluster internally. Responsible for sending client requests to a group of servers for execution, and the client also believes that the service comes from this host. To give a vivid example, the cluster is a company, and the load scheduler is to collect business from the outside and distribute the received business to the real hosts in the background that actually work. Of course, work needs to be distributed according to a certain algorithm so that everyone can work fairly.

Server pool (server pool/Realserver) is a group of servers that actually execute client requests and can be used as a WEB server. This is the small employee in the example above.

Shared storage provides a shared storage area for the server pool, making it easy for the server pool to have the same content and provide the same services. A company must have a back-end account so that it can be coordinated. Otherwise, the customer pays the money to A, and B receives the customer because they do not have the same account. B said that the customer did not pay, so it is not a problem of customer experience.

 4. What is the principle of load balancing?

When the client initiates a request, the request is sent directly to the Director Server (scheduler). At this time, the request will be intelligently distributed to the real backend server according to the set scheduling algorithm. to evenly distribute the pressure.

But we know that http connections are stateless. Suppose there is a scenario where I log in to a certain store to buy something. When I like a certain product, I add it to the shopping cart, but I refresh the page. At this time, due to Due to load balancing, the scheduler selected a new server to provide services for me. All the contents of my shopping cart were gone, which resulted in a very poor user experience.

Therefore, a storage share is needed to ensure that the data requested by the user is the same.

5. What two parts does LVS consist of?

LVS consists of 2 programs, including ipvs and ipvsadm.
1. ipvs (ip virtual server): A piece of code works in the kernel space, called ipvs, and is the code that actually implements scheduling.
2. ipvsadm: The other section works in user space, called ipvsadm, which is responsible for writing rules for the ipvs kernel framework and defining who is the cluster
service and who is the back-end real server (Real Server)

6. What are the terms related to LVS?

DS: Director Server. Refers to the front-end load balancer node.
RS: Real Server. The real working server on the backend.
VIP: Virtual IP directly requests the user from the outside as the IP address of the target of the user's request.
DIP: Director Server IP, an IP address mainly used for communication with internal hosts.
RIP: Real Server IP, the IP address of the backend server.
CIP: Client IP, the IP address of the access client.

7. Principle of LVS-NAT mode


(a). When the user request reaches the Director Server, the requested data packet will first go to the PREROUTING chain in the kernel space.
At this time, the source IP of the packet is CIP and the destination IP is VIP
(b). PREROUTING checks and finds that the destination IP of the packet is the local machine and sends the packet to the INPUT chain
©. IPVS compares whether the service requested by the packet is a cluster service , if so, modify the destination IP address of the data packet to the backend server
IP, and then send the data packet to the POSTROUTING chain. At this time, the source IP of the message is CIP and the destination IP is RIP
(d). The POSTROUTING chain selects the route and sends the data packet to the Real Server
(e). The Real Server compares and finds that the destination is its own IP and begins to construct a response message. Sent back to Director Server. At this time, the source IP of the message
is RIP and the destination IP is CIP
(f). Before responding to the client, Director Server will modify the source IP address to its own VIP address and then respond to the client
. At this time, the source IP of the message is VIP and the destination IP is CIP.

8. Characteristics of LVS-NAT model

RS should use a private address, and the gateway of RS must point to DIP.
DIP and RIP must be in the same network segment.
Both request and response messages need to go through Director Server. In high-load scenarios, Director Server can easily become a performance bottleneck.
Support port mapping.
RS can be used. Any operating system.
Disadvantages: The pressure on Director Server will be relatively high. Both requests and responses need to go through the director server.

9. Principle of LVS-DR mode

(a) When a user request reaches the Director Server, the requested data packet will first go to the PREROUTING chain in the kernel space. At this time, the source IP of the message is CIP and the destination IP is VIP.

(b) PREROUTING check finds that the target IP of the data packet is the local machine, and sends the data packet to the INPUT chain

(c) IPVS compares whether the service requested by the data packet is a cluster service. If so, it changes the source MAC address in the request message to the MAC address of DIP, changes the target MAC address to the MAC address of RIP, and then sends the data packet to POSTROUTING CHAIN. At this time, neither the source IP nor the destination IP has been modified. Only the source MAC address has been modified to be the MAC address of DIP, and the destination MAC address has been modified to be the MAC address of RIP.

(d) Since DS and RS are in the same network, they are transmitted through Layer 2. The POSTROUTING chain checks that the target MAC address is the MAC address of RIP, then the data packet will be sent to the Real Server at this time.

(e) RS finds that the MAC address of the request message is its own MAC address, and receives the message. After the processing is completed, the response message is sent to the eth0 network card through the lo interface and then sent out. At this time, the source IP address is VIP and the destination IP is CIP.

(f) The response message is finally delivered to the client

10. Characteristics of LVS-DR model

Feature 1: Ensure that the front-end routing sends all packets with destination addresses to VIP to Director Server instead of RS

RS can use a private address; it can also be a public network address. If a public network address is used, RIP can be directly accessed through the Internet.

RS and Director Server must be in the same physical network

All request messages pass through the Director Server, but response messages must not pass through the Director Server.

Does not support address translation or port mapping

RS can be most common operating systems

The gateway of RS is never allowed to point to DIP (because we do not allow it to pass through the director)

Configure the VIP IP address on the lo interface on the RS

Defect: RS and DS must be in the same computer room 


Finally, I hope this article can help you achieve good results in the operation and maintenance interview and achieve your career goals. If you have any other questions or need more help, feel free to ask me. I wish you greater success in the field of operation and maintenance!

Will continue to update!

Guess you like

Origin blog.csdn.net/yj11290301/article/details/135198540