Redisfs-redis + fuse File System)

Source: Internet
Author: User

RedisIt is an efficient memory database, and fuse is a module of the Linux kernel. It can be used to create its ownFile System(As mentioned earlier, gridfs-fuse of MongoDB ). This article describes how to implement a file system of a redis storage system:Redisfs

Usage

After redisfs is installed, run the following command to specify the host and port of the redis server and the Mount directory to mount a file system supported by redis as storage.

 
Redisfs -- Host = localhost -- Port = 6379 -- Mount =/mnt/redis [-- Read-Only] [-- debug] [-- prefix = skx]

Synchronization Mechanism

The main reason why redisfs chooses redis is to use redis's high performance and synchronization mechanism. The author provides two methods to build two synchronized file systems:

1. Use redisfs to mount different directories on two different machines to the same redis

2. The above method may cause at least one file system and redis to be not on the same machine, resulting in unnecessary network overhead. The method is to set the master and slave redis on different machines, and then directly use redisfs to mount the local redis. Data Synchronization is done through redis's own synchronization mechanism, however, the cost is that the file system on the server Load balancer is read-only.

Snapshot function

Redisfs provides a snapshot function for the file system. The snapshot function is very simple to implement. You only need to scan all the keys (equivalent to file names) stored in the current redis, and copy it to the new key. As follows:

 
$ Redisfs-snapsot -- from = skx -- To = copy

The above operation is to copy all keys starting with skx to a key starting with copy. Then, we can use the Mount parameter to create a new file system using this snapshot. The operation is as follows:

 
# Mkdir/tmp/safe # redisfs -- prefix = copy -- Mount =/tmp/safe

For installation instructions, see the official page: http://www.steve.org.uk/Software/redisfs/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.