How to recover redis data from snapshot(rdb file) copied from another machine?

前端 未结 7 1678

I transferred my redis snapshot (dump.rdb file) using scp to a remote server. I need to run a redis server on this remote and recover the data from the

7条回答
  •  伪装坚强ぢ
    2021-01-30 04:22

    Assuming that you run Redis 2.6 or higher, your Redis snapshot filename is dump.rdb, and it exists in the directory /home/user/dbs, the following command would do the trick:

    redis-server --dbfilename dump.rdb --dir /home/user/dbs
    

    Relevant section from the official documentation: Passing arguments via the command line

提交回复
热议问题