HA (High availability) is highly available and has the following three modes of operation.
(1) Master-slave mode (asymmetric mode)
Working principle: The host work, the standby machine is in the monitoring preparation condition; When the host is
Loop statements are often used when writing shell scripts. Here a simple summary of the commonly used 3 kinds of circular statements, so that later can quickly reference to write, nonsense do not say, start Demo:
1, for
Used mainly for:
1, teach you to reduce the external appearance of the notebook wear
A good notebook how to maintain their own shell, must be a good packaging, and notebook is the same, you need a good quality notebook outsourcing and a soft notebook bag to protect
Conditional expression ("CONDITIONAL EXPRESSIONS")
Conditional expressions are used in [composite commands and built-in command test and [to test file properties for string and arithmetic comparisons.] An expression is constructed using the
The test command expects to find a parameter on the command line that is considered empty when the shell does not assign a value to the variable. This means that when the script is being processed, test will report the error once the script is
I accidentally found a very interesting book of Shell programming, E, content is 101 shell case, stick to tomorrow to read a, write a little experience. The following is an example 001:
#!/bin/sh # inpath-verifies That's a specified program
Often in the shell script to block other processes, such as MSMTP mail queue script, this script mutex is not correct, the following is the three found in the file to achieve mutual exclusion of the correct approach.
1. The Flock of Util-linux
Head Command Chinese Introduction:
Usage: head [options] ... [File] ...
Displays the first 10 lines of each specified file to standard output.
if more than one file is specified, the filename is given as the file header before each segment
Monitor hardware Health
Shell monitor Cpu,memory,load average, log to log, when load pressure, email notify admin.Principle:1. Get the value of the Cpu,memory,load average2. Determine whether the value exceeds the scope of the customization, for
A start to build the Chinese blog Alliance, both bloggers remind me to do Web site Daquan maintenance of this kind of website is very troublesome, need a lot of energy to debug some of the aborted site, but also to take the blog Encyclopedia of Pine
Hadoop, distributed large data storage and computing, free open source! Linux based on the students to install a relatively smooth, write a few configuration files can be started, I rookie, so write a more detailed. For convenience, I use three
One, array, and associative arrays
An array is an important part of a shell script that stores separate, independent data as a collection by means of an index. A normal array can only use integers as an array index, and associative arrays not only
In bash, Bash's math is a little awkward, it's hard to adapt and remember, so you have to write a blog post to make it easier to look through. There are four ways to perform mathematical operations:
A, let order
Copy Code code as follows:
It is customary to use the Linux command line to manage Linux systems, for example:
Copy Code code as follows:
$ date
211 01:34:58 CST 1999
$
When the user logs in, it actually goes into the shell, and it follows a certain
First, the Shell function
All scripts so far in this tutorial have been executed from beginning to end. This is good, but you may have noticed that some of the script segments are duplicated.
The shell allows a set of command sets or statements to
Unlike Java, PHP and other languages, the process control of SH is not NULL, such as:
Copy Code code as follows:
if (Isset ($_get["Q"])) {
Search (q);
}
else {
Doing nothing
}
?>
You can't write this in Sh/bash,
In the morning I wanted to upload some photos to the album, but because all the photos have the extension is jpg rather than lowercase jpg, resulting in "malformed" and can not upload photos. The question now arises: how do you use a shell script to
In the day-to-day operation of the flow of traffic will find the phenomenon of sudden increase or increase in server load and so on, in order to find out why, need to use the Nginx limit module to access IP restrictions, and then can analyze the log.
Linux shell sed awk command (2)-awkawk syntax Format:awk [Options]-F program-file [--] file ...Options:-F FS,--field-separator FSCreate a delimiter with FS as the input line (the default delimiter is a space or tab)-V Var=val,--assign var=valBefore
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