如何配置god/redis两种环境?
我想使用 god 来监控我的 redis 服务器。问题是它们位于本地和我的服务器上的不同位置。我尝试做这样的事情,但这会导致上帝失败。
%w{6379}.each do |port|
God.watch do |w|
w.name = "redis"
w.interval = 30.seconds
if RAILS_ENV == 'development'
w.start = "/usr/local/bin/redis-server /usr/local/bin"
w.stop = "/usr/local/bin/redis-cli -p 6379 shutdown"
else # in production
w.start = "/usr/local/etc/redis-server /usr/local/etc"
w.stop = "/usr/local/etc/redis-cli -p 6379 shutdown"
end
end
end
I want to use god to monitor my redis server. The problem is that they are in different locations locally and on my server. I tried doing something like this but this causes god to fail.
%w{6379}.each do |port|
God.watch do |w|
w.name = "redis"
w.interval = 30.seconds
if RAILS_ENV == 'development'
w.start = "/usr/local/bin/redis-server /usr/local/bin"
w.stop = "/usr/local/bin/redis-cli -p 6379 shutdown"
else # in production
w.start = "/usr/local/etc/redis-server /usr/local/etc"
w.stop = "/usr/local/etc/redis-cli -p 6379 shutdown"
end
end
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
然后
在您的开发环境中使用调用您的脚本。
并在生产中:
Use
And then call your script using
in your dev environment.
and in production: