Home > System Tutorial > LINUX > body text

Several points to note when building high availability with keepalived+nginx

WBOY
Release: 2024-04-23 17:50:20
forward
487 people have browsed it

Several points to note when building high availability with keepalived+nginx

  1. After yum installs keepalived, configure the keepalived configuration file
  • be careful
    • In the keepalived configuration files of master and backup, the network card name is the network card name of the current machine
    • The choice of VIP is an available IP. It is usually used for high availability and there are many LAN environments, so this VIP is an intranet IP in the same network segment as the two machines. If used in an external network environment, it does not matter whether it is on the same network segment, as long as the client can access it.
  1. Stop the nginx service and start the keepalived service. You will see that keepalived pulls the nginx service to start.
  • If it fails to start, it is basically a problem with the configuration files and scripts, or the firewall and selinux are not closed.
systemctl <span class="hljs-keyword">stop</span> firewalld 关闭firewalld
iptables -nvL
setenforce <span class="hljs-number">0</span> 临时关闭selinux
getenforce命令查看是否为Permissive
Copy after login
  1. The keepalived script needs to be set to 755 permissions, otherwise it may cause the experiment to fail
  2. When viewing VIP, you can only use the ip add command to view it, but the ifconfig command cannot be used
  3. Yum installed nginx, the default index page is /usr/share/nginx/html/index.html

The above is the detailed content of Several points to note when building high availability with keepalived+nginx. For more information, please follow other related articles on the PHP Chinese website!

source:linuxprobe.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!