LoginSignup
13
11

More than 5 years have passed since last update.

Redisの永続化をオンラインで設定する

Last updated at Posted at 2014-09-19

設定確認

$ edis-cli CONFIG GET save
1) "save"
2) ""
$ redis-cli CONFIG GET appendonly
1) "appendonly"
2) "no"

動作中のRedisで実行

$ redis-cli CONFIG SET appendonly yes
OK
$ redis-cli CONFIG SET save "900 1 300 10 60 10000"
OK

AOFがonの場合、起動時にAOFファイルを読み込んでデータを再構成するので先にオンラインで実行する必要がある。
RDBのみ設定する場合はBGSAVEでもRDBファイルはできるのでどちらでもいいが、再起動する手間も省けるしCONFIG SETで良い。

変更を確認

$ edis-cli CONFIG GET save
1) "save"
2) "900 1 300 10 60 10000"
$ redis-cli CONFIG GET appendonly
1) "appendonly"
2) "yes"

設定ファイルを変更

redis.conf
・・・
save 900 1
save 300 10
save 60 10000
・・・
appendonly yes
・・・

参考

Redis の永続化 — Redis Documentation (Japanese Translation)

13
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
11