40 interview essences for Linux operation and maintenance hopping

 Although no system is ever 100 percent protected, the ability for differentiating between typical network traffic as well as potentially harmful malware is considered crucial and provides the focus of this associate-level certification path. Also, if you wish to acquire this certification, you should gain the PCNSA Dumps, which are being offered at the ExamClubs.

once a year, marriage, deposit, parentar, a series of things to look at the money, we are still very simple nerves, but it is hard to go out, only to find a good method and career direction, can be realized One-step counterattack.

The following is a senior Linux operation and maintenance, dozens of companies summed up Linux operation and maintenance interview, helping everyone to find a high salary job after the year.

1, what is operation and maintenance? What is game operation? 1) Operation and maintenance refers to the maintenance of a wide network software and hardware, which is to ensure the normal operation of the business, and the process of operation in him. In the maintenance of him, he gathered the network, system, database, development, security, and monitoring the technical operation and maintenance of one, including many kinds, DBA operation and maintenance, website operation and maintenance, virtualization operation, Monitoring operation and maintenance, game operation, etc. 2) The game operation and maintenance is divided into labor, divided into development operation and maintenance, application operation and maintenance (business operation and maintenance) and system operation and maintenance development Wei: Yes, it is the application operation and maintenance platform for the application of operation and maintenance development operation and maintenance platform: it is to be online, maintained, and troubleshoot, and use the tools developed by the development of operation and maintenance to the business online, maintenance, Make troubleshooting system operation and maintenance: is an infrastructure that provides operations to application operations, such as: system, network, monitoring, hardware, etc. Summary: Development and Weight and Systems Weighing the application operation and maintenance to provide "tools" and "infrastructure" support development operations, application operation and system operation and maintenance, their work is the ring ring. 2, in the work, the operation and maintenance personnel often need to deal with operators. What do the operators do? A thing to do in the game operate, in addition to the coordination work, it also needs to communicate with each platform, time, opening service, user directivity, activity, etc. "BR /> 3, now give you three hundred servers, how do you manage them? Manage 3 hundred servers: 1) Set the skip machine, log in with a unified account, easy to consider the safety and login. 2) Use Salt, ANSIABLE, PUPPET for unified management of the system's unified scheduling and configuration. 3) Establish a simple server system, configuration, and application of CMDB information management. Easierate all kinds of information records on each server. 4, briefly describing the working principle and characteristics of the three working modes of RAID0 RAID1 RAID5 RAID, you can integrate the hard disk into a large disk, or in large The disk is again partitioned, and there is a large function, and the multi-plate disk can have a lot of redundancy (backup) RAID integration, common: 0 1 5 10
RAID 0, can be a piece of disk and N plate combination

It is fast, it is the best

shortcoming in RAID: no redundancy, one If the data is broken, there is no RAID 1. It can only be 2 plates. The size of the disk can be different, with small 准

10g + 10g only 10g, One to make a backup. It has 100% redundancy, disadvantages: waste resources, cost high RAID 5, 3 plates, capacity calculations 10 * (N-1), lost a piece of disk

Features, read and write performance, reading is better, write no less redundancy is good to bad: RAID1 RAID10 RAID 5 RAID0 performance From good to bad: RAID0 RAID10 RAID5 RAID1 < BR /> Cost from low to high: RAID0 RAID5 RAID1 RAID10 single server: very important disk, RAID1 database server: Library: RAID10 from library RAID5 \ RAID0 (for maintenance cost, RAID10) web server, if there is not too much data, RAID5, RAID0 (single disk) has multiple, monitoring, application servers, RAID0 RAID5 < BR /> We will match the corresponding RAID level

