Skip to main content

LiteDFS

A distributed file system, based on Python3, tornado, inspired by HDFS.

It's for data processing cache, not for permanent storage!

All code based on Python3, do not use Python2!

It still under development, so, maybe have some bugs or not stable enough!

See more details at https://github.com/fiefdx/LiteDFS

Features

  1. per file replica settings, support dynamic replica change, no data resharding functions, currently

  2. scalable with add / remove node

  3. lightweight, pure python implementation

  4. support command line interface

Conceptions

  1. name node(ldfsname): the central node of the cluster, manage all files & directories index.

  2. data node(ldfsdata): the data node of the cluster, store real file's blocks data.

  3. command line client(ldfs): the command line tool for communicate with the cluster.

  4. graphic client(ldfsviewer): the graphic tool for communicate with the cluster.

Deployment

Install LiteDFS

# this will install 4 commands: ldfsname, ldfsdata, ldfs, ldfsviewer
$ pip3 install litedfs

Run Name Node

Configuration

log_level: NOSET                        # NOSET, DEBUG, INFO, WARNING, ERROR, CRITICAL
log_path: /home/pi/litedfs_name/logs    # log file directory, can auto generate by ldfsname
http_host: 0.0.0.0                      # name node's http host
http_port: 9000                         # name node's http port
tcp_host: 0.0.0.0                       # name node's tcp host
tcp_port: 6061                          # name node's tcp port
block_size: 67108864                    # 67108864 = 64M, file block size
data_path: /home/pi/litedfs_name/data   # name node data store directory, can auto generate by ldfsname

Run

# generate configuration file & scripts
mkdir ./litedfs_name
cd ./litedfs_name
# this will generate configuration.yml and other scripts
ldfsname -g ./

# run manually
ldfsname -c ./configuration.yml or nohup ldfsname -c ./configuration.yml > /dev/null 2>&1 &

# install systemd service, user and group set to use which user and group to run ldfsname
sudo ./install_systemd_service.sh user group

# start
systemctl start litedfs-name

# stop
systemctl stop litedfs-name

# uninstall systemd service
sudo ./uninstall_systemd_service.sh

# test
$ curl localhost:9000
{"message": "LiteDFS name service"}

Run Node

Configuration

log_level: NOSET                        # NOSET, DEBUG, INFO, WARNING, ERROR, CRITICAL
log_path: /home/pi/litedfs_data/logs    # log file directory, can auto generate by ldfsdata
http_host: 0.0.0.0                      # data node's http host
http_port: 8002                         # data node's http port
name_http_host: 127.0.0.1               # name node's http host
name_http_port: 9000                    # name node's http port
name_tcp_host: 127.0.0.1                # name node's tcp host
name_tcp_port: 6061                     # name node's tcp port
heartbeat_interval: 1                   # heartbeat interval, 1 seconds
heartbeat_timeout: 30                   # heartbeat timeout, 30 seconds
retry_interval: 5                       # retry to connect name node interval, when lost connection, 5 seconds
data_path: /home/pi/litedfs_data/data   # data node data store directory, can auto generate by ldfsdata

Run

# generate configuration file & scripts
mkdir ./litedfs_data
cd ./litedfs_data
# this will generate configuration.yml and other scripts
ldfsdata -g ./

# run manually
ldfsdata -c ./configuration.yml or nohup ldfsdata -c ./configuration.yml > /dev/null 2>&1 &

# install systemd service, user and group set to use which user and group to run ldfsdata
sudo ./install_systemd_service.sh user group

# start
systemctl start litedfs-data

# stop
systemctl stop litedfs-data

# uninstall systemd service
sudo ./uninstall_systemd_service.sh

# test
$ curl localhost:8002
{"message": "LiteDFS data service"}

Run Viewer

This viewer must running on your local machine, it is not a public service, it is a graphic client based on web technique.

Configuration

log_level: NOSET                           # NOSET, DEBUG, INFO, WARNING, ERROR, CRITICAL
log_path: /home/pi/litedfs_viewer/logs     # log file directory, can auto generate by ldfsviewer
http_host: 0.0.0.0                         # viewer's http host
http_port: 8088                            # viewer's http port
name_http_host: 192.168.199.149            # name node's http host
name_http_port: 9000                       # name node's http port
data_path: /home/pi/litedfs_viewer/data    # viewer data store directory, can auto generate by ldfsviewer

