Linux Topic (iii) __linux

Source: Internet
Author: User

Linux interview (III) on

1 Server Linux system is what version.

Answer: CentOS 6.6,rhel 6.4. With Cat/etc/rehat-release or uname-a or lsb_release-a or cat/etc/issue


2 Linux you have done those optimizations.

A: (1) sysctl-w optimize kernel parameters such as TCP connection timeout net.ipv4.tcp_fin_timeout=30

(2) Optimizing the server hardware itself, using solid-state drives or RAID arrays to improve disk-seeking capabilities,

(3) Install with minimal installation or source package, write one-click installation script

(4) Optimization of the parameters of a specific service configuration file, such as My.cnf socket=/tmp/mysql.sock,buffer_size,wait_timeout

(5) Do load balancing and keepalived main standby switch

(6) Disable the boot unnecessary service


3 deployment of those services on Linux

Answer: a lot. Kickstart, Rsync+inotify, NFS, LAMP, Lnmp, FTP, DNS, Samba, DHCP, Nagios, CACTI, etc.


4 How do you use Nagios to monitor and monitor what?

A: First use yum source to install Nagios required components such as Apache, GCC, glibc, GD library, etc., in the server-side Source Pack installation Nagios Main program, Groupadd nagios,useradd-g Nagios, Nagios,/ Configrure--prefix=/usr/local/nagios, then make All,make install,make install-init,make install-config Install-webconf,. After the main program is installed, install the plugin. Then authenticate htpasswd-c/usr/local/nagios/etc/htpasswd.user admin. Nagios implementation of the monitoring of the way there are SNMP, nsclient++, NRPE, restart Apache and Nagios services. In the browser login Http://IP address/nagios, monitoring things have the host's survival status, CPU usage, load, disk IO, swap access, MySQL master copy status, LVS VIP and network traffic status


How does *5 use cacti to monitor the network? Previous company situation (ask specific numbers)?

A: Need to install tools Rrd-tool storage data is returned to the user graphically through the Web interface, which mainly collects data from SNMP to monitor traffic.


6 How do you check the log?

A: (1) View the access log of the service, use awk to count the number of access IP addresses, detect malicious access

(2) When the service is not functioning properly, first look at the service error log error_log, and then view all the system log information/var/log/messages, and finally view the/ETC/SYSLOGD.CONF system log configuration file.

(3) can also view the/VAR/LOG/WTMP record login information, and lastlog file log login time information and terminal


After *7 installed PHP, what did you do with those optimizations?

A: (1) PHP script if do not buffer, each call needs to compile, therefore, install a PHP buffer product can improve the performance of 25-100%.

(2) When compiling PHP, it is recommended that the following parameters be used:--enable-inline-optimization--disable-debug

(3) Switch the file-based session to a shared memory based session. When compiling PHP, use the--WITH-MM option to set the set session.save_handler=mm in PHP.ini. This simple modification can shorten the session management time by half.


Can 8 use a shell? What do they do with the shell? (The probability of this question is very high)

A: A: bulk do things, back up what things, monitor what.

(1) Monitor the disk partition, CPU, memory usage to what extent after the mail alarm mail-s

(2) using wget, curl to determine whether the service state is OK, to determine whether the process, port existence


9 Did you make those optimizations for Apache? (Lamp optimization is the focus)

A: (1) Set hostnamelookups off in httpd.conf

(2) Modify the size of the paging file in the httpd.conf Sendbuffersize as the largest. Increase the TCP/IP write buffer size for the kernel.

(3) dynamic page turn static page

(4) Using CDN content distribution network to improve site access efficiency

(5) Extend the hardware and use the Nginx+apache load balancing method.


MySQL you have modified those configuration files to optimize (ask the configuration file specifically modified content)?

Answer: vi/etc/my.cnf, Parameter has Skip-external-locking,key_buffer_size=384m,max_connetions=768,table_cache=1024,wait_timeout =10, wait.

11 What architecture to use. Written in what language (JSP). Asp. Php. ) draw an architectural diagram and briefly describe your company's architecture.

A: 2 lvs+keepalived ———— >4 nginx ———— > A large set of application servers (httpd, DNS, email, etc.) ———— >mysql Master

12 to see what commands are running on the port.

Answer: NETSTAT-TULPN


13 use regular expression to do the domain name sort: n a http://www.sina.com/mail let www.sina.com put forward to sort,

Answer: awk-f "/" ' {print $} ' |sort |uniq-c |sort-nr


14 monitoring meeting. Your company has monitored several servers and monitored which services. If you give 50 servers, let you monitor all the server's 80 ports specifically how to do

A: Nagios, Zabbix, after the installation of the server, to join the client response configuration information file


The control-side validation of the remote connection is done by rsync.

