Experience and Sharing of Efficient Skills in Linux Enterprise Operation and Maintenance

With the continuous and rapid application of Linux in the enterprise, for better operation and maintenance in the enterprise, familiarity with the skills of daily operation and maintenance can better meet the development of the enterprise, and at the same time make our operation and maintenance easier, no longer feel that the operation and maintenance It's hard work, really exercise, grow and hone.

Make our operation and maintenance more "flavor" and make our life better. Through the study of this course, I will share my experience and experience in daily operation and maintenance with everyone, so that everyone can get real knowledge and then apply it in their own operation and maintenance work.

So what do we need to pay attention to:

1) Linux industry goals

We must understand the purpose of learning Linux operation and maintenance . I believe everyone is to find a very good job, a high-paying job, continuous practice, and continuous growth.

Through work, we make our lives more complete and fulfilling.

2) Linux learning route

After we understand our big goals, we need to decompose the big goals, and then we need to really take action and work hard towards the small goals. What are the small goals?

Basic knowledge of computer—>Hardware knowledge—>Daily operation of windows system—>Introduction to Linux system—>Linux directory and permissions learning—>20 necessary commands for Linux (ls pwd cd cat useradd groupadd rm cp chown chmod vi find grep ps free top sed awk if for case wc yum rpm tar unzip more head tail, etc.)

—> Linux simple server construction (master the common tar file decompression method, master the method of installing software:

yum install method installation; source code compilation and installation three steps, configure, make, make install)

—> Apache service construction—> Mysql service construction—> PHP server construction—> LAMP architecture integration discuz forum—> Kickstart automation system installation—> cacti monitoring deployment—> Shell script programming (including learning of various statements, if for awk for while sed, etc.)—>Linux advanced server construction—>Nginx web server construction—> Tomcat server construction—>resin server construction—>Nginx balanced java server—>LNMP architecture construction (yum/source code)—>Nginx dynamic and static separation—>LVS +Keepalived load balancing deployment—>LVS+Keepalived+Nginx+Tomcat balanced architecture deployment—>Advanced Shell writing—>Automated operation and maintenance learning (KVM, Puppet, ZABBIX, Ansible, Mysql+DRBD, etc.)

3) Editor command skills

Familiar with commands Line and vi editor search, match deletion, jump, etc. For example, in the shell command line, ctrl + a jumps to the front, and ctrl + e jumps to the end.

Inside the vi editor:

Shift + ^ to jump to the beginning, shift + $ to jump to the end.

Match the /word character, delete the character where the cursor is and press x, jump to the last line of the text and press G, and jump to the first line of the text and press gg.

Delete the cursor line to the last line of the text at the same time: dG

Delete the cursor line to the first line of the text: dgg

4) System running status monitoring

You can use free –m to check the remaining memory size, usually see

-/+ buffers/cache: 881 112 (this value is about the real memory value)

You can use df -h to view the tmpfs memory file system, speed up static files and pictures:

Check the local network card traffic skills:

yum install iftop -y

iftop -i The results of eth0 are shown in the following figure:

The two left and right arrows in the middle <= => indicate the direction of traffic.

TX: Send traffic.

RX: Receive traffic.

TOTAL: Total traffic.

Cumm: The total traffic from running iftop to the current time.

peak: Traffic peak.

rates: Represents the average traffic in the past 2s, 10s and 40s, respectively.

View disk IO load skills:

vmstat 1 5 (output results per second, a total of 5 times)

r: the number of processes in the run queue

b: the number of processes waiting for IO

Memory:

bi: the number of blocks read per second

bo: Number of blocks written per second

wa: Waiting time for IO

Note * Generally, to judge whether the system load is too high, and whether the IO disk read and write is too high, we can check the time of r, b and wa. Of course, the smaller the table is, the more performance resources are. There are a lot of leftovers, if it is too large, we need to see what operation is causing it.

It can be combined with iostat to check whether it is easier to judge whether the disk read and write causes high IO.

Generally judge the value of %util. If it continues to exceed 75%, you need to pay attention. Check whether the access of related services is abnormal, and then solve them one by one.

Service background startup:

common programs run in the background mainly include:

screen background operation:

execute screen on the command line and press Enter to enter a random screen background, you can enter commands, and then press ctrl + a + d to save and exit. At this point the program is already running in the background.

Screen -ls can view the current running screen background list, execute screen -r plus PID to enter the corresponding background, you need to press ctrl+a+d to exit again.

How to delete screen, you need to execute kill -9 3215 , and then execute screen - wipe to delete.

In addition to screen, we can also use nohup to run the program in the background:

nohup sh auto_nginx.sh &

that the program is already running in the background, you can view tail –fn 10 nohup.out in the current directory to see the relevant information about the program execution, if It is OK to kill the process directly when it needs to end.

Original link: http://www.kubiji.cn/juhe-id5633.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326858330&siteId=291194637