osixia / docker-keepalived

Keepalived container image 🐳🌴
MIT License
402 stars 146 forks source link

vrrp_check scritp don't respond. #27

Closed sine19 closed 5 years ago

sine19 commented 5 years ago

I mounted kepalived.conf and a track_script on docker run. When you run this, in the server message logs we can see "WARNING - script '/container/service/keepalived/assets/vvrp_check_status.sh' is not executable for uid:gid 0:0 - disabling." notify.sh is the same notify.sh used in the image.

I don't know whether I have done something wrong, Can you please help me?

keepalived.conf


global_defs { default_interface {{ KEEPALIVED_INTERFACE }} }

vrrp_script chk_nginx_service { script "/container/service/keepalived/assets/vvrp_check_status.sh" interval 2 weight 2 fall 2 rise 1 }

vrrp_instance VI_1 { interface {{ KEEPALIVED_INTERFACE }}

state BACKUP virtual_router_id {{ KEEPALIVED_ROUTER_ID }} priority {{ KEEPALIVED_PRIORITY }} nopreempt

unicast_peer { {{ KEEPALIVED_UNICAST_PEERS }} }

virtual_ipaddress { {{ KEEPALIVED_VIRTUAL_IPS }} }

track_script { chk_nginx_service }

authentication { auth_type PASS auth_pass {{ KEEPALIVED_PASSWORD }} }

notify "/container/service/keepalived/assets/notify.sh" }


vrrp_script

!/bin/bash

STATE=$(curl -LI http://localhost/xxxxxxx.gif -o /dev/null -w '%{http_code}\n' -s)

if [ $STATE = 200 ]; then logger -t info keepalived "Connection Sucess with $STATE " exit 1 else logger -t info keepalived "Connection failed with $STATE " exit 0 fi

sine19 commented 5 years ago

Found out the issue, :) my fault.