A: The client also wants to install rsync, write the password in the RSYNC.PASSWD, like the service side, create rsync.conf file in/usr/local/rsync/


Shell script will. What programming languages will be. You have to say that you will shell script and ask what scripts you have written.

For:...


What is the difference between RAID0 RAID1 RAID5 working principle? What kind of people do you use?

A: raid0 all data on all disks, utilization rate of 100%, no fault tolerance, at least 2 disk required;

RAID1: With mirroring, each piece of data is replicated on disk, requiring a minimum of 2 disks, a utilization of 50%, excellent read performance, redundancy, but too high cost

RAID5: At least 3 disk, of which 2 storage data, the 3rd block to store parity code, when one of the disk data loss, the ability to recover data through the check code, all with good fault tolerance


18. What are the three types of LVS? What kind of people do you use? What advantages this cluster has. That is, compared to the other two kinds of contrast analysis of the difference. Are you familiar with Apache. The module knows what to optimize. Nginx how to deliver the request from port 80 to 8080.

Answer: (1) NAT: When the dispatcher receives a packet, where the source IP address is the client IP address, the destination IP address is the VIP, after the dispatcher to replace the destination IP address to the real server's IP address, according to some sort of scheduling algorithm, the request to the backend of a server, after the server processing, Carry on the packet, the format of the packet is the source IP address is RIP, the destination IP is the dispatcher out of the interface IP, return to the scheduler, according to the cached mapping relationship, the destination IP to replace the IP client. The advantage, then, is that both the Linux operating system and the Windows operating system are supported, with the disadvantage that the scheduler is easily a bottleneck.

(2) DR: Called Direct routing mode, the scheduler and back-end servers are required to share the VIP, when the dispatcher receives the request packet, the ARP request, the replacement destination MAC address to the backend server processing, processing completed, directly returned to the client, without the scheduler, so less overhead, The scheduler can handle more concurrent requests.

(3) Tunnel mode: The private IP address is encapsulated, the external is public IP, the backend server to support the tunnel protocol, but also without the scheduler.

Apache Module Optimization: Comment out some modules that don't need to be used

Port conversion: Echo 1 >/proc/sys/net/ipv4/ip_forward, iptables-t nat-a prerouting-s [Source IP]-p-TCP--dport 80-j REDIRECT--to- Port 8080


Did you use Memcache when you were working? What command cleans up the cache.

A: Flush_all, the role is probably the first time from the hard disk read data, and finally put the results into memory, the next time to visit the site, the efficiency is very high, many companies do this


Iptables several tables

Answer: Four table five chain, table: NetFilter nat mangle raw chain: prerouting INPUT FORWARD OUTPUT postrouting


Iptables Skilled. Simple rules, you know. There are several links to several tables.

Answer: rule example: Iptables-t nat-l, iptables-f, iptable-d input 1,iptables-p input DROP////If not explicitly stated, default reject rules on input chain


SecureCRT how to prevent disconnection during operation

A: The causes of disconnection are: (1) Touch the network cable (2) Physical main body machine or hibernate (3) congestion causes disconnection (4) Misoperation reboot or service network stop (5) iptables kill SSH Session


How to tune Apache.

Answer: (1) dynamic page to static page

(2) hostnamelookups off in httpd.conf

(3) The size of sendbuffersize in httpd.conf is the maximum page size, and the TCP/IP kernel write cache size is increased

(4) The use of CDN content distribution network to provide site access efficiency

(5) Expansion of hardware, using Nginx+apache load Balancing method


24 used any monitoring tools.

Answer: Glances/cacti/nagios/zabbix


How Nagios monitors the status of 80 servers at the same time.

A: Each server installs the Nagios client, Nagios-plugin and Nrpe,nagios service-side writes the configuration file.

26 What is the structure of your company? How to do the CDN

A: CDN (content distribution network) is an edge network, from the user's most recent deployment site, thereby improving the efficiency of the site's access. Know so much, anyway this is a big project.


27 What has been done to the log. With what to do.

A: Wrong, important log has/var/log/message, as well as/var/log/lastlogs, configuration file/etc/syslogd.conf, there are many access logs and service logs for statistical and error-using

28 have made which tuning.

A: Tuning is not easy to do, study slowly

29 What programming languages are used and what shell scripts are written.

Answer: Slightly

How Memcache clean up the cache

Answer: telnet localhost 11211 then Flush_all

The Linux basic service configuration will be all right.

A: No document is really not good

Linux Apache MySQL tuning

A: It is difficult to do well.

33 draw out your company's architectural chart

Answer: Slightly

The MPM of Apache

A: All said Rotten.

35 provide a set of online gaming architecture analysis advantages and disadvantages (from architectural design, maintenance costs, data and backup)

Answer: c/S structure

What exchange has done.

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.