Linux operations engineer face test first set

Source: Internet
Author: User

1) What is the general process of Linux booting?


Load bios–> read mbr–>boot loader–> load kernel –> user layer init According to the Inittab file to set the level of system operation (General 3 or 5,3 is a multiuser command line, 5 is the interface) –> The INIT process executes rc.syninit–> boot kernel modules –> perform different levels of running scripts –> execute/etc/rc.d/rc.local (local run service) –> execute/bin/login to log in.

"Comments" basically read "Bird's home Cuisine" directory can be known, this is the fifth chapter of the administrator's first content. This problem can be extended: Init system operating level A total of several, what is each?

0: Shutdown, as long as the 0 will not boot

1: Single user mode, cannot be remote login

2: Multi-user not Internet mode

3: Multi-user access to Internet mode

4: Not used

5: Linux with graphics

6: Restart, as long as the 6 will continue to restart, the descendants of the infinite Gui Yan restart


2) What are the components of the Linux system?
Linux system kernel, shell, file system and application are composed of four parts.


3) There are several modes of operation in Apache, which describe the two modes of operation and their advantages and disadvantages respectively.

Apache has two main modes of operation: prefork (default installation mode for Apache) and worker (can add--with-mpm=worker option at compile time)

Prefork is characterized by: (Pre-derivation)

1. This mode reduces system overhead by eliminating the need to generate new processes when requests arrive

2. Can prevent accidental memory leaks

3. The number of child processes is automatically reduced when the server load drops

Worker features: Multi-Threading multi-process module supporting mixed multithreading

If the worker mpm is a good choice for a high-traffic HTTP server, the worker mpm consumes less memory than prefork.

"Comment" I did not how deep contact Apache, I am halfway decent, contact is nignx, so this problem is so back to the matter.


4) The working process of LVS three modes?

NAT (Network Address translation) mode. When LB receives the user request package, LB converts the IP address of the virtual server in the request package to the IP address of a selected RS, forwards it to the rs;rs to send the reply packet to lb,lb to the IP address of the RS in the reply packet to the virtual server, and sends it back to the user.

IP tunneling (IP tunneling) mode. When LB receives a user request packet, it encapsulates the packet according to the IP Tunneling protocol, and then passes it to a selected Rs;rs to extract the request information and pass the answer directly to the user. Both RS and LB are required to support the IP tunneling protocol at this time.

DR (Direct Routing) mode. After LB receives the request packet, it forwards the packet after the destination MAC address in the request package is converted to the MAC address of a selected RS and the RS receives the request packet, which can pass the reply directly to the user. LB and all Rs must be in one physical section at this point, and LB shares a virtual IP with the RS group.

"Evaluation" LVS is the Linux virtual Server,linux server, this problem if you do not understand to write down, detailed content can see http://www.it165.net/admin/html/201401/2248.html


5) List the Linux common packaging tools and write the corresponding decompression parameters (at least three kinds)?

This has nothing to say, the tar command is a packaging tool, the corresponding decompression parameters TAR-CVF, TAR-ZCVF, TAR-JCVF is the corresponding unpacking to extract what files to correspond to remember, do not remember mixed.


6) A EXT3 file partition, when using touch new file times wrong, the error message is that the disk is full, but use df-h to view the partition information only used 50%, please analyze the specific reason?

A: Two cases, one is the disk quota problem, the other is the EXT3 file system design is not suitable for many small files and large files of a file format, a lot of small files, easy to cause the inode exhausted.


7) Please use the Linux system command to count the number of connections in the establish state.

Netstat-an |grep established |wc-l

The "comment" netstat command-a parameter is "Show All Links" (all),-n is not the domain name resolution, that is, the display of digital IP. These two are high frequency parameters.

Here to use uppercase established, because the lowercase established show something is wrong, you can try it yourself, so the case here is a hidden point.

And then use Wc-l to count. If this question to add more "Check 80 port Establish", then is Netstat-an|grep |grep established |wc-l