5, lvs, nginx, haproxy? How do you choose in work? LVS: is based on four-layer forwarding Haproxy: is based on four-layer and seven-layer forwarding, it is a professional proxy server NGINX: is a web server, cache server, It is also a reverse proxy server, which can be used as a forwarding difference: LVS is based on the forwarding of the four-layer forwarding, and the URL can be made based on the URL, based on the directory This forwarding LVS does not do a working selection: Haproxy and nginx can be made of seven layers, so the transfers of the URL and the directory can be done. When we are very concurrent, we will choose LVS, and if the small and medium-sized company is not so large, it is not so large whether haproxy or nginx is, since Haproxy is simple, it is simple, so Small and medium-sized enterprises are recommended to use Haproxy 6, Squid, Varinsh, and Nginx, what is the difference in work? Squid, varinsh and nginx are all proxy servers What is a proxy server: can be used to access the public for a user. And the access to the data can be cached to the server locally. When the user will access the same resources next time, the proxy server responds directly from the local, when the local is not, I will visit the public in place. Online, I received your request, I first cached in my own local cache, if I cached, I replied directly from my local cache, if I didn't find it locally. The data you want to access, then the proxy server will replace your public network distinguisher: 1) nginx originally reverse proxy / Web The server can do this sub-units

but it does not support the characteristics, but the static file 2 can only be cached in these functions. Varnish and Squid are professional Cache services, while nginx is a third-party module to complete 3) Varnish itself has a higher technical advantage to be higher than SQUID, which uses visual page cache technology On the use of memory, Varnish is advantageous than Squid, which is higher than Squid. There is also a powerful via the Varnish management port, which can be quickly and batch, which is a memory cache, first-class speed, but the memory cache also limits its capacity, cache page and pictures. Generally, a good 4) The advantage of Squid is that the complete huge Cache technical data, and many applications of application production environment works:
We must choose a professional Cache service, give priority to Squid or Varnish. What is the difference between 7, Tomcat and RESIN, how do you choose in work? distinguish: Tomcat users, can refer to the document, the number of RESIN users, can consider that the least the least difference between the document is Tomcat is a standard Java container, but performance than RESIN The difference is that the stability and the compatibility of the Java program should be better than RESIN's work: now the big company is using RESIN, pursues performance; and small and medium Both companies use Tomcat, pursue stability and program compatibility, what is middleware? What is JDK? Intermediate Parts Description: Intermediate Parts are independent system software or service programs, distributed application software sharing resources between different technologies. Above the operating system of the client / server, managing computer resources and network communication is software that connects two stand-alone applications or independent systems. Connected systems, even if they have different interfaces but can exchange information with each other by middleware. A critical way to perform the middleware is that the information transfer passes through the middleware, and the application can work in a multi-platform or OS environment. JDK: JDK is a development tool package of Java, which is a development environment for constructing applications, applets, and components issued on the Java platform.
9, telling about the meaning of Tomcat8005, 8009, 8080? 8005 == "Use 8009 ==" to the AJP port, that is, the container is used, such as the APACHE can access the Tomcat 8009 port 8080 == " General application usage, 10, what is CDN? - That is, the content distribution network - its purpose is to publish the content of the website to the closest user by adding a new layer of network architecture in the existing Internet. On the edge of the network, the user can use the desired content, improve the speed of the user access to the website, what is the website grayscale release? The grayscale release means that one release method that can be smooth transition between black and white, is a grayscale release method, allowing a user to continue with A, Some users start with B if the user does not have any objections, then gradually expand, all users migrate to B. The grayscale release can ensure the stability of the overall system, in the initial grayscale At the time, you can find that the problem can be adjusted to ensure its influence 12, briefly describe the process of domain name analysis of DNS? Users want to access http://www.baidu.com, will first find the host's Host file, then find the DNS server of the local settings, if not, go to the network to find the root server The root server feedback results, saying that only one level domain name server .CN can be found, to find the first-level domain name server, first-level domain name server can only provide a secondary domain name server .com.cn, go to the second-level domain name server, The secondary domain server can only provide a three-level domain name server.http://baidu.com.cn, go to the three-level domain name server, the three-level domain name server exactly this website http://www.baidu.com, then send After the requested server, after saving, send it to the client 13, what is Rabbitmq? RabBitmq is also a message queue middleware, the message middleware is the container message middleware that saves the message during the message, and then the message from its source to its goal. The main purpose of acting as an intermediary when the bid is a winning bid to provide routing and guarantee the delivery of messages; if the recipient is not available when sending a message, the message queue will not retain the message until it can be successfully passed, of course The message queue saves the message is also a deadline 14, telling the working principle of KeepaliveD? In a virtual router, only the VRRP router as a master will always send VRRP notification information, and BACKUP will not seize Master unless it is higher. When Master is unavailable (BACKUP does not receive the notification information), the highest priority in multiple BACKUP will be preemptive to Master. This preemptive is very fast (& lt; 1s) to ensure the continuity of the service, the VRRP package is encrypted using the encryption protocol due to safety considerations. BACKUP does not send the advertisement information, only receives the advertisement information 15, tells the working process of the three modes of LVS? LVS has three load balancing patterns, namely VS / NAT (NAT mode) VS / DR (routing mode) VS / TUN (Tunnel mode)

