{"id":18358623,"url":"https://github.com/david-yu/vagrant-first-cluster","last_synced_at":"2025-04-10T02:39:43.226Z","repository":{"id":86140122,"uuid":"89667421","full_name":"david-yu/vagrant-first-cluster","owner":"david-yu","description":"Docker EE - First Cluster Setup ","archived":false,"fork":false,"pushed_at":"2017-05-23T23:54:03.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T18:36:30.419Z","etag":null,"topics":["centos","device-mapper","docker-ee-engine"],"latest_commit_sha":null,"homepage":"","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/david-yu.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-28T04:26:49.000Z","updated_at":"2017-09-26T20:25:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"dbc720f8-cf61-4f22-bc7a-1e7df7ca8ba0","html_url":"https://github.com/david-yu/vagrant-first-cluster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/david-yu%2Fvagrant-first-cluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/david-yu%2Fvagrant-first-cluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/david-yu%2Fvagrant-first-cluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/david-yu%2Fvagrant-first-cluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/david-yu","download_url":"https://codeload.github.com/david-yu/vagrant-first-cluster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144798,"owners_count":21054990,"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":["centos","device-mapper","docker-ee-engine"],"created_at":"2024-11-05T22:18:47.460Z","updated_at":"2025-04-10T02:39:43.205Z","avatar_url":"https://github.com/david-yu.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Vagrant Virtualbox setup for Docker EE Engine on CentOS 7.3\n========================\n\nAn exercise on installing Docker EE Engine and properly configuring Device Mapper on CentOS, which may be helpful for walking through the install and configuration of Docker EE Engine before actually doing so in production environments. This vagrant file is provided strictly for educational purposes.\n\n## Download vagrant from Vagrant website\n\n```\nhttps://www.vagrantup.com/downloads.html\n```\n\n## Install Virtual Box\n\n```\nhttps://www.virtualbox.org/wiki/Downloads\n```\n\n## Download CentOS 7 box\n```\n$ vagrant init centos/7\n```\n\n## Make disk directories to store vdi files that are created for VMs in the cluster\n```\n$ mkdir ../vagrant-disks\n```\n\n## Create files in project to store environment variables with custom values for use by Vagrant\n```\nee_url\nucp_password\n```\n\n## Install [vagrant-landrush](https://github.com/vagrant-landrush/landrush) plugin\n```\n\n$ vagrant plugin install landrush\n$ vagrant plugin install vagrant-hostsupdater\n$ vagrant plugin install vagrant-multiprovider-snap\n```\n\n## Bring up nodes\n\n```\n$ vagrant up centos-ucp-node1 centos-ucp-node2 centos-ucp-node3 centos-ucp-node4 centos-ucp-node5\n# Flush Mac's DNS cache\n$ sudo killall -HUP mDNSResponder\n```\n\n## Configure Device Mapper\n\nAfter provisioning the node and installing Docker EE Engine it is highly recommended to configure DeviceMapper to use direct-lvm mode in production. You can read more about selecting Graph Drivers here: https://success.docker.com/KBase/An_Introduction_to_Storage_Solutions_for_Docker_CaaS#Selecting_Graph_Drivers\n\n### Second Storage Device provisioned by Vagrant\n\nThe best practice for configuring DeviceMapper with Docker is to provide a spare block device to create a logical volume as a thinpool for the graph driver storage. The Vagrantfile included below will create a second storage device in `/dev/sdb` with 20GB of space. You can verify this when you run `fdisk -l` you should be able to see the disks that are available to you.\n\n```\n[vagrant@centos-node ~]$ sudo su -\n[root@centos-node ~]# fdisk -l\n\nDisk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors\nUnits = sectors of 1 * 512 = 512 bytes\nSector size (logical/physical): 512 bytes / 512 bytes\nI/O size (minimum/optimal): 512 bytes / 512 bytes\nDisk label type: dos\nDisk identifier: 0x000dc137\n\n  Device Boot      Start         End      Blocks   Id  System\n/dev/sda1            2048        4095        1024   83  Linux\n/dev/sda2   *        4096     2101247     1048576   83  Linux\n/dev/sda3         2101248    83886079    40892416   8e  Linux LVM\n\nDisk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors\nUnits = sectors of 1 * 512 = 512 bytes\nSector size (logical/physical): 512 bytes / 512 bytes\nI/O size (minimum/optimal): 512 bytes / 512 bytes\n\n\nDisk /dev/mapper/VolGroup00-LogVol00: 40.2 GB, 40231763968 bytes, 78577664 sectors\nUnits = sectors of 1 * 512 = 512 bytes\nSector size (logical/physical): 512 bytes / 512 bytes\nI/O size (minimum/optimal): 512 bytes / 512 bytes\n\n\nDisk /dev/mapper/VolGroup00-LogVol01: 1610 MB, 1610612736 bytes, 3145728 sectors\nUnits = sectors of 1 * 512 = 512 bytes\nSector size (logical/physical): 512 bytes / 512 bytes\nI/O size (minimum/optimal): 512 bytes / 512 bytes\n```\n### Configure Device Mapper\n\nConfigure Docker to use DeviceMapper as the graph storage driver: [Configure Docker With DeviceMapper](https://docs.docker.com/engine/userguide/storagedriver/device-mapper-driver/#/configure-docker-with-devicemapper)\n\n### Validate Docker Device Mapper Config\n\nBefore properly configuring Docker with Device Mapper:\n\n```\n[vagrant@centos-node ~]$ docker info\nContainers: 0\n Running: 0\n Paused: 0\n Stopped: 0\nImages: 0\nServer Version: 17.03.1-ee-3\nStorage Driver: overlay\n Backing Filesystem: xfs\n Supports d_type: true\nLogging Driver: json-file\n...\n```\n\nAfter properly configuring Docker with Device Mapper:\n\n```\n[vagrant@centos-node ~]$ docker info\n[vagrant@centos-ucp-node2 ~]$ sudo docker info\nContainers: 0\n Running: 0\n Paused: 0\n Stopped: 0\nImages: 0\nServer Version: 17.03.1-ee-3\nStorage Driver: devicemapper\n Pool Name: docker-thinpool\n Pool Blocksize: 524.3 kB\n Base Device Size: 10.74 GB\n Backing Filesystem: xfs\n Data file:\n Metadata file:\n Data Space Used: 19.92 MB\n Data Space Total: 20.4 GB\n Data Space Available: 20.38 GB\n Metadata Space Used: 61.44 kB\n Metadata Space Total: 213.9 MB\n Metadata Space Available: 213.8 MB\n Thin Pool Minimum Free Space: 2.039 GB\n Udev Sync Supported: true\n Deferred Removal Enabled: true\n Deferred Deletion Enabled: true\n Deferred Deleted Device Count: 0\n Library Version: 1.02.135-RHEL7 (2016-11-16)\nLogging Driver: json-file\nCgroup Driver: cgroupfs\nPlugins:\n Volume: local\n Network: bridge host macvlan null overlay\nSwarm: inactive\nRuntimes: runc\nDefault Runtime: runc\nInit Binary: docker-init\ncontainerd version: 4ab9917febca54791c5f071a9d1f404867857fcc\nrunc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe\ninit version: 949e6fa\nSecurity Options:\n seccomp\n  Profile: default\nKernel Version: 3.10.0-514.2.2.el7.x86_64\nOperating System: CentOS Linux 7 (Core)\nOSType: linux\nArchitecture: x86_64\nCPUs: 2\nTotal Memory: 1.796 GiB\nName: centos-ucp-node2\nID: NC6P:NAW7:SKY2:HSXJ:HK3L:A3XZ:BGBY:D6KG:Z6YE:CECS:OU3R:265C\nDocker Root Dir: /var/lib/docker\nDebug Mode (client): false\nDebug Mode (server): false\nRegistry: https://index.docker.io/v1/\n...\n```\n\n## Stop nodes\n\n```\n$ vagrant halt centos-ucp-node1 centos-ucp-node2 centos-ucp-node3 centos-ucp-node4 centos-ucp-node5\n```\n\n## Destroy nodes\n\n```\n$ vagrant destroy centos-ucp-node1 centos-ucp-node2 centos-ucp-node3 centos-ucp-node4 centos-ucp-node5\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavid-yu%2Fvagrant-first-cluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavid-yu%2Fvagrant-first-cluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavid-yu%2Fvagrant-first-cluster/lists"}