Run

# generate configuration file & scripts
mkdir ./litedfs_viewer
cd ./litedfs_viewer
# this will generate configuration.yml and other scripts
ldfsviewer -g ./

# run manually
ldfsviewer -c ./configuration.yml or nohup ldfsviewer -c ./configuration.yml > /dev/null 2>&1 &

# install systemd service, user and group set to use which user and group to run ldfsviewer
sudo ./install_systemd_service.sh user group

# start
systemctl start litedfs-viewer

# stop
systemctl stop litedfs-viewer

# uninstall systemd service
sudo ./uninstall_systemd_service.sh

# test
# use web browser open: http://localhost:8088

Operate With LiteDFS Cluster

# list root directory
$ ldfs localhost:9000 directory list -r /
# | id | type | size | name

# create test directory
$ ldfs localhost:9000 directory create -r /test
create directory[/test] success

# list root directory again
$ ldfs localhost:9000 directory list -r /
# | id | type      | size | name
1 |    | directory | 0    | test

# create a file
$ ldfs localhost:9000 file create -r /test/test.tar.gz -l ./examples.tar.gz 
create file[/test/test.tar.gz] success

# list test directory
$ ldfs localhost:9000 directory list -r /test
# | id                                   | type | size      | name       
1 | 878b17d4-cc11-4bba-88b0-2186b77ef552 | file | 110237727 | test.tar.gz

# create test2 directory
$ ldfs localhost:9000 directory create -r /test2
create directory[/test2] success

# list root directory again
$ ldfs localhost:9000 directory list -r /
# | id | type      | size | name 
1 |    | directory | 0    | test 
2 |    | directory | 0    | test2

# move test.tar.gz into test2 directory
$ ldfs localhost:9000 file move -s /test/test.tar.gz -t /test2
move file[/test/test.tar.gz] to /test2 success

# list test directory again
$ ldfs localhost:9000 directory list -r /test
# | id | type | size | name

# list test2 directory again
$ ldfs localhost:9000 directory list -r /test2
# | id                                   | type | size      | name       
1 | 878b17d4-cc11-4bba-88b0-2186b77ef552 | file | 110237727 | test.tar.gz

# create file with replica 2
$ ldfs localhost:9000 file create -r /test/test.tar.gz -l ./examples.tar.gz -R 2
create file[/test/test.tar.gz] success

# update file replica 3
$ ldfs localhost:9000 file create -r /test/test.tar.gz -l ./examples.tar.gz -R 3
update file[/test/test.tar.gz] success

# download /test/test.tar.gz to local file ./test.tar.gz
$ ldfs localhost:9000 file download -r /test/test.tar.gz -l ./test.tar.gz
download file[/test/test.tar.gz => ./test.tar.gz] success

Metadata

Release files for litedfs 0.0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for litedfs 0.0.13
File Size Uploaded Provenance Actions
litedfs-0.0.13.tar.gz 1.9 MB Without provenance Details for litedfs-0.0.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for litedfs 0.0.13
File Interpreter ABI Platform Actions
litedfs-0.0.13-py3-none-any.whl Python 3 none any Details for litedfs-0.0.13-py3-none-any.whl

Total release size: 4.8 MB

Release files / litedfs-0.0.13.tar.gz

Download URL litedfs-0.0.13.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
7a2e9ae79a53cb7b461681a4e93d4599f160cdbc79bc7436e7e483abbaae2374
BLAKE2b-256 checksum
How to use checksums
6ca1d6bf68e360cbdbf2fa018efa3ac219ae76718237723b6c387e20a2e1c346
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.2

Release files / litedfs-0.0.13-py3-none-any.whl

Download URL litedfs-0.0.13-py3-none-any.whl
Size 2.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
fa2de4250fbbf93b28f8a7dfc3b4c1c79ac367c368ac2ec4bf2dd105d7000ba1
BLAKE2b-256 checksum
How to use checksums
b7bc166c4452abfef41ba9b929e705e35bd9627ce7f627e0cf0d759ff5bc1bff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.2

Security for litedfs 0.0.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page