Giter Club home page Giter Club logo

tifs's Introduction

TiFS

A distributed POSIX filesystem based on TiKV, with partition tolerance and strict consistency.

pjdfstest

Environment

Build

  • Linux libfuse and build-essential are required, in ubuntu/debian:
sudo apt install -y libfuse-dev libfuse3-dev build-essential
  • macOS
brew install --cask osxfuse

Runtime

  • Linux fuse3 and openssl are required, in ubuntu/debian:
sudo apt-get install -y libfuse3-dev fuse3 libssl-dev
  • macOS
brew install --cask osxfuse

In Catalina or former version, you need to load osxfuse into the kernel:

/Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse

Installation

Container

You can use the image on docker hub or build from the Dockerfile.

Binary(linux-amd64 or darwin-amd64)

mkdir tmp
cd tmp
wget https://github.com/Hexilee/tifs/releases/download/v0.2.1/tifs-linux-amd64.tar.gz
tar -xvf tifs-linux-amd64.tar.gz
sudo ./install.sh

The install.sh may fail in macOS Catalina or Big Sur because of the SIP.

You can just use the target/release/tifs to mount tifs.

Example

target/release/tifs tifs:127.0.0.1:2379 ~/mnt

Source code

git clone https://github.com/Hexilee/tifs.git
cd tifs
sudo make install

Usage

You need a tikv cluster to run tifs. tiup is convenient to deploy one, just install it and run tiup playground.

Container

docker run -d --device /dev/fuse \
    --cap-add SYS_ADMIN \
    -v <mount point>:/mnt:shared \
    hexilee/tifs:0.2.2 --mount-point /mnt --pd-endpoints <endpoints>

TLS

You need ca.crt, client.crt and client.key to access TiKV cluster on TLS.

It will be convenient to get self-signed certificates by sign-cert.sh(based on the easy-rsa).

You should place them into a directory and execute following docker command.

docker run -d --device /dev/fuse \
    --cap-add SYS_ADMIN \
    -v <cert dir>:/root/.tifs/tls \
    -v <mount point>:/mnt:shared \
    hexilee/tifs:0.3.1 --mount-point /mnt --pd-endpoints <endpoints>

Binary

mkdir <mount point>
mount -t tifs tifs:<pd endpoints> <mount point>

TLS

mount -t tifs -o tls=<tls config file> tifs:<pd endpoints> <mount point>

By default, the tls-config should be located in ~/.tifs/tls.toml, refer to the tls.toml for detailed configuration.

Other Custom Mount Options

direct_io

Enable global direct io, to avoid page cache.

mount -t tifs -o direct_io tifs:<pd endpoints> <mount point>

blksize

The block size, 64KiB by default, could be human-readable.

mount -t tifs -o blksize=512 tifs:<pd endpoints> <mount point>

maxsize

The quota of fs capacity, could be human-readable.

mount -t tifs -o maxsize=1GiB tifs:<pd endpoints> <mount point>

Development

cargo build
mkdir ~/mnt
RUST_LOG=debug target/debug/tifs --mount-point ~/mnt

Then you can open another shell and play with tifs in ~/mnt.

Maybe you should enable user_allow_other in /etc/fuse.conf.

for developing under FreeBSD, make sure the following dependencies are met.

pkg install llvm protobuf pkgconf fusefs-libs3 cmake

for now, user_allow_other and auto unmount does not work for FreeBSD, using as root and manually umount is needed.

Contribution

Design

Please refer to the design.md

FUSE

There are little docs about FUSE, refer to the example for the meaning of FUSE API.

Deploy TiKV

Please refer to the tikv-deploy.md.

TODO

  • FUSE API

    • init
    • lookup
    • getattr
    • setattr
    • readlink
    • readdir
    • open
    • release
    • read
    • write
    • mkdir
    • rmdir
    • mknod
    • lseek
    • unlink
    • symlink
    • rename
    • link
    • statfs
    • create
    • fallocate
    • getlk
    • setlk
  • Testing and Benchmarking

    • pjdfstest
    • fio
  • Real-world usage

    • vim
    • emacs
    • git
    • gcc
    • rustc
    • cargo build
    • npm install
    • sqlite
    • tikv on tifs
    • client runs on FreeBSD: simple case works

tifs's People

Contributors

abracax avatar dinoallo avatar hexilee avatar tespent avatar yzydavid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tifs's Issues

quotas & disk space usage info

I am new for tifs. I build a test env for tifs. I have two questions.

  1. Could you guide me how to set qutoas on tifs (maybe set some options when mount )?
  2. when I use df command, there is no disk space usage info, it display "-
    tifs
    "

Adding Multiple PD Endpoints Does Not Provide Redundancy

I have a TiKv cluster running in 3 test VMs: 10.10.0.111:2739, 10.10.0.112:2739, 10.10.0.113:2739

Starting a basic mount with the following:

./target/release/tifs -f tifs:10.10.0.111:2379,tifs:10.10.0.112:2379,tifs:10.10.0.113:2379 /mnt/tifs/

Dec 18 10:00:35.994 INFO connect to tikv endpoint: "10.10.0.113:20162"

If I pause, stop or kill VM 10.10.0.113, there is no failover, the file system doesn't try one of the other endpoints. Is this expected?

Are there plans to add redundancy?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.