Skip to content

Decided to open source my personal lizardfs cluster setup. This works (with qemu) on aarch64 hosts.

Notifications You must be signed in to change notification settings

HMKnapp/lizardfs-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notes

Services

  • lizardfs-cgiserver

  • lizardfs-master

  • lizardfs-metalogger

  • lizardfs-chunkserver

  • lizardfs-mount

Master

Use default .env from master branch.

Chunkserver

Important
Give each chunkserver its own branch with its own .env file. This is because .env is used to configure LABEL and disk mount points.

Build

Note
Always build lizardfs-master

lizardfs-master in docker-compose.yml contains the image that all services share: hmknapp/lizardfs

No other image needs to be built. Different roles are achieved by different service names and their ROLE environment variable.

Upgrade or rebuild

Important
Before upgrading, make sure you have a backup of all ./data/* folders of all nodes, especially master and metalogger. Also keep authorized_keys from ./data/mount/ssh/.
  1. Stop container

    docker stop lizardfs-cgiserver
    docker rm lizardfs-cgiserver
  2. Build and start container

    docker-compose build lizardfs-master
    docker-compose up lizardfs-cgiserver -d
  3. Renew SSH fingerprint for mount points by logging into lizardfs-mount once: ssh -p 22022 lizardfs@localhost

Tips and tricks

Disaster recovery using metaloggers

Note
These steps are recorded from memory, may not be 100% correct.
  1. Log into metalogger and run mfsmetarestore

    mfsmetarestore -m mfsmetadata_ml.mfs -o /tmp/mfsmetadata.mfs change*
    cp session_ml.mfs /tmp/session.mfs
  2. Copy metadata /tmp/*mfs to master’s ./data/master/

  3. Add entrypoint: mfsmetarestore -a to master’s docker-compose.yml

  4. Run docker-compose up lizardfs-master once

  5. Remove lock files from master dir, ./data/master/*lock

  6. Remove entrypoint: mfsmetarestore -a from lizardfs-master in docker-compose.yml

  7. Start master again, docker-compose up lizardfs-master -d

Common Errors

  • [error] [1:1] : can’t create lockfile /var/lib/lizardfs/.mfschunkserver.lock: Permission denied

    Make sure the ./data/* volume directories have correct permissions for user running docker.

Startup

Example: Crontab on chunkserver (192.168.111.3)
@reboot while ! timeout 2 ping -c 1 -n supernode.ntop.org; do sleep 5; done; sleep 5; sudo edge -c SWARM_NAME -k SECRET_KEY -a 192.168.111.3 -l supernode.ntop.org:7777

@reboot while ! [[ -d /mnt/wd-elements-16T/docker ]]; do sleep 3; done; while ! timeout 2 ping -c 1 -n 192.168.111.1; do sleep 0.5; done; sleep 10; sudo systemctl start docker

@reboot while ! timeout 2 ping -c 1 -n 192.168.111.1; do sleep 0.5; done; while ! netcat -z localhost 22022; do sleep 1; done; sleep 1m; sshfs -p 22022 -o allow_root,allow_other,reconnect,ServerAliveInterval=15,ServerAliveCountMax=999,max_conns=12 lizardfs@localhost:/lfs /mnt/lizardfs/
Note
I am aware you can use services to wait for a network connection, but I have had success with the above method.

About

Decided to open source my personal lizardfs cluster setup. This works (with qemu) on aarch64 hosts.

Topics

Resources

Stars

Watchers

Forks