Docker storage mode AUFS Change Device mapper

Source: Internet
Author: User

1. Save the file and close the Docker daemon

2. Install the LVM2 package that contains the dependent files required for the logical partition

$ sudo apt-get install lvm2

3. Select a free disk and create a logical partition

$ sudo pvcreate/dev/xvdf

4. Create a Docker partition group

$ sudo vgcreate DOCKER/DEV/XVDF

5. Create a thin pool and name it thinpool.

In this example, the data logical is 95% of the ' Docker ' volume group size. Leaving this free space allows for auto expanding of either the data or metadata if space runs low as a temporary stopgap.

$ lvcreate--wipesignatures y-n thinpool docker-l 95%vg
$ lvcreate--wipesignatures y-n Thinpoolmeta docker-l 1%VG

6. Convert the pool to Thinpool

$ lvconvert-y--zero n-c 512K--thinpool docker/thinpool--poolmetadata Docker/thinpoolmeta

7. Configure auto-expansion files

$ vim/etc/lvm/profile/docker-thinpool.profile

Specify ' thin_pool_autoextend_threshold ' value.

The value should is the percentage of space used before LVM attempts to autoextend the available space (= disabled).

Thin_pool_autoextend_threshold = 80

Modify the thin_pool_autoextend_percent for when thin pool autoextension occurs.

The value ' s setting is the perentage of space to increase the thin pool (+ disabled)

Thin_pool_autoextend_percent = 20

8.Check your work, your docker-thinpool.profile file should appear similar to the following:

An example/etc/lvm/profile/docker-thinpool.profile file:

Activation {
Thin_pool_autoextend_threshold=80
Thin_pool_autoextend_percent=20
}
9. Submit the LVM configuration file

$ sudo lvchange--metadataprofile docker-thinpool docker/thinpool

10. Confirm that the logical partition is already displayed

$ sudo lvs-o+seg_monitor

11. Clean up the Docker folder

$ rm-rf/var/lib/docker/*

12. Add the following command to/etc/default/docker
–storage-driver=devicemapper–storage-opt=dm.thinpooldev=/dev/mapper/docker-thinpool–storage-opt dm.use_deferred _removal=true

13.If using SYSTEMD and modifying the daemon configuration via unit or drop-in file, reload Systemd to scan for changes.

$ sudo systemctl daemon-reload

14. Turn on the Docker daemon

$ sudo systemctl start docker

15.use LVs without options or lvs-a to see tha data and metadata sizes. To monitor volume group free space, use the VGS command.

16. View the automatic expansion log

$ Journalctl-fu Dm-event.service

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.