如何从BookSleeve调用BGSAVE? [英] How to call BGSAVE from BookSleeve?
问题描述
任何人都可以告诉我如何从BookSleeve到Redis调用BGSAVE命令吗?
Anyone can tell me how to call command BGSAVE from BookSleeve to Redis?
我在BookSleeve中搜索了很多可用方法,但没有找到任何与SAVE或BGSAVE相关的命令.
I search a lot in BookSleeve available methods but not found any commands relative to SAVE or BGSAVE.
谢谢!
推荐答案
是的,看来我从来没有回过头来添加它;我也不认为SHUTDOWN
也在那里.在这两种情况下,我希望它们根本不是通常在客户端需要时执行的事情-但通常是自动化的(持久性配置),或者是在命令行中进行(手动或手动执行)作为脚本的一部分)作为日常维护操作的一部分.
Yes, it would seem that I never got around to adding that; I don't think SHUTDOWN
is there either. In both cases, I expect they simply weren't things that are commonly performed at the reqest if a client - but are usually either automated (persistence configuration), or instigated at the command line (manually or as part of a script) as part of routine maintenance operations.
我可以将其添加到下一个版本中(可能是选中连接已启用管理命令").
I can get it added for the next build (probably with the "connection has admin commands enabled" check).
目前(未经试用)真正的hacky 解决方法是:
A truly hacky workaround for now (untested) would be:
.Scripting.Eval(0, "return redis.call('bgsave')", null, null);
(caveat:以上让我发抖)
(caveat: the above makes me shudder)
但是再说一次:如果您的应用程序只是在执行常规工作,则可能建议使用自动Redis持久性设置.如果您的应用程序是监视/维护前端,那么SAVE
似乎不太合适.
But again: if your application is just performing routine work, I would probably recommend using automatic redis persistence settings. If your application is a monitoring / maintenance front end, then SAVE
doesn't seem too inappropriate.
但未找到任何与SAVE或BGSAVE相关的命令.
but not found any commands relative to SAVE or BGSAVE.
实际上,我强烈建议避免在生产服务器上使用SAVE
,除非您知道它可以安全地放在一边并且不被使用. BGSAVE
不太具侵入性.
Actually, I would strongly advise avoiding SAVE
on a production server, unless you know it is safely off to one side and not being used; BGSAVE
is not so invasive.
这篇关于如何从BookSleeve调用BGSAVE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!