Common Questions in Linux

Source: Internet
Author: User
Tags mysql backup nginx reverse proxy

1. Interview Skills:

    1. Self-Introduction: More preparation, back down. To cadence, self-introduction after not stay, directly into the company's work, explaining the structure. Speak out the problems in your work and the solutions.

    2. For example, when someone asks for big data, cloud computing, etc., this belongs to the development of the interview. Can be answered that the contact is not too much, but this thing, our company has the opportunity I would like to study to spend time to study.

    3. Try to get the contact information of the interviewer, go back to the interview after the topic, find the standard answer, row good version even draw a good picture, to the interviewer sent back!

    4. Don't say it in person, you should draw a picture when appropriate.

    5. First of all dress to be appropriate, the best standard of professional attire interview, can not be dressed casually; it is simple to let a person look at you, feel fresh, competent, energetic.

    6. Be prepared, try to interview the company 15 minutes in advance, and read through the information to understand the company's simple background and related culture.

    7. Keep smiling, not too old-fashioned, easy-going, keep a relaxed mind, do not Kibitz answer, to be polite, sometimes the details determine success or failure.

    8. In answer to the question should be simple and clear, do not elaborate on a problem around, you are confused; The answer should not be said as far as possible, to be targeted.

    9. To maintain humility, encounter will not be the topic, do not know is not know, do not understand the installation;

10. The interview usually starts with a self-introduction, what do you say? How long is the fit?

一般自我介绍,就介绍自己叫什么名字,毕业时间学校,以及之前的工作经验,自己比较熟练的技能和自己的性格和优点等等;介绍完毕,最后说声介绍完毕,谢谢。

11. Interview to have confidence, do not lower the head, the interview is two-way, you choose the Company, the company is also choosing you. Chances are very much, the key is to see if you can hold on, whether you have been ready.

12. The mentality of the interview must be calm, not because an interview is not on, feel that they are everywhere shortcomings, to summarize their shortcomings in the last interview, and then change the next time, I believe perseverance will be able to find a satisfactory job.

13. In conclusion, it is important to do what is self-confidence, believe that you can do it, and then do it bravely, and the result will certainly make you feel pleasantly surprised.

How many modes of 2.nginx reverse proxy?

Nginx Reverse Proxy total of the following 5 modes, the first 3 kinds of use more:

1) Polling: Each request is assigned to a different backend server in chronological order, and can be automatically rejected if the backend server is down.

2) Weight: Specifies the polling probability, proportional to the weight and access ratio, for the performance of the backend server.

3) Ip_hash: Each request is allocated according to the hash result of the access IP, so that each visitor fixed access to a back-end server can solve the session problem.

4) Fair (third party): Allocate by backend server response time, short time priority assignment.

5) Url_hash (third party): assigns requests by the hash result of the access URL, directs the same URL to the same back-end server, and the backend server is more efficient when cached.

What are the 3.MySQL master and slave modes?

1) SQL statement-based replication (statement-based replication, SBR).

2) Row-based replication (row-based replication, RBR).

3) Mixed Mode replication (mixed-based replication, MBR).

4. Talk about Tomcat tuning?

5. What are the causes of MySQL master-slave synchronization problem? How do I fix it?

Reason:

1. The primary database Binlog log is not turned on or Binlog log update is not turned on.

2. The master-slave database structure is inconsistent.

3. The firewall does not have open ports.

5. The corresponding IP address was incorrectly written.

6.mysql database version is inconsistent.

Workaround:

1. Force synchronization.

2. If the data is inconsistent, you can insert the data in a consistent, less time.

3. If the database is small, you can export the database and import it again.

6. Talk about MySQL backup?

1) According to the data impact points:

Hot Spare xtrabackup, can only back up InnoDB and xtradb two kinds of engine tables

Cold

Win Bei

2) According to the contents of the file after backup:

Logical backup mysqldump, large amount of data is not recommended, after the backup content is readable, usually a text file, which is the actual data of the SQL statement or table

Bare file backup copy database physical files, mysqlhotcopy, fastest, but only MyISAM engine. The essence is to use a lock table statement before using the CP or SCP copy database. For Big Data

3) According to the content of the backup database:

Full backup

Incremental backup xtrabackup, only backup of InnoDB and xtradb two engine tables

Backup of log backup binary logs, master-slave replication

7. View the number of concurrent requests for HTTP and TCP connection status?

[Email protected] ~]# Netstat-ap | grep httpd | awk ' {printf $6} ' #查看链接状态

