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

前端 未结 7 1826

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:36

    There is nothing specific to do. Just install the redis server on the new machine, and edit the configuration file. You just need to change the following parameters to point to the location of the dump file you have just copied.

    # The filename where to dump the DB
    dbfilename mydump.rdb
    
    # The working directory.
    #
    # The DB will be written inside this directory, with the filename specified
    # above using the 'dbfilename' configuration directive.
    # 
    # Also the Append Only File will be created inside this directory.
    # 
    # Note that you must specify a directory here, not a file name.
    dir /data/mydirectory/
    

    Finally, the redis server can be started in the normal way.

提交回复
热议问题