1, NAT mode (Vs-nat)

Principle: is the destination address of the IP header of the packet from the client, replaced on the load balancer IP address

Concurrency to this RS to process, the RS processing is given to the load balancer, and the load balancer changes the data package original IP address to its own IP

to change the destination address to the client IP address. That is, whether it is incoming traffic, or out of traffic, it must be loaded equalizer

advantage: The physical server in the cluster can use any support TCP / IP operating system, only the load balancer needs A legal IP address

Disadvantages: Denobility is limited. When the server node (ordinary PC server) grows too much, the load balancer will become a bottleneck

of the entire system because all the request packets and answering packages are loaded with the load balancer. When the server node is too much

a large amount of packets have been exchanged in the load balancer, the speed will slow down!

two, IP tunnel mode (vs-tun)

principle: First, most of the Internet services on the Internet is very short, and the answer package is usually very large

The tunnel mode is to send a packet from the client, encapsulate a new IP header (only the IP) to RS

RS received, first put the packet first The head is unsaled, restored the packet, after processing, directly returns to the client, no need to pass the

load balancer. Note that since the RS needs to restore the packet sent by the load balancer, it is necessary to support the

Iptunnel protocol, so in the kernel of the RS, it is necessary to compile the IPTunnel option

< p> Advantages: The load balancer is only responsible for sending the request package to the backend node server, and RS issues the answering package directly to the user

, reducing the load balancer's large amount of data flow, load balancer It is no longer the bottleneck of the system, and it can handle a huge request to

, and a load balancer can distribute a lot of RS. And running on different geographies on the public network.

Disadvantages: RS nodes in tunnel mode require legal IP, this way requires all servers support "IP Tunneling"

(IP ENCAPSULATION) protocol, the server may only limit in section Linux

three, direct routing mode (VS-DR)

Principle: Load balancer and RS use the same IP external service but only DR responds to ARP requests

All RS is kept silent to the ARP request of the IP itself, that is, the gateway will direct all the requests for this service IP to DR

and DR receives the data package after the scheduling algorithm is based on the scheduling algorithm. Find the corresponding RS, change the mac address to the RS of the RS (because IP is consistent)

and send the request to this RS, RS receives this packet, after processing, due to completion IP is consistent, you can directly return data </ ??p>

, etc., etc. For two-layer header, the load balancer and RS must also be understood in a broadcast domain

to be simply understood to

advantages: and tun Like the tunnel mode, the load balancer is only a distribution request, and the response package returns to the client

compared to VS-TUN by separate routing method, VS-DR does not require a tunnel structure. Therefore, most operating systems can be used as a physical server.

Disadvantages: (can not be said to be shortcomings, can only be said) The network card that requires the load balancer must be on a physical segment with the physical network card.

16, how to locate the lock problem in mysql, how to reduce the master-slave replication delay?

mysql INNODB how to locate the lock problem: When using the Show Engine InnoDB Status Check Engine Status, the deadlock problem is found in 5.5, information_schema library Added three tables about locks (Memory Engine)

InnoDB_TRX ## Currently running All transactions

InnoDB_locks ## Current lock

InnoDB_lock_waits # # 等 等 对 对 关 减 复 因 因 因 因 因 因 因 因 因 因 因 因 因 因 因 因 因 因 因 因Difference, resulting in replication delay 2. The master slave copy single thread, if the primary library writes and is too large, it is not transferred to the library

will result in delay. Higher version of MySQL can support multi-threaded replication 3. Slow SQL statement too much 4. Network delay

5. Master load Database Resulting in a replication delay, the front end of the architecture should be added to the buffer and cache layer