[Email protected] ~]# Netstat-an |grep Establish | grep "192.168.1.10:80" #查看并发请求数

8. Statistics the most visited 5 IPs in Apache Access_log?

Cat/var/log/httpd/access_log | awk ' {print '} ' | Uniq-c |sort-n|tail-5

9.Linux boot order?

1) Load BIOS: Get the first bootable boot setting according to the settings such as: optical drive, hard drive, network, USB.

2) MBR boot: Read master boot, hard disk partition table and hard disk valid flag through main boot sector. When the system locates the MBR of the hard disk specified by the BIOS, it is copied to the physical memory where the address resides.

3) Read grub: Reads the GRUB configuration information in memory and launches a different operating system according to this configuration information.

4) Load kernel: The system puts the extracted kernel in memory and calls the Start_kernel () function to start a series of initialization functions and initialize various devices to complete the Linux core environment.

5) Read Inittab: Run the program is/sbin/init, the file will read the/etc/inittab file, and according to this file for initialization work. The main thing Inittab is to determine the level of operation.

6) Execute Rc.sysinit: That is to say this is to prepare the software to perform the work environment.

7) Execute RCN.D: Depending on the runlevel, the system will run/ETC/RC0.D to the corresponding script in RC6.D to complete the corresponding initialization and start the corresponding service.

8) Execution rc.local:rc.local is the place where Linux leaves the user to personalize after all initialization work. You can put the things you want to set up and start up here.

9) Execute/bin/login after execution to enter login status.

10. Write a script to determine what IP is currently online in the 192.168.1.0/24 network, can ping general think online?

[Email protected] ~]# vim/root/ping.sh

#!/bin/bash

I=0

While [$i-le 255]

Do

    ping -c 3 192.168.1.$i &> /dev/null    if [ $? == 0 ]    then            echo "192.168.1.$i"    fi    ((i++))

Done

[Email protected] ~]# chmod +x/root/ping.sh

11. Write a script that requires all files from the local/data directory to be backed up to the/data directory of the remote server, send the message to Backup.meihua.info after the backup is complete, and the message content to display the size of the backup data, and execute 1 o'clock in the morning every day?

[Email protected] ~]# Vim/root/back.expect

#!/usr/bin/expect

Set IP "192.168.1.11"

Set passwd 123456

Set Timeout 30

Spawn scp-r/root/data/$ip:/root/

Expect {

    "(yes/no)?" { send "yes\r";exp_continue }    "password:" { send "$passwd\r";exp_continue }

}

[Email protected] ~]# vim/root/back.sh

#!/bin/bash

Expect/root/back.expect

If [$?-eq 0]

Then

    size=`du -sh /root/data/ | awk ‘{print $1}‘`    echo "backup success\!the size is $size" | mail -s "backup info" backup.meihua.info

Else

    echo "bacukp failed\!" | mail -s "backup info" backup.meihua.info

Fi

12. Talk about MySQL optimization?

1. Hardware optimization:

1) cpu:64 bit, high frequency, high cache, high parallel processing capability.

2) Memory: Large memory, high frequency, try not to swap.

3) Hard drive: solid, high speed.

4) network card: million trillion, optical port.

2. Disk IO optimization:

1) Do RAID10

2) disk Partitioning: Place the data on a separate partition. When the master comes from, Binlog is placed in a separate partition

3. Operating system optimization:

1) using a 64-bit system

2) using NIC bindings

3) Set the limit on the number of TCP connections

4) Optimize the number of open files for MySQL user limit

5) Disable unnecessary service self-booting

6) The data can be partitioned into a separate file system, typically XFS (Red Hat 6 requires the installation of XFS-enabled software xfsprogs), and you can consider enabling noatime when mounting partitions.

7) The principle of minimization:

Minimized installation system

Start Service minimized

Minimization of operations

Login Minimized

Permissions minimized

4. Database Design and Planning:

1) Special plane

2) Master from synchronization, load balancing, high availability cluster, etc.

3) Select the appropriate database engine. If the myiasm is suitable for reading and writing fewer tables, the InnoDB is suitable for reading and writing many tables. The master uses the InnoDB engine, from the use of the MyISAM engine

Parameter optimization within the 5.MY.CNF:

General principle: give MySQL appropriate resources, general 40% to the system, 60%-70% to MySQL.

1) Enable MySQL slow query, parse SQL statements, and find the SQL that affects efficiency:

