Code Monkey home page Code Monkey logo

Comments (3)

robotapertama avatar robotapertama commented on May 27, 2024 1

This might help - https://opensource-db.com/working-with-keepalived-and-selinux-ensuring-ha-and-security/

from keepalived.

pqarmitage avatar pqarmitage commented on May 27, 2024

As it says, keepalived cannot find the executable docker in the search path; you need to specify the full path name to the docker executable.

Further, keepalived does not manage a pipeline of processes; you need a shell to do that, so you need to create an executable script:

#!/bin/bash

docker ps -q -f name=haproxy | grep -q . && echo 1 || echo 0

and suppose it is /etc/keepalived/ka_docker.sh, then change the line in the vrrp_script block to
script /etc/keepalived/ka_docker.sh

Also, keepalived does not read the stdout of a script that it executes, but retrieves the exit code, so you need to change the script to be:

#!/bin/bash

docker ps -q -f name=haproxy | grep -q . && exit 1 || exit 0

This will exit with 1 (failure) if there is a container with the name haproxy, and 0 (success) if there is no such container. This may be the opposite of what you want.

from keepalived.

1liminal1 avatar 1liminal1 commented on May 27, 2024

Thank you both, but its an issue with Keepalived and SElinux the solution is to use an external script and put it in the specified directory using this guide

https://opensource-db.com/working-with-keepalived-and-selinux-ensuring-ha-and-security/

/usr/libexec/keepalived/

I found setting permissions as chmod u=rwx,g=rx,o=rx /usr/libexec/keepalived/script-name.sh worked for me

This took us days to figure out, so hopefully this will help someone :)

from keepalived.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.