{"id":27375128,"url":"https://github.com/katharostech/docker_lizardfs","last_synced_at":"2025-04-13T12:14:32.777Z","repository":{"id":66216733,"uuid":"132527790","full_name":"katharostech/docker_lizardfs","owner":"katharostech","description":"Docker image for running a LizardFS cluster","archived":false,"fork":false,"pushed_at":"2020-03-11T20:02:22.000Z","size":63,"stargazers_count":14,"open_issues_count":1,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T12:14:27.071Z","etag":null,"topics":["docker","docker-image","lizardfs"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/katharostech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-05-07T23:35:18.000Z","updated_at":"2025-03-13T01:39:28.000Z","dependencies_parsed_at":"2023-02-25T02:15:15.476Z","dependency_job_id":null,"html_url":"https://github.com/katharostech/docker_lizardfs","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"d620a47dabe2af2ed5d2151fb0987d2431f04c5b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katharostech%2Fdocker_lizardfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katharostech%2Fdocker_lizardfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katharostech%2Fdocker_lizardfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katharostech%2Fdocker_lizardfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/katharostech","download_url":"https://codeload.github.com/katharostech/docker_lizardfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710448,"owners_count":21149191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-image","lizardfs"],"created_at":"2025-04-13T12:14:32.263Z","updated_at":"2025-04-13T12:14:32.758Z","avatar_url":"https://github.com/katharostech.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker LizardFS\n\nA Docker image that can be used to build a fully functional [LizardFS](https://lizardfs.com) cluster.\n\n## Usage\n\nThe same Docker image is used to run each different kind of LizardFS service: `master`, `metalogger`, `chunkserver`, `cgiserver`, and `client`. You tell the container which service to run by setting the Docker command, or by passing in the service name after the image name on the commandline.\n\n**docker-compose.yml**\n```yaml\nversion: '3'\nservices:\n  mfsmaster:\n    image: katharostech/lizardfs\n    command: master\n  metalogger:\n    image: katharostech/lizardfs\n    command: metalogger\n...\n```\n\nOr on the commandline:\n\n```bash\n$ docker run -d --name mfsmaster katharostech/lizardfs master\n```\n\n### Services\n\n#### Master, Metalogger, and Chunkserver\n\nThe `master`, `metalogger`, and `chunkserver` services are configured using environment variables ( see [configuration](#Configuration) ).\n\n#### CGI Server\n\nThe CGI Server, by default, starts a webserver inside the container running on port `80`. You can set the `MASTER_HOST` and `MASTER_PORT` environment variables and the container will proxy the internal port 9421 to that master host and port. The web UI will then, by default, connect to that internal proxy when connecting to the master. Alternatively, when accessing the web UI you can put the master host ( and port as well, if it is not `9421` ) in the url: `http://192.168.99.100:8080/mfs.cgi?masterhost=mfsmaster\u0026masterport=19421`.\n\nIf you would, for any reason, like to change the port that the CGI server is running on *inside* the container, you can specify the port after `cgiserver` in the Docker command. For example:\n\n    docker run -d --name cgiserver katharostech/lizardfs cgiserver 8080\n\n#### Client\n\nYou can run the container with the `client` command and it will look for and connect to the `mfsmaster` and mount the filesystem into the container at `/mnt/mfs`. You can change which path the filesystem is mounted to by passing it in after `client`. The container will also need to be run as privileged and linked to the master container. For example:\n\n```bash\n$ docker run -d --name mymaster katharostech/lizardfs master\n$ docker run -d --name myclient --link mymaster:mfsmaster --privileged katharostech/lizardfs client /mnt/my-alternate-moutpoint\n```\n\nAll arguments passed in after `client` and the moutpoint will be passed directly to the `mfsmount` command. You can see all available options with `--help`.\n\n```bash\n$ docker run --privileged katharostech/lizardfs client --help\n```\n\nAfter the client has connected, you can access the LizardFS filesystem by `exec`ing into the container.\n\n```bash\n$ docker exec -it myclient bash\nroot@contianerid:/$ cd /mnt/mfs\nroot@containerid:/mnt/mfs$ echo \"LizardFS file\" \u003e lizardfsfile.txt\nroot@containerid:/mnt/mfs$ cat lizardfsfile.txt\nLizardFS file\n```\n\n## Deployment\n\nThe LizardFS Docker image is deployed easiest through [Docker Compose](https://docs.docker.com/compose/overview) or [Docker Swarm](https://docs.docker.com/engine/swarm/). We have provided a [docker-compose.yml](/docker-compose.yml) file that can be used to test a LizardFS cluster on a local Docker installation such as [Docker Machine](https://docs.docker.com/machine/overview/).\n\n### Docker Compose\n\nDocker Compose is the easiest way to deploy a test LizardFS cluster on a single machine. This is a great way to test the features of LizardFS. Because it only runs on a single machine this setup not useful in production. For running in production use Docker Swarm.\n\nThis repository comes with a Docker Compose file that can be used to run a test cluster. To get started just clone this repository and run `docker-compose up` in the repository root directory.\n\n```bash\n$ cd docker_lizardfs\n$ docker-compose up -d --scale mfsmaster-shadow=2 --scale chunkserver=3 --scale metalogger=4\n```\n\nYou can then hit the web interface on `8080` at the IP address of the server running Docker. On the \"Servers\" tab of the web interface you should be able to see that you have a cluster consisting of 1 master, 2 shadow masters, 3 chunkservers, and 4 metaloggers. Congratulations you are running a full LizardFS cluster!\n\nYou can experiment with the cluster by creating some files. Exec into one of the client containers and copy `/etc` inside the container to the LizardFS mountpoint at `/mnt/mfs`.\n\n```bash\n$ docker-compose exec client1 bash\nroot@containerid:/$ cd /mnt/mfs\nroot@containerid:/mnt/mfs$ cp -R /etc .\n```\n\nThe web UI will show that you now have 218 chunks in your cluster.\n\n![web-ui-screenshot](/web-ui-screenshot.png)\n\n`exec`ing into the other client container will prove that you successfully mounted your LizardFS filesystem on two clients at the same time.\n\n```bash\n$ docker-compose exec client2 bash\nroot@containerid:/$ cd /mnt/mfs\nroot@containerid:/mnt/mfs$ ls\netc\n```\n\n### Docker Swarm\n\nTODO\n\n## Configuration\n\nAll of the LizardFS services can be completely configured through envronment variables. The container will generate the required config files based on the passed in environment variables.\n\n### Skipping Configuration Generation\n\nIf you would instead prefer to mount in configuration files, you can disable config file generation by setting the `SKIP_CONFIGURE` environment variable to `\"true\"`.\n\n\u003e **Note:** Part of the configuration step is changing the owner of the storage directories to `mfs:mfs` so that LizardFS can access them. If you set `SKIP_CONFIGURE=true` this step will be skipped as well. You will have to make sure that the owner of the data directories is uid 9421 and gid 9421. For example: `chown -R 9421:9421 /data/dir`.\n\n### Master Configuration\n\n#### mfsmaster.cfg\n\nThe [mfsmaster.cfg](https://docs.lizardfs.com/man/mfsmaster.cfg.5.html) file is the primary config file for the LizardFS master. It is made up of a list of key-value pairs that are explained in the [documentation](https://docs.lizardfs.com/man/mfsmaster.cfg.5.html). You can add any key-value pair to the `mfsmaster.cfg` file by adding an environment variable in the format of `MFSMASTER_KEY_NAME=value`. For example, if you wanted to run a LizardFS shadow master you could do the following:\n\n```bash\n$ docker run -d --name shadow -e MFSMASTER_PERSONALITY=shadow katharostech/lizardfs\n```\n\nThis you can do for any key-value pairs you want to add to the `mfsmaster.cfg` file.\n\n#### mfsexports.cfg\n\nThe [mfsexports.cfg](https://docs.lizardfs.com/man/mfsexports.cfg.5.html) file configures access to the LizardFS filesystem. Each line in the file allows access to a portion of the filesystem according to the given rules. You set the lines in the file by adding environment variables in the format of `MFSEXPORTS_LINE_NUMBER='line contents'`. The first two lines, `MFSEXPORTS_1` and `MFSEXPORTS_2`, are preset to the LizardFS defaults:\n\n```ini\n*                       /       rw,alldirs,maproot=0\n*                       .       rw\n```\n\nThis exports the root filesystem and the metadata path to any ip address and gives read-write access. These lines can be overwritten by setting the values of `MFSEXPORTS_1` and `MFSEXPORTS_2`. Additional lines can also be added by setting `MFSEXPORTS_3`, `MFSEXPORTS_4`, and so on for however many rules are desired.\n\n#### mfsgoals.cfg\n\nThe [mfsgoals.cfg](https://docs.lizardfs.com/man/mfsgoals.cfg.5.html) file configures replication goals for LizardFS. More information about configuring replication goals can be found in the [LizardFS documentation](https://docs.lizardfs.com/adminguide/replication.html).\n\nThe lines of this file can be configured using environment variables ( see [mfsexports.cfg](#mfsexports.cfg) ). The first five lines are preset to the LizardFS defaults:\n\n```\n1 1 : _\n2 2 : _ _\n3 3 : _ _ _\n4 4 : _ _ _ _\n5 5 : _ _ _ _ _\n```\n\n\u003e **Warning:** When setting goals that require the use of the `$` sign, such as erasure coding rules. Be sure to escape the `$` sign if setting the value in a Docker Compose file. To put a literal `$` in an environment variable in a compose file you use `$$`. For example:\n\u003e\n\u003e ```yaml\n\u003e ...\n\u003e environment:\n\u003e   MFSGOALS_5: \"5 erasure_coding_rule : $$ec(3,1)\"\n\u003e ...\n\u003e ```\n\n#### mfstopology.cfg\n\nThe [mfstopology.cfg](https://docs.lizardfs.com/man/mfstopology.cfg.5.html) file allows you to optionally assign different IP addresses to different network locations.\n\nThe lines of this file can be configured using environment variables ( see [mfexports.cfg](#mfsexports.cfg) ). This file has no entries by default.\n\n### Metalogger Configuration\n\n#### mfsmetalogger.cfg\n\nThe [mfsmetalogger.cfg](https://docs.lizardfs.com/man/mfsmetalogger.cfg.5.html) file is made up of a list of key-value pairs used to configure the Metalogger service.\n\nThis file can be configured using environment variables ( see [mfsmaster.cfg](#mfsmaster.cfg) ).\n\n### Chunkserver Configuration\n\n#### mfschunkserver.cfg\n\nThe [mfschunkserver.cfg](https://docs.lizardfs.com/man/mfschunkserver.cfg.5.html) is made up of a list of key-value pairs used to configure the Chunkserver service.\n\nThis file can be configured using environment variables ( see [mfsmaster.cfg](#mfsmaster.cfg) ).\n\n#### mfshdd.cfg\n\nThe [mfshdd.cfg](https://docs.lizardfs.com/man/mfshdd.cfg.5.html) file is a list of mountpoints or directories that LizardFS will use for storage. In general these should be dedicated drives formatted as either XFS or ZFS. Each line should be a path that will be used for storage. A path prefixed with a `*` will be evacuated and all data will be replicated to different drives.\n\nThe lines of this file can be configured using environment variables ( see [mfexports.cfg](#mfsexports.cfg) ). This file has no entries by default.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatharostech%2Fdocker_lizardfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkatharostech%2Fdocker_lizardfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatharostech%2Fdocker_lizardfs/lists"}