- 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.
- 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
- The keepalived script needs to be set to 755 permissions, otherwise it may cause the experiment to fail
- When viewing VIP, you can only use the ip add command to view it, but the ifconfig command cannot be used
- 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!