Vim/etc/my.cnf

Log-slow-queries=/var/lib/mysql/slow.log

Log_query_time=5

2) Cache the query:

Vim/etc/my.cnf

query_cache_size=32m

3) Enforce restrictions on MySQL resource configuration, for example:

Vim/etc/my.cnf

max_connections=500 #限制最大连接数

wait_timeout=10 Sleep #mysqld将终止等待时间 (idle time) more than 10 seconds of connection

max_connection_error=10 #如果一个主机在连接到服务器时有问题, and try to give up many times, then this host will be locked until:mysql> FLUSH hosts is executed;

4) Table cache:

Vim/etc/my.cnf

table_cache=23 #缓存23个表. Values in machines below 2G memory default from 256 to 512

5) keyword cache:

Vim/etc/my.cnf

key_buffer=512m #只跑了一个mysql服务. Combined with all caches, the overall use of MySQL cache can be 80% of physical memory

6) Turn off the DNS counter-check feature:

Skip-name-resolve #该选项就能禁用DNS Parsing, the connection speed will be much faster. However, it is not possible to use the hostname in the MySQL authorization table and only use the IP format.

6.sql Statement Optimization:

1) Build Table:

The table structure is reasonable, not too big, the type is precise.

2) Index:

Establish an appropriate index.

3) Enquiry:

Reduce logical operations and exact queries (do not query for unwanted data).

The appropriate combination of multiple small queries into one large query.

The appropriate disassembly of some overly complex queries into multiple small queries, as opposed to just now.

4) Transaction:

Reduce the size of the transaction pack.

5) Stored procedure:

Proper setup and optimization of stored procedures

13. What are the different ways to install the package? How to choose the correct installation method?

1.yum Installation: Functional software, such as OpenSSH

2. Source code compilation: High concurrency software, such as MySQL cluster

3. Binary installation: Software for developing tests

What is the difference between 14.myisam and InnoDB?

MySQL is using MyISAM by default.

1) Myiasm does not support things

2) MyISAM does not support row lock table

3) MyISAM does not support foreign keys

4) MyISAM support full-text indexing

5) MyISAM supports GIS data, such as surface, etc.

6) MyISAM primary key range is smaller than InnoDB, the smallest is its 1/2

15. How to bulk delete files ending in. txt under a specified folder?

find/root/-name "*.txt"-exec rm-rf {} \;

16. How do I filter files larger than 10M under a specified folder?

find/root/-size +10m

17. What is your main job in the company and the company's system structure?

18. What problems have you encountered in the course of your work? How do I troubleshoot and fix it?

What is the difference between Apache's 2 ways of working?

What is the website structure of your original company?

Which piece are you more proficient or proficient in?

Squid, varnish and other cache servers have been maintained? What is the principle of squid cache proxy? Cache Hit rate how to view and empty the cache?

How does the LVS work? What are the algorithms?

What are the parameters of Nginx's daily optimization? Has the Nginx static separation been done? Describes the simple steps.

What parameters do you optimize for Linux kernel optimization?

What major problems have you encountered in maintaining your website? What's the deal?

Are you familiar with Shell programming? Write a script that automates the backup of MySQL database?

What is the principle of MySQL master-slave architecture? If the master never synchronizes, error, how to recover?

What if I backed up the big data MySQL data file? What are the steps for MySQL optimization?

What is the difference between FTP primary and passive mode?

What are the differences and optimizations of Apache two modes of operation?

Have Nagios and cacti been maintained? What do you usually monitor?

What is the bandwidth of your company's network export? What is the PV and UV of the website every day?

What do you think is the responsibility of the Linux OPS engineer?

Why did you leave your job and what was the reason for leaving?

Password forgot what to do, how to hack?

What skills are required as a system operations engineer?

How do I back up a database? What are the commands?

What are the modules of Nginx?

How do I set up automatic backups and delete the databases backed up 10 days ago?

What if 50 hosts are required to install the operating system?

If the site is under attack, how to troubleshoot the problem, what is the idea?

How does Linux see if a port is occupied?

What is the difference between RPM installation and Yum installation? How does rpm install software solve dependencies?

What might be the problem if you find that all the files in the Linux system are read-only? How do I troubleshoot this?

-----The most of the above questions for my real interview questions, the answers are for their own review and summary, the wrong place also hope that you point out a lot. There are some questions not sorted out the answer, you can leave a message to answer. Not regularly updated, haha!

Common Questions in Linux

Related Article

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.