6. Slave load general practice is to use multiple slave to share the request, then take one from these Slave Dedicated Server

is used as a backup, no other operations. In addition, 2 parameters that can reduce delay: -slave-net-timeout = seconds unit is the second default setting to 3600 second

# Parameter meaning: When Slave reads the log data from the primary database, wait for how long to re-establish the connection and get the data -Master-connection-retroyal = seconds unit is a second default setting For 60 seconds

# parameter meanings: When the primary connection is re-established, if the connection establishes a failure, how long is the interval, it is usually configured to reduce the two parameters, which can reduce the main network problem. Data Synchronization Delay

MySQL Database Overline from Sync Delay Solution The simplest reduction of Slave synchronization delay is to optimize on the architecture, try to make the main library DDL quickly </ P >

is the main library is written, higher data security, such as Sync_binlog = 1, INNODB_FLUSH_LOG_AT_TRX_COMMIT = 1, and Slave does not need such high data security, it can be fully explained SYNC_BINLOG is set to 0 or turn off binLog

InnoDB_Flushlog can also be set to 0 to increase SQL execution efficiency. In addition, use better hardware devices than the main library as slave

17, how to reset the mysql root password?

1. In the case of a known mysql database, the method of modifying the password:

1, in the shell environment, use the mysqladmin command setting:

mysqladmin -u root -p password "new password" Enter the old password

2, in the mysql & gt; environment, use the update command, directly update the mysql library User table Data:

Update mysql.user set password = password ('new password') where user = 'root';

flush privilegegs;

Note: MySQL statement should be ";" end

3, in the mysql & gt; environment, use the grant command to modify the authorization permission of the root user.

grant all on *. * to root @ 'localhost' identified by 'new password';

2, if you check the password of the root user of the mysql database, how to do Woolen cloth? The method is as follows:

1. Close the currently running MySQLD service: Service MySQLD STOP (To add mysqld to system service)

2, using the mysqld_safe script to secure mode (no Load authorization form) Start the mysqld service

/ usr / local / mysql / bin / mysqld_safe --skip-grant-table & amp;

3, using an empty password root user login database , Reset the root user's password

#mysql -u root

mysql & gt; update mysql.user set password = password ('new password') where user = 'root'; < / P>

mysql & gt; flush privileges;

18, LVS / NGINX / HAPROXY advantages and disadvantages

Nginx's advantage is:

1, working on the 7th floor of the network, you can do some diversion strategies for HTTP applications, such as for domain names, directory structure

Its regular rules are more powerful and flexible than Haproxy, this It is also one of its main reasons for its current popularity

Nginx alone, it is much more than LVS.

2, Nginx's dependence on network stability is very small, theoretically, the load function can be performed, this is also one of its advantages

opposite LVS stabilization Sexual dependence, this is a deep understanding;

3, nginx installation and configuration is relatively simple, it is more convenient to test, it can basically print the error to the log out

lvs The configuration, the test will take a long time, LVS is relatively large.

4, it can bear high load pressure and stabilizes, and can generally support tens of thousands of concurrent and hair in the case of hardware, and the load is relatively small than LVS.

5, Nginx can detect the fault inside the server via the port, such as the status code, timeout, etc. returned according to the server, timeout, etc., and will re-submit the returned request to another, but it is Disadvantages are not to support URLs to detect. For example, the user is uploading a file, and the uploaded node is just a failure during the upload process, and Nginx will cut up to another server to reprocess, and LVS directly disconnect

if it is Upload a large file or important document, the user may be dissatisfied.

6, Nginx is more than just an excellent load balancer / reverse proxy software, it is also a powerful web application server

LNMP is also very popular in recent years. Web architecture, the stability in a high flow environment is also very good.

7, Nginx is now a web reverse acceleration cache is getting ripe, and the speed is faster than the traditional Squid server, consider using it as a reverse proxy accelerator

8, Nginx can be used as a middle-layer reverse agent. This level Nginx basically does not have an opponent. The only thing that can be compared to nginx is only lighttpd

but the lightttpd has not yet doing nginx full function, the configuration is not that Clear readable, community data is far without Nginx active

9, NGINX can also be used as a static web page and image server, which has no opponent. There is also the NGINX community very active, and the third party module is also a lot of

