keepalived +nginx finally got it

keepalived

1. It is used for disaster recovery and can monitor whether a service is running through a shell script

2. The experimental environment I need to do on multiple machines is carried out in the environment of 2 centos7

3. Check the keepalived log tail -f /var/log/messages It is possible that your version is not called messages, and some are called keepalived directly

4. I spent 4 hours on the configuration and read a lot of information, 2 keepalived, 2 nginx keepalived master and backup, monitoring nginx services

5.keepalived occupies the corresponding machine by means of internal ip occupation, and starts the nginx service

6. Shell scripting is indeed a very important suggestion. If you don't want to learn shell scripting, learn to learn python's automated deployment.

 

No disaster recovery AB role has been done in the previous projects. The role of AB is not only used for development, but also on the server.

I uploaded 2 documents, you can refer to it if you want to practice.

 

My idea is a mini centos7 for cloning

2 nginx and 2 tomcats are used to complete the disaster recovery of this simple architecture.

(In addition, Alibaba Cloud does not support the concept of internal ip, and cannot play by switching ip)

 

In addition, let me say that the shell written separately must be tested by yourself first to see if there is any problem with this shell. I have a problem that the upload format shell is doc.

The format that has been uploaded is modified to convert doc to unix 

1.. vi filename 
and then use the command 
: set ff? 
to see the words dos or unix. If it is in dos format, then you can use set ff=unix to force it to be in unix format, then save and exit. Run again Look again. 
2. You can use the dos2unix command to convert the encoding 

yum install dos2unix  
#dos2unix myshell.sh 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326516921&siteId=291194637