pbeza / lizardfs-docker

LizardFS docker test cluster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Note: Docker configuration from this repo is experimental. You can use it at your own risk in accordance with the GPLv3 license.

LizardFS Docker Cluster

This is a sample configuration of a multiple node LizardFS cluster on Docker using Ubuntu 19.04 (codename: Disco Dingo). It consists of a master server (lizardfs-master) with a management GUI, a shadow server, 3 chunkservers (lizardfs-chunkserver) and one client machine (lizardfs-client).

After a successful installation you have a fully working LizardFS cluster to play with its features.

Cluster configurations

File docker-compose.yml

  • 172.31.0.2: lizardfs-master
  • 172.31.0.3: lizardfs-shadow-01
  • 172.31.0.4: lizardfs-shadow-02
  • 172.31.0.5: lizardfs-shadow-03
  • 172.31.0.10: lizardfs-client
  • 172.31.0.21: lizardfs-chunkserver-01
  • 172.31.0.22: lizardfs-chunkserver-02
  • 172.31.0.23: lizardfs-chunkserver-03
  • http://172.31.0.2:9425: management web interface

Setup

Install Docker with Docker Composer:

sudo apt install docker docker-compose

Alternatively you can install it as described on docs.docker.com.

Start LizardFS cluster

Go to repo directory:

cd lizardfs-docker

Build and run in background:

docker-compose up

You can also append -d flag to run Docker nodes in background, so Docker console output is invisible.

To list all running containers run:

docker ps

To list all of the containers, not only those that are running, append --all flag.

You should have 1 master, 3 chunkservers and 1 client running.

To list Docker images run:

docker images

If you want to see also intermediate images append --all flag.

Stop the cluster

To stop running containers without removing them run:

docker-compose stop

They can be started again with docker-compose start.

Restart the stopped cluster

To start existing container run:

docker-compose start CONTAINER

Remove containers

To remove stopped service containers run:

docker-compose rm

You must be in directory with docker-compose.yml or docker-compose.yaml when running this command.

If you don't want to be asked for removal append -f flag. By default, anonymous volumes attached to containers will not be removed. You can override this with -v. To list all volumes, use docker volume ls.

To remove all unused images, not just dangling ones, run:

docker image prune --all

This will remove all images without at least one container associated to them.

To delete all containers run:

docker rm $(docker ps -a -q)

To delete all images run:

docker rmi $(docker images -q)

Get bash into a running container

docker attach lizardfs-client

or:

docker exec -i -t container-name /bin/bash

-i stands for --interactive and keeps STDIN open even if not attached. -t stands for --tty and allocates a pseudo-TTY.

To mount on lizardfs-client:

docker attach lizardfs-client
mfsmount lizardfs-master:9421:/ /mnt/lizardfs

Troubleshooting

If you have problems with DNS after setting up default docker0 network interface, you may want to set custom IP in /etc/docker/daemon.json:

{
    "bip": "172.31.0.1/16"
}

TODO

  • Remove SSH server (rationale)
  • Remove copy-paste configuration (solution?)
  • Make lizardfs-client wait for lizardfs-master successful start – wait for lizarfds-master start (depends_on is not sufficient)
  • Add option to make docker-compose build an image from a remote git repository
  • Make explicit preference of local apt repo for LizardFS (see: apt_preferences)

This repo is fork of the psarna/lizardfs-docker which is based on moosefs/moosefs-docker-cluster.

About

LizardFS docker test cluster

License:GNU General Public License v3.0


Languages

Language:Shell 55.9%Language:Dockerfile 44.1%