vrrp_script not working solution

I am here mainly because of windows transcoding: copy the executable check_nginx.sh detection script content to the U disk, then insert it into the intranet windows, open the content with nodepad++, copy and paste it into the server's check_nginx.sh, close it nginx cannot trigger the script, and the VIP does not drift. Manually execute check_nginx.sh, and finally an error is reported: When executing the .sh script in Linux, the exception is /bin/sh^M: bad interpreter: No such file or directory.

My solution here: upload the executable check_nginx.sh directly to the server, and give the execution permission 755, restart keepalived and the corresponding services, ensure normal operation and then retest.

There are other solutions, search for details - execute .sh script in Linux, exception /bin/sh^M: bad interpreter: No such file or directory.

 

Guess you like

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