Code Monkey home page Code Monkey logo

Comments (10)

YAmikep avatar YAmikep commented on September 7, 2024

Update: if I run it again, it then hangs at the "ensure redis is running" task:

TASK: [rolebooks/db/redis | create redis config file] *************************
ok: [10.0.0.52]

TASK: [rolebooks/db/redis | add redis init config file] ***********************
skipping: [10.0.0.52]

TASK: [rolebooks/db/redis | add redis init config file] ***********************
ok: [10.0.0.52]

TASK: [rolebooks/db/redis | ensure redis is running] **************************

I checked again on the targetted machine and Redis is well running, I can get access via redis-cli, etc.

from ansible-redis.

DavidWittman avatar DavidWittman commented on September 7, 2024

@YAmikep You're running it in the foreground when you set redis_daemonize to "no", which causes the init script to hang. Is there a particular use case where you need it to run in the foreground that this should be accounting for?

from ansible-redis.

YAmikep avatar YAmikep commented on September 7, 2024

Oh ok.
I want to use supervisor to manage the redis process and supervisor requires that the processes do not daemonized itself.

from ansible-redis.

DavidWittman avatar DavidWittman commented on September 7, 2024

Oh, that makes perfect sense. In that case, you don't need any of the init stuff. I'll have to add a variable which lets you control whether or not Ansible tries to manage the state of the redis services themselves.

Feel encouraged to take a crack at it yourself, too.

from ansible-redis.

YAmikep avatar YAmikep commented on September 7, 2024

Ok thanks, at least all of that makes sense. I was going crazy trying to figure out what was going on.

from ansible-redis.

DavidWittman avatar DavidWittman commented on September 7, 2024

@YAmikep I'm going to leave this open so I can resolve this issue.

from ansible-redis.

YAmikep avatar YAmikep commented on September 7, 2024

Hi David,

I created a pull request: #40
I have tested it and it works.

Let me know what you think. Thanks.

from ansible-redis.

DavidWittman avatar DavidWittman commented on September 7, 2024

Closed by #41

from ansible-redis.

stephansarver avatar stephansarver commented on September 7, 2024

I am experiencing the same issue but it happens when using the property
redis_password: somelongpassword

From what I can tell it looks like in the init script that resides in /etc/init.d/redis_6379 is expecting a variable to be set when using password auth.
if [ -n "$REDIS_PASSWORD" ]; then CLIEXEC="${CLIEXEC} -a ${REDIS_PASSWORD}" fi

so in the stop block of code

stop) if [ -f "$PIDFILE" ]; then PID=$(cat "$PIDFILE") log_daemon_msg "Stopping $NAME..." $CLIEXEC shutdown while [ -x /proc/${PID} ]; do log_daemon_msg "Waiting for Redis to shutdown ..." sleep 1 done log_end_msg 0 else log_daemon_msg "$NAME is not running" log_end_msg 0 fi ;;

it issues the command
/opt/redis/bin/redis-cli -p 6379
that fails on authentication and enters an infinite loop.

My question is should I be setting this value somewhere that is not obvious from the documentation?

from ansible-redis.

frutality avatar frutality commented on September 7, 2024

I know it's "a bit" old issue, but I just experienced exactly same behaviour as @YAmikep

The only difference is that I was not daemonizing redis. I actually only added redis_log variable, that's all. Steps, exactly what I did:

  1. Run playbook with this role (default settings, latest role version). At this moment, I did not check if redis is working.
  2. Later, I realized that my app cannot connect redis. Error was "MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk"
  3. I decided to check redis logs and realized that there is no logfile by default. So I added redis_logfile: '/var/log/redis.log' and ran playbook again.
  4. It hangs at restart redis. ^C, run playbook again - now it hangs at ensure redis is running.
  5. Tried to run few more times with same result.
  6. Removed redis_logfile and ran it again. Still hangs.
  7. Connected to server via ssh and killed redis-server process. It restarted and.. my app now can connect redis.
  8. Just to make sure, ran playbook once again - it worked just fine, no hangs.

OS is Ubuntu 16.04 (server), Xubuntu 16.04 (client), ansible is 2.4.2.0, python is 2.7.12.

Clearly don't know where was the problem. Posting this to help anyone who finds himself in same situation.

from ansible-redis.

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.