memcachedを別のサーバークラスターに移動します。既存のmemcachedデータを複製するか、シャドウ書き込みのように、両方のmemcachedが一致するまで同時にゆっくりとデータを入力する必要があります。ここでの私のオプションは何ですか?
1 に答える
Two ideas pop to mind:
Create a warm-up script that can identify every resource that needs to be put into the new Memcached and put it there. Then switch the production env. to the new Memcached server IP.
Create a new Memcached pool, change your scripts to always write to both pools. Wait for a few hours until the scripts inadvertently write all the data to both pools. Then switch the production env. to the new Memcached pool and disable the dual write scripts and the old pool.
Rationale:
- The first case is useful if you're caching images / full html pages / sql resultsets that you can easily write a script to fetch and for which you can predict all of the possible parameters - conveniently they should be a few parameters not many.
- The second case is useful if you're caching data which is very dependent on application flow and on unpredictable parameters.
There are some commercial solutions for Memcached replication as well as Memcached backups. I don't know any by name and perhaps there are some open source solutions as well.