Nginx's disadvantage is:

1, Nginx can only support HTTP, HTTPS, and Email protocols, which is on the applicable range Small, this is its shortcomings

2, the health check of the backend server, only supports the detection through the port, does not support the detection

not supported the session through the URL Keep, but can solve the

lvs by ip_hash: Using the Linux kernel cluster to implement a high-performance, highly available load balancing server

it has good scalability (Scalability) , Reliability and manageability (manageability)

LVS advantages are:

1, strong anti-load capacity, is working on the 4th floor of the network only distributed Use, there is no traffic generated

This feature also determines that it is the strongest in load balancing software, which is relatively low for memory and CPU resource consumption

2, configuration Low, this is a shortcoming is also a advantage, because there is no more configuration

, so there is no need to get too much contact, greatly reduced the chance of human error

3, The work is stable, because its own anti-load capacity is strong, itself has a complete dual hot spare option

such as LVS + KeepaliveD, but we used the most in the project implementation or LVS / DR + Keepalived < / p>

4, no traffic, LVS only distribute requests, and traffic does not go out from itself, which guarantees that the performance of equalizer IO will not receive large flow.

5, wide application range, because LVS works in 4 layers, so it can do load balancing for all applications, including http, database, online chat room, etc.

LVS The disadvantage is:

1, the software itself does not support regular expression processing, can not do the moving and quiet separation

and now many websites have strong demand in this area, this is nginx / The advantage of Haproxy + KeepaliveD is located.

2, if the website is relatively large, LVS / DR + KeepaliveD is more complicated with the

, which is more complicated, with Windows Server's machine, If the implementation and configuration of the maintenance process is more complicated

relatively, Nginx / Haproxy + Keepalive is more simple.

Haproxy features:

1, Haproxy is also supporting virtual hosts.

2, the advantage of Haproxy can supplement some of NGINX's shortcomings, such as supporting the session, cookie's boot

supports the status of the backend server by getting the specified URL. / p>

3, Haproxy is similar to LVS, it is just a load balancing software

Purely in efficiency Haproxy will have a better load balance speed than nginx, in concurrent processing Preferably, the

4, Haproxy supports the load balancing forwarding of the TCP protocol, which can read the load balancing

for the backend of the MySQL node to detect and load balancing on the MySQL node of the backend. You can use it. LVS + KeepaliveD to Mysql master-slave

5, there are very many Haproxy load balancing strategies, Haproxy's load balancing algorithm is now specifically as follows:

1Roundrobin, expressing simple Polling, this is not much, this is basically available;

2 static-rr, indicating that the weight is recommended;

3LeastConn, indicating the least connectors Processing, suggesting attention;

4 source, indicating that according to the request source IP, this IP_hash mechanism with NGINX is similar to

we use it as a way to solve the session problem;

5ri, indicating the URI;

6rl_Param, represents the requested URL parameter 'REQUIRES AN URL parameter name;

7HDR (Name) ), Indicating that each HTTP request is locked according to the HTTP request header;

8rdp-cookie (Name), indicating that each TCP request is locked in accordance with the cookie (Name).

19, mysql data backup tool

mysqldump tool

mysqldump is a backup tool comes with MySQL, the directory is below the bin directory : / Usr / local / mysql / bin / mysqldump

Supports INNODB-based hot backup, but due to logic backup, the speed is not very fast, suitable for backup data is relatively small scenario

mysqldump fully backup + binary logs can implement a time point recovery.

Based on the LVM snapshot backup

In physical backup, there is a file system-based physical backup (snapshot of the LVM), or you can directly use the TAR to direct the entire database to the entire database. / p>

for packaging backups, but these can only make a backup, different storage engine backups are different, Myisam automatically backed up to the table level

and InnoDB does not open the independent table space By backing up the entire database.

Tar package backup

Percona XTRabackup tool

supports the physical hot backup of InnoDB, support full backup, incremental backup, and very fast, support The data caused by the InnoDB storage migrates between different

databases, supports the slave backup recovery backup recovery in replication mode, in order to let Xtrabackup support more functional expansion

can set up separate Table space, open InnoDB_PER_TABLE function, enabled after enabling separate table backup

20, Keepalive's working principle and how to do health check