Add a sentence, when the actual production, if the server maintains the link is thousands of words, less use netstat, more use SS. But SS command interview when the exam is not much, there is a general understanding can be.


8) Count the number of States (ESTABLISHED/SYN_SENT/SYN_RECV, etc.) on a single Web server?

Netstat-antl|grep establisthed|wc-l

Netstat-antl|grep syn_sent|wc-l

Netstat-antl|grep syn_recv|wc-l

"comment" This problem with a high degree of similarity, the netstat command's-t parameter is a link to query the TCP protocol, the-l parameter is the link in the query listen state. Netstat-an words will appear about three parts of the content, part of the TCP protocol content, part of the content of the UDP protocol, and part of the UNIX socket link, Active UNIX domain sockets (servers and Established). UNIX is a lot of content, if you use the-t/-u parameters, then the UNIX content will not be displayed later.


9) Look for files with/usr/local/apache/logs directory last modified longer than 30 days and delete

Find/usr/local/apache/logs-type f-mtime +30-ok rm {} \;

"Comment" Find command and associated with the command is the focus of the written test, because in the reality of the most use of the situation, so must test must test!!!

Use Mtime + 30来 to describe "modified for more than 30 days", use-type-f to describe the file, and then use the-OK command to perform the next steps for all the files that are satisfied. Here is the deletion of files, so more humane use OK, delete before asking, if simple violence can directly-exec, directly shot off. Use of-exec words is not the-F, superfluous.


10) Write a shell script to transfer files larger than 100K in the/usr/local/test directory to the/tmp directory

Touch aaa.sh

#!/bin/bash

find/usr/local/test/-size +100k-exec MV {}/tmp \;

"Comment" The contents of the curly braces behind-exec And-ok are the names of the files found using the Find command.


11) Add a route to 192.168.3.0/24, the gateway is 192.168.1.254?

Route add-net 192.168.3.0 netmask 255.255.255.0 GW 192.168.1.254 or Route add-net 192.168.3.0/24 GW 192.168.1.254

The "comment" Route command is a temporary increase in routing, if a permanent add route is required, method one, #vim etc/rc.local, add the route add-net 192.168.3.0/24 GW 192.168.1.254 to the file. Method Two, #vim etc/sysconfig/network is appended with gateway=192.168.1.254, this method is used to increase the gateway. Then # route-n Check it out.


12) Execute the/home/shell/collect.pl at 6 3:15 per week and output the standard output and standard error to the/dev/null device, write out the statements in the crontab?

3 * * 6/home/shell/collect.pl >/dev/null 2>&1


13) in November, every day in the morning 6 to 12, every 2 hours to perform/usr/bin/httpd.sh how to achieve?

Crontab-e

1 6-12/2 * bash/usr/bin/httpd.sh

"Comment" crontab, at such a task command is also the interview high-frequency topics, crontab total there are 5 *, respectively, "Minutes", "hours", "date", "Month", "Day of the week." Basic structure to understand, and "when the large number of conditions, decimals arbitrary" case, decimals do not use *, with 0or 1, if the problem is written "* 6-12/2 * bash/usr/bin/httpd.sh", your Apache will be very cool, It will start every minute you meet the conditions.



14) match the key in the AAA text and print out the line and the following 5 lines?

Grep-a 5 Key | Aaa

"Comment"-A is to find the line below the keyword,-B is to find the line above the keyword,-c is the upper and lower line, note that this is grep, rather than find.


15) Query the AAA file for the line ending in ABC?

grep "abc$" AAA

"Comment" Here is not grep "abc$" | aaa!, there is no "|" Here, be careful.


16) Print out the AAA file 1th to the third line?

Head-3 AAA

"Comment" Nothing to say, too simple. With Sed-n ' 1,3p ' aaa a little bit of technical content. But with sed command, pay attention to match-N, if not with-N, you can try.





This article is from "Life is waiting for Gordo" blog, please make sure to keep this source http://chenx1242.blog.51cto.com/10430133/1741809

Linux operations engineer face test first set

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.