How to use keepalived to achieve high availability of multiple services?

there are two servers, and the following software is installed at the same time:
1.mysql
2.nginx
3.keepalived

Q: how to achieve high availability of mysql and nginx respectively through keepalived?

Menu