KeepaliveD is based on VRRP protocol VRRP full name Virtual Router Redundancy Protocol, ie virtual route redundant protocol.

Virtual routing redundant protocol, it can be considered to implement a protocol that implements the router, that is, the router that provides the same functionality to form a router group

This group has an Master and more A Backup, the Master has an external service VIP (the default route of the LAN

other machine in the router is the VIP), the master will send multicast, when the backup does not receive the VRRP package It is considered that Master is down

, it is necessary to elect a backup as Master according to the priority of VRRP. This ensures that the high can be used by the router

Keepalive, there are three modules, which are Core, Check, and VRRP. The core module is the core of Keepalived, responsible for the start of the main process, maintenance

and the loading and parsing of the global configuration file. Check is responsible for health check, including common inspection methods, VRRP module is to implement the

KeepaliveD health check method for VRRP protocols

http_get | SSL_GET

HTTP_GET | SSL_GET

{

URL {

path / # http / ssl check URL can be multiple

digest & lt; String & gt; # http / ssl Summary Information Tool Genhash Generate

Status_code 200 # http / ssl Check Return Status Code

}

Connect_Port 80 # Connection port

bindto & lt; ipadd & gt;

connect_timeout 3 # Connection timeout time

NB_GET_RETRY 3 # Renior number

delay_before_retry 2 # Connection time

21, statistical IP access, require analysis of Nginx access log, find out the number of access pages in the top ten ip < / p>

cat access.log | awk & # 39; {print $ 1} & # 39; | uniq -c | sort -rn | head -10

22, using TCPDUMP Listening to data from 192.168.1.1, TCP port is 80, while saving output results to tcpdump.log

tcpdump & # 39; host 192.168.1.1 and port 80 & # 39; & gt; tcpdump.log

23, how to forward the request for local 80 ports to 8080 port, the current host IP is 192.168.2.1

iptables -a PREROUTING -D 192.168.2.1 -p TCP -M TCP -DPORT 80 -J DNAT-To-Destination 192.168.2.1:8080< /> p> (> )24, briefly describe RAID0 RAID1 RAID5 work Principles and features

raid 0: with zone volume, continuously in terms of bytes, partial division data, parallel / written on multiple disks, there is a high data transfer rate

but it has no data redundancy, RAID 0 simply improves performance, and does not provide the reliability of the data to ensure

and one of them will affect all data. Therefore, RAID 0 cannot be applied to data security requirements

RAID 1: mirror volume, it is a data redundancy by disk data image, and is backup in paired independent disks. Data </ ??p>

cannot upgrade the write data efficiency. When the original data is busy, the data can be read directly from the mirror copy, so RAID1 can improve the read performance

RAID 1 is the highest in the disk array, the mirror volume can be used for total capacity 1 / 2, but provide high data security and availability

When a disk is faded, the system can automatically switch to the mirror disk read and write, without the need for restructuring failure data </ ??P> < P> RAID5: At least 3 hard disk consists of a separate disk structure of distributed parity, its parity code is existing on all disks

any hard disk damage, can be based on other hard drives The calibration bit is rebuilt damaged data (up to 1 hard disk damage)

so RAID5 can implement data redundancy, ensure data security, and the RAID5 can also enhance data read and write performance

25, your understanding of the current operation and maintenance engineers and the awareness of their work

operation and maintenance engineer is responsible for the company, there is a guarantee time for the company And customers provide the highest, fastest, most stable, safest service

of the operation and maintenance engineer's small mistake, which is likely to cause major damage to the company and customers

Therefore, the work of the operation and maintenance engineer needs rigorous and innovative spirit

26, real-time, display network data information of the TCP 80 port in the current system, please write the full operation command

tcpdump -nn tcp port 80

27, the server can't open the machine to solve a step check

a, resulting in server The cause of the fault may have the following points:

b, how to troubleshoot the server failure Procedure is as follows:

28, how to solve the virus in the Linux system < / p>

1) The simplest and effective method is to reload system

2) If you want to find the virus file, then remove the

poisoning, general machine CPU, memory usage will be relatively high

machine to outline the extraordinary case, the troubleshooting method is simple, the

top command is found to f

评论

热门博文