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
The shell may often see: >/dev/null 2>&1
Eg:sudo kill-9 ' ps-elf |grep-v grep|grep $1|awk ' {print $} ' 1>/dev/null 2>/dev/null
The result of the command can be defined as the output in the form of%>
/dev/null represents empty device files
>
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
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
Formal representations (or regular representations) are arranged by special characters to search for/replace/delete one or more columns of text strings, and, simply put, formal notation is an "expression" used above the processing of strings. Formal
This article introduces the Linxu shell of the relevant knowledge of the array, and a lot of examples for reference, including the copy of the array, calculation, deletion, replacement, etc., is to learn the shell array of rare good articles.
The
1, login to the host and enter ssh-keygen-t RSA
Prompt for enter file in which to save the key (/ROOT/.SSH/ID_RSA):
Input/root/.ssh/sea_rsa
Enter the relevant pathname and filename as prompted and generate two files (followed by two options to
The "Swiss Army Knife" here refers to the work of a simple command that can complete a large chunk of code in other high-level languages.
The following content is a summary of the Joshua Levy on Quora's website:
Get the intersection, collection,
Let's start a new year with these unix/linux command techniques to improve productivity at the end. I've been looking for it for a long time and I'm going to share it with you now.
>/path/to/file.log
# or use the following format
:
I. Introduction to the function1. Put the deleted files in the Recycle Bin2. Recovery of deleted files3. Implementation of the Linux RM command function, using almost the Linux system with the RM, command exactly the same4. New features: Rm-l, RM-E,
It took 1 days to write a script to detect whether an IP network is unblocked, but to detect whether the network is unblocked is easy to implement, but it is not good to add some restrictions.
Copy Code code as follows:
#!/bin/bash
######
The percentage of CPU, memory usage of the process seen through the top command is a floating-point number, and I need to process it while writing the script, so I learned a few things and summarized as follows.
In fact, the Shell (here is bash)
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 average
2. Determine whether the value exceeds the scope of the customization, for example
Title: Write a shell script that uses ping to determine whether the host in the specified IP or IP side is alive.
Accept only the specified IP format input and IP segment input (for example: 192.168.2.88 or 192.168.2.) Note that there is a point
It is a stupid thing to pipe the content of a wget or curl output to bash or sh, such as the following:
[Plain] View plain copy on the code to see a piece of coding derived to my Code slice
Wget-o-http://example.com/install.sh | sudo sh
Command
1shell is an interface between the user and the kernel to interoperate,
2shell commands that can be run include Linux commands, built-in commands, utilities, user programs, shell scripts
3shell characters:
4. Get command help: Man,info.--help
5
A few days ago, in the process of discussing a statistic on the number of scripts being executed on Cu, I found myself ashamed of how little I knew about how the shell executed the command ... During the period get Waker brother's advice, thank you
When analyzing a complex script, it is sometimes necessary to pause, in a segmented view, to be more clearSo the reference to some of the implementation, the current own use is such a son#add forDebug by ZqbfunctionGet_char () {Savedstty= ' Stty-g '
Scene:The Redis keys value needs to be monitored, and monitoring scripts are executed using the Crond cycle. If there is an exception, notify by email.First, install the MSMTPDownload softwarewget http://sourceforge.net/projects/msmtp/files/msmtp/1.4
I. Application introductionOur router is embedded with a peanut shell client. After logging on to the peanut shell domain name on the router, we can dynamically associate the WAN port IP address of the router with the IP address of the peanut shell
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.