Comments (10)
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.
@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.
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.
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.
Ok thanks, at least all of that makes sense. I was going crazy trying to figure out what was going on.
from ansible-redis.
@YAmikep I'm going to leave this open so I can resolve this issue.
from ansible-redis.
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.
Closed by #41
from ansible-redis.
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.
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:
- Run playbook with this role (default settings, latest role version). At this moment, I did not check if redis is working.
- 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"
- 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. - It hangs at
restart redis
. ^C, run playbook again - now it hangs atensure redis is running
. - Tried to run few more times with same result.
- Removed
redis_logfile
and ran it again. Still hangs. - Connected to server via ssh and killed
redis-server
process. It restarted and.. my app now can connect redis. - 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)
- Multiple instances on same host HOT 1
- File version mismatch in ansible-galaxy and github HOT 1
- Cannot install redis and redis-sentinel on the same host? HOT 1
- it cannot work in centos7.6 whenredis version is 6.0.3 ,because gcc version is too low, in this case ,the gcc version should be upgraded. HOT 1
- Make redis_user owner of /etc/redis HOT 1
- Ansible: "Redis started at boot" step, fails due to: Systemd fatal error /etc/redis/6379.conf not found
- Looking for a way to setup redis-cluster
- How to connect to redis?
- refuses to recreate /etc/redis/redis.conf HOT 1
- Change default redis version
- New 1.2.9 release HOT 1
- 1.2.9 is not found in Ansible Galaxy HOT 3
- Installing redis from distribution repo HOT 4
- Include deprecated HOT 2
- install_from_source.yml missing from repo HOT 3
- Add option to not run: add redis init config file HOT 1
- Redis start fails due to 'protected-mode yes' HOT 4
- Consider logrotate for redis logs when not sent to syslog
- Issue with redis_master 'ansible.vars.hostvars.HostVarsVars object'
- role on Ansible Galaxy needs updating (hasn't been updated for 3 